vrWebEngineService

class vrWebEngineService

(Inherits vrBaseService)

This service gives access to all web engines in VRED. Web engines created with this service will be visible in the media editor. Web engines used in sceneplates will be directly created with the sceneplate. Sceneplate web engines can be accessed with this service but not deleted.

Note: This service can also manage the groups in the Media Editor. These groups have no unique names so the user is responsible to create unique ones if he wants to work on them with the scripting API. All functions that take a group name as parameter will take the first one they find with the given name.

This is an example on how to create a web engine and assign to an object:

#create a geometry in the scene to assign a web engine
box = createBox(1000, 1000, 1000, 2, 2, 2, 1, 1, 1)

#create a web engine with a given url
webEngine = vrWebEngineService.createWebEngine("autodeskEngine")
webEngine.setTextureSlot(vrdWebEngine.TextureSlotType.Diffuse)
webEngine.setUrl("www.autodesk.com")

#assign web engine to the box material
webEngine.setMaterial(box.getMaterial())

Functions

vrWebEngineService.anyWebEngineHasFocus()

Return true if any web engine has the input focus.

Returns:True if any engine has the focus, False othewise.
Return type:bool
vrWebEngineService.createGroup(name, parentGroup='')

Creates a group in the Media Editor.

Parameters:
  • name (string) – The name of the new group
  • parentGroup (string) – The name of the parent group (optional)
vrWebEngineService.createWebEngine(name, group='')

Creates a web engine.

If the group parameter is specified, the web engine will be attached to the group in the Media Editor with the given name.

Parameters:
  • name (string) – The name of the web engine.
  • group (string) – The group in the media editor to place the web engine (optional)
Returns:

The created web engine.

Return type:

vrdWebEngine

vrWebEngineService.getWebEngine(name)

Gets a web engine by name.

If multiple engines with the same name exist, it will return just one of them. Web engines used in sceneplates have the same name as its sceneplate.

Parameters:name (string) – The name of the web engine
Returns:The web engine.
Return type:vrdWebEngine
vrWebEngineService.getWebEngines()

Returns a list of all the web engines in VRED.

Returns:A list of web engines.
Return type:List[vrdWebEngine]
vrWebEngineService.isInteractionEnabled()

Returns true if interaction with web engines is enabled.

Returns:True if interaction is enabled, False otherwise.
Return type:bool
vrWebEngineService.reloadAllWebEngines()

Triggers a reload on all web engines in VRED.

vrWebEngineService.removeGroup(name)

Removes a group in the Media Editor.

Parameters:name (string) – The name of the group.
Returns:True if the group has been removed, False otherwise.
Return type:bool
vrWebEngineService.removeWebEngine(webengine)

Removes a web engine.

Parameters:webengine (vrdWebEngine) – The web engine to remove. Web engines used in sceneplates will not be removed with this. They will be removed with their sceneplate.
Returns:True if successful, False otherwise.
Return type:bool
vrWebEngineService.renameGroup(oldName, newName)

Rename a group in the Media Editor.

Parameters:
  • oldName (string) – The current name of the group
  • newName (string) – The new name of the group
vrWebEngineService.reparentGroup(name, newParentName)

Move a group in the Media Editor to a different parent.

Parameters:
  • name (string) – The name of the group to move
  • newParentName (string) – The name of the new parent group. If the name is an empty string, the group will be moved to the top level.
vrWebEngineService.reparentWebEngine(webengine, newParentName)

Move a web engine to a different group in the Media Editor.

Parameters:
  • webengine (vrdWebEngine) – The web engine to move.
  • newParentName (string) – The name of the new parent group. If the name is an empty string, the web engine will be moved to the top level.
vrWebEngineService.setInteractionEnabled(enable)

Enables or disables the interaction with all web engines in the scene.

Parameters:enable (bool) – True to enable, False to disable interaction.

Signals

vrWebEngineService.groupCreated(name)

Signal is sent when a new group has been created.

Parameters:name (string) – The name of the new group
vrWebEngineService.groupRemoved(name)

Signals that a group has been removed.

Parameters:name (string) – The name of the removed group.
vrWebEngineService.structureChanged()

Signal is sent when any structural change on the graph in the media editor has been made through the service.

vrWebEngineService.urlChanged(webengine, url)

Signal is sent when the url of the web has been changed.

Parameters:
  • webengine (vrdWebEngine) – The web engine.
  • url (string) – The new url.
vrWebEngineService.webEngineCreated(webengine)

Signal is sent when a new web engine has been created.

Parameters:webengine (vrdWebEngine) – The created web engine.
vrWebEngineService.webEngineRemoved(webengine)

Signal is sent when a web engine has been removed.

Parameters:webengine (string) – The name of the removed web engine.