Module vrAssetsModule
[frames] | no frames]

Module vrAssetsModule

Functions
 
applyMaterialAssetsByName(path)
Each material in the scene is replaced by an equally-named material asset that can be found under the specified directory and its sub-directories.
bool
createEnvironmentAsset(environmentNode, assetManagerDirectory)
Saves the given environment node as a new environment asset in the given directory.
bool
createGeometryAsset(node, assetManagerDirectory)
Saves the given node as a new geometry asset in the given directory.
bool
createMaterialAsset(material, assetManagerDirectory)
Saves the given material as a new material asset in the given directory.
bool
createSceneplateAsset(node, assetManagerDirectory)
Saves the given node as a new sceneplate asset in the given directory.
string
getSelectedAssetDirectory(assetType)
Returns the path of the currently selected directory in the Asset Manager directory view in the tab of the given asset type.
 
getSelectedMaterialAssetDirectory()
Deprecated.
bool
loadEnvironmentAssetByName(assetName, assetPath)
Load an environment asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored.
bool
loadEnvironmentAssetByUUID(assetUUID)
Searches for an environment asset with the given UUID in the Asset Manager and loads it, if found.
vrNodePtr
loadGeometryAssetByName(assetName, assetPath)
Load a geometry asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored.
vrNodePtr
loadGeometryAssetByUUID(assetUUID)
Searches for a geometry asset with the given UUID in the Asset Manager and loads it, if found.
vrMaterialPtr
loadMaterialAssetByName(assetName, assetPath)
Load a material asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored.
vrMaterialPtr
loadMaterialAssetByUUID(assetUUID)
Searches for a material asset with the given UUID in the Asset Manager and loads it, if found.
vrNodePtr
loadSceneplateAssetByName(assetName, assetPath)
Load a sceneplate asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored.
vrNodePtr
loadSceneplateAssetByUUID(assetUUID)
Searches for a sceneplate asset with the given UUID in the Asset Manager and loads it, if found.
bool
overwriteEnvironmentAsset(environmentAsset)
If the given environment node has a reference to an already existing environment asset in the Asset Manager, it overwrites that asset.
bool
overwriteGeometryAsset(assetRootNode)
If the given node has a reference to an already existing geometry asset in the Asset Manager, it overwrites that asset.
bool
overwriteMaterialAsset(material)
If the given material has a reference to an already existing material asset in the Asset Manager, it overwrites that asset.
bool
overwriteSceneplateAsset(assetRootNode)
If the given node has a reference to an already existing sceneplate asset in the Asset Manager, it overwrites that asset.
 
reloadAllAssetDirectories()
Reloads all directories in the asset manager.
 
reloadAssetDirectory(url)
Reloads the directory with the specified path.
Variables
  VR_ASSET_ENVIRONMENT = 2
  VR_ASSET_GEOMETRY = 3
  VR_ASSET_MATERIAL = 1
  VR_ASSET_SCENEPLATE = 4
Function Details

applyMaterialAssetsByName(path)

 

Each material in the scene is replaced by an equally-named material asset that can be found under the specified directory and its sub-directories.

Parameters:
  • path (string) - The path to the directory containing material assets.

createEnvironmentAsset(environmentNode, assetManagerDirectory)

 

Saves the given environment node as a new environment asset in the given directory. Returns whether save was successful. If successful, the given node points to the saved asset afterwards.

Parameters:
  • environmentNode (vrNodePtr) - The environment node to be saved as asset.
  • assetManagerDirectory (string) - Path of a directory in the Asset Manager.
Returns: bool
Success.

createGeometryAsset(node, assetManagerDirectory)

 

Saves the given node as a new geometry asset in the given directory. Returns whether save was successful.

Please note that the node needs to be a valid asset root which is a Transform3D node that has at leat one child node.

If successful, the given node points to the saved asset afterwards.

Parameters:
  • node (vrNodePtr) - The node to be saved as asset. Needs to be a Transform3D node.
  • assetManagerDirectory (string) - Path of a directory in the Asset Manager.
Returns: bool
Success.

createMaterialAsset(material, assetManagerDirectory)

 

Saves the given material as a new material asset in the given directory. Returns whether save was successful. If successful, the given material points to the saved asset afterwards. Updates the Material Editor and Asset Manager UI.

Parameters:
  • material (vrMaterialPtr) - The material to be saved as asset.
  • assetManagerDirectory (string) - Path of a directory in the Asset Manager.
Returns: bool
Success.

createSceneplateAsset(node, assetManagerDirectory)

 

Saves the given node as a new sceneplate asset in the given directory. Returns whether save was successful.

If successful, the given node points to the saved asset afterwards.

Parameters:
  • node (vrNodePtr) - The sceneplate to be saved as asset.
  • assetManagerDirectory (string) - Path of a directory in the Asset Manager.
Returns: bool
Success.

getSelectedAssetDirectory(assetType)

 

Returns the path of the currently selected directory in the Asset Manager directory view in the tab of the given asset type.

Parameters:
  • assetType (enumeration) - Allowed parameters are: VR_ASSET_MATERIAL, VR_ASSET_GEOMETRY, VR_ASSET_ENVIRONMENT, VR_ASSET_SCENEPLATE
Returns: string
The path of the selected directory. If no directory is selected, an empty string is returned.

getSelectedMaterialAssetDirectory()

 

Deprecated. Please use getSelectedAssetDirectory(VR_ASSET_MATERIAL) instead.

Returns the path to the currently selected directory in the material assets tab of the Asset Manager.

Returns:
The path of the selected directory. If no directory is selected, an empty string is returned.

loadEnvironmentAssetByName(assetName, assetPath)

 

Load an environment asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored. Specifying a path might be necessary if there are assets with the same name in the Asset Manager. The loaded environment asset is added to the scene, and to the default environment switch, if present.

Parameters:
  • assetName (string) - The name of the environment asset.
  • assetPath (string) - Optional: The path to the directory containing the environment asset. The asset is searched in all subdirectories, too. Omit this parameter to search in all paths in the Asset Manager.
Returns: bool
Success.

loadEnvironmentAssetByUUID(assetUUID)

 

Searches for an environment asset with the given UUID in the Asset Manager and loads it, if found. The loaded environment asset is added to the scene, and to the default environment switch, if present.

Parameters:
  • assetUUID (string) - The UUID of the environment asset. You can lookup the UUID of a stored asset in its xml file.
Returns: bool
Success.

loadGeometryAssetByName(assetName, assetPath)

 

Load a geometry asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored. Specifying a path might be necessary if there are assets with the same name in the Asset Manager. The loaded geometry asset is added to the scene

Parameters:
  • assetName (string) - The name of the geometry asset.
  • assetPath (string) - Optional: The path to the directory containing the geometry asset. The asset is searched in all subdirectories, too. Omit this parameter to search in all paths in the Asset Manager.
Returns: vrNodePtr
The root node of the loaded asset.

loadGeometryAssetByUUID(assetUUID)

 

Searches for a geometry asset with the given UUID in the Asset Manager and loads it, if found. The loaded geometry asset is added to the scene.

Parameters:
  • assetUUID (string) - The UUID of the geometry asset. You can lookup the UUID of a stored asset in its xml file.
Returns: vrNodePtr
The root node of the loaded asset.

loadMaterialAssetByName(assetName, assetPath)

 

Load a material asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored. Specifying a path might be necessary if there are assets with the same name in the Asset Manager. The loaded material asset is added to the scene and returned by this function. Updates the Material Editor UI afterwards.

Parameters:
  • assetName (string) - The name of the material asset.
  • assetPath (string) - Optional: The path to the directory containing the material asset. The asset is searched in all subdirectories, too. Omit this parameter to search in all paths in the Asset Manager.
Returns: vrMaterialPtr
The loaded material asset.

loadMaterialAssetByUUID(assetUUID)

 

Searches for a material asset with the given UUID in the Asset Manager and loads it, if found. The loaded material asset is added to the scene and returned by this function. Updates the Material Editor UI afterwards.

Parameters:
  • assetUUID (string) - The UUID of the material asset. You can lookup the UUID of a stored asset in its xml file.
Returns: vrMaterialPtr
The loaded material asset.

loadSceneplateAssetByName(assetName, assetPath)

 

Load a sceneplate asset from the Asset Manager by specifying the name of the asset and, optionally, the path where it is stored. Specifying a path might be necessary if there are assets with the same name in the Asset Manager. The loaded sceneplate asset is added to the scene

Parameters:
  • assetName (string) - The name of the sceneplate asset.
  • assetPath (string) - Optional: The path to the directory containing the sceneplate asset. The asset is searched in all subdirectories, too. Omit this parameter to search in all paths in the Asset Manager.
Returns: vrNodePtr
The root node of the loaded asset.

loadSceneplateAssetByUUID(assetUUID)

 

Searches for a sceneplate asset with the given UUID in the Asset Manager and loads it, if found. The loaded sceneplate asset is added to the scene.

Parameters:
  • assetUUID (string) - The UUID of the sceneplate asset. You can lookup the UUID of a stored asset in its xml file.
Returns: vrNodePtr
The root node of the loaded asset.

overwriteEnvironmentAsset(environmentAsset)

 

If the given environment node has a reference to an already existing environment asset in the Asset Manager, it overwrites that asset. This makes sense if the environment has been modified. Returns whether successful. The node still points to the same asset afterwards.

Parameters:
  • environmentAsset (vrNodePtr) - An environment node referencing an environment asset in the Asset Manager.
Returns: bool
Success.

overwriteGeometryAsset(assetRootNode)

 

If the given node has a reference to an already existing geometry asset in the Asset Manager, it overwrites that asset. Returns whether successful. The node still points to the same asset afterwards.

Parameters:
  • assetRootNode (vrNodePtr) - An node referencing an geometry asset in the Asset Manager.
Returns: bool
Success.

overwriteMaterialAsset(material)

 

If the given material has a reference to an already existing material asset in the Asset Manager, it overwrites that asset. This makes sense if the material has been modified. Returns whether successful. The material still points to the same asset afterwards.

Updates the Material Editor and Asset Manager UI.

Parameters:
  • material (vrMaterialPtr) - A material referencing a material asset in the Asset Manager.
Returns: bool
Success.

overwriteSceneplateAsset(assetRootNode)

 

If the given node has a reference to an already existing sceneplate asset in the Asset Manager, it overwrites that asset. Returns whether successful. The node still points to the same asset afterwards.

Parameters:
  • assetRootNode (vrNodePtr) - An node referencing an sceneplate asset in the Asset Manager.
Returns: bool
Success.

reloadAllAssetDirectories()

 

Reloads all directories in the asset manager. No scene assets are updated.

reloadAssetDirectory(url)

 

Reloads the directory with the specified path. No scene assets are updated.

Parameters:
  • url (string) - Directory path.