Scenegraph
- Last UpdatedFeb 19, 2025
- 13 minute read
The Scenegraph node enables script code to access and interact with scene content that are not managed directly by a mesh or Item node instance. It also supports MWX, RFC/GCD, SoupMesh, SPC, SGL, and POPMesh content types through a single unified interface.
The Scenegraph is deeply coupled with the PickSensor because it uses the IDs returned by its Async fields (pickMeshMouseAsync and pickMeshRayAsync) to reference some scene content.
Platform support
Although the Scenegraph node is available in all platforms, SPC, RFC/GCD and SGL content types are supported on Windows only.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Partial support |
Partial support |
Partial support |
Partial support |
|
|
|
|
|
|
Using Scenegraph to customize content display
The Scenegraph node provide functionalities to customize the way in which whole content files or single geometries are displayed in the scene. These functionalities are unified because they work the same way on all supported content types (Mwx, RFC, SoupMesh, SPC, SGL and POPMesh ) and are based on geometry pickIds.
There are four different categories of functions that can be applied separately or together:
-
Highlight (silhouette): Supported by all content types, except SPC. Draws a colored geometry contour on top of the rendered image. It supports RGBA colors and has the possibility to skip the Z pass to better see the geometry even when clipped. This last feature will not work with SGL nodes.
-
Filler: Supported by all content types, except SPC. Draws a colored area over a geometry on top of the rendered image. It supports RGBA color, but differently to Highlight is always drawn without considering the geometry Z. Applying this property to a SGL geometry will change its override color instead.
-
Override Color and Opacity: Supported by all content types. Geometries can be rendered with an RGB color added on top. The way in which the color is blended with underlaying material and shader data differs from content type to content type. Opacity can be used with or without the override color to manage the opacity of the geometries.
-
Applying Visibility with Scenegraph: Supported by all content types. Allows to switch visibility of contents on and off.

Stateful and Stateless modes
Each of the above four display customizations can be consumed in a stateful or in a stateless mode.
-
Stateful mode: The functionality is managed by a dstring where the key is a geometry pickID and the value depends on the functionality. When adding or modifying an entry to the dictionary, the customization is immediately applied. When removing an entry, the customization is reset.
-
Stateless mode: The functionality is managed by a set of sfunction fields. Each field allows to individually apply or reset a customization to a single geometry element or to a whole file. The node does not keep any trace of previously applied functions.
Selecting which approach to follow depends on requirements and personal preferences.
Note: Stateful and stateless functions are not reconciled, so we recommend using one or the other approach on a single display customization functionality.
Batch appearance operations using JSON
In most cases, when stateless mode is selected, it’s because better performance is required. An additional boost to performance can be achieved by batching operations together through the use of the jsonBatchOperation field. This field is an SFunction that accepts a list of operations on model appearance in the form of JSON.
Code example
This is a code example for the jsonBatchOperation field.
{
"op": "setColorAndOpacity",
"models": [
{
"tags": ["DESIGN-AREA-200-STRUCTURE_ST001"],
"name": "ARF/rfc_IED_OILGAS",
"visualContexts": ["vc01"],
"ids": [123,345,333],
"color": [1,0,0],
"alpha": 0.1
},
{
"name": "EATON_3DModel",
"tags": ["/CLASS1_DIV2\\PROCESS_EQUIP"],
"ids": [830],
"color": [0.0,0.0,1.0],
"alpha": 0.1
},
{
"name": "template_dr",
"tags": ["cube_default"],
"color": [1.0,1.0,0.0]
},
{
"name": "spc/spc_Oberhausen94",
"tags": ["Oberhausen213.lsc"],
"ids": [],
"color": [1.0,1.0,1.0],
"alpha": 0.7
}
{
"name": "ARF/rfc_IED_OILGAS",
"filter": “opaque”,
"color": [1,0,0],
"alpha": 0.5
},
{
"name": "SGL/sgl_smallModified",
"color": [0,1,1],
"ids": ["{-2013286676/1942}","{-2013286676/1941}"],
},
{
"name": "POP/POPMesh_014",
"tags": ["/EQUI-15B","/ROOF","/CRANE_300T"],
"ids": [212, 192, 208],
"color": [1.0,0.0,1.0],
"alpha": 0.8
}
]
}
Note: MwxSoup models can sometimes contain detached mesh geometries that are generated at import time, along with triangle soups. However, currently, the above json does not support detached mesh geometries, so it's not possible to include these elements in the tag attribute for an MwxSoup model.
Properties
These are the properties of the provided JSON.
|
jpath |
Type |
Use |
Description |
|---|---|---|---|
|
$[‘op’] |
string |
Mandatory |
This property defines the operation to perform. Supported operations are: setColorAndOpacity, resetColorAndOpacity, setFiller, resetFiller, setHighlight, resetHighlight, show, hide. The behaviour reflects exactly the corresponding SFUNCTION fields, for instance calling setColorAndOpacityForID with a tag path and a color is equivalent to calling jsonBatchOperation with setColorAndOpacity as op and the same tag and color. |
|
$[‘models’] |
array |
Mandatory |
Array of JSON objects, each containing a set of parameters required by the op. |
|
$[‘models’][X][‘name’] |
string |
Mandatory |
The model identifier, exactly as found in pickIDs. such as for MWX and MWXSoup, this would be the model name. On SPCs, it would be spc/NODE_NAME. On RFCs, it would be ARF/NODE_NAME. |
|
$[‘models’][X][‘tags’] |
Array<string> |
Optional |
Each element should contain a tag path, as it would be retrieved from resolvePathFromID, excluding the initial model part. |
|
$[‘models’][X][‘ids’] |
Array<int> |
Optional |
Each element should contain the numeric part of a pickID, used only on MWXSOUP and RFCs. |
|
$[‘models’][X][‘ids’] |
Array<string> |
Optional |
ONLY FOR SGL List of SGL ids, using SGL pickIDs syntax: {num1,num2} |
|
$[‘models’][X][‘color’] |
Array<float> |
Optional |
Used to set the color by setColorAndOpacity, setHighlight, setFiller. The default value is 1 1 1. |
|
$[‘models’][X][‘alpha’] |
float |
Optional |
Used to set the opacity by setColorAndOpacity, setHighlight, setFiller. The default value is 1. |
|
$[‘models’][X][‘skipZ’] |
boolean |
Optional |
Used by setHighlight. A value of true makes the highlight skip the z test . The default value is false. |
|
$[‘models’][X][‘filter’] |
string |
Optional |
Used for retrieving elements based on filter name and apply operation to them.
|
|
$[‘models’][X][‘visualContexts’] |
Array<string> |
Optional |
Used to set the Visual Contexts on which the operation is performed. If not specified, or if specified as an empty array, the operation will be performed on all currently available Visual Contexts. Visual Contexts are not supported by SGL. |
Using Scenegraph to navigate model hierarchies
The Scenegraph node provide functionalities to navigate loaded models hierarchies. There are two possible ways of using these functionalities:
-
Using pickIDs as provided by PickSensors. PickIDs represent geometries of a model.
-
Using tag paths as shown from XR Studio Scene Explorer tab. Tags are names and can be associated with none, one or more pickID.
In XR Studio, the tree representation of models in the Scene Explorer tab is based on tags hierarchy. Not all models are the same, for details on pickIDs and tags for each model type, see Model Hierarchies.
Scenegraph fields
These are the fields for the Scenegraph node. Only the node-specific fields are indicated, not fields obtained by inheritance.
NodeBase > Scenegraph
|
Fields |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
colorAndOpacityIDs |
dstring |
Optional |
Used to set two different functionalities: override color and opacity. The DSTRING format requires the element unique ID as key. For values, it accepts one SFLOAT (to manage opacity only) and one SVEC3 (to manage color only), or an SVEC4 (to manage color and opacity). Always operates on all available visual contexts. |
|
|
fillerIDs |
dstring |
Optional |
Used to show a colored filler over a scene element. The DSTRING format requires the element unique ID as key and the SVEC3/SVEC4 color definition as value. Always operates on all available visual contexts. |
|
|
getBBoxForID |
sfunction |
Optional |
SVEC3,SVEC3 getBBoxForID.execute (MSTRING ids) Returns the axis aligned bounding box (minimum,maximum) associated to the passed element pickIDs. It is possible to mix different geometry types inside the same list. Not supported in SGL. To retrieve the whole geometry bounding box:
|
|
|
getBBoxForPaths |
sfunction |
Optional |
SVEC3,SVEC3 getBBoxForPaths.execute (MSTRING paths) Returns the axis aligned bounding box (minimum,maximum) associated to the passed element paths. It is possible to mix different geometry types inside the same list. Not supported in SGL. To retrieve the whole geometry bounding box:
|
|
|
getBSphereForID |
sfunction |
Optional |
SVEC4 getBSphereForID.execute (SSTRING Id) Returns the bounding sphere (x,y,z,radius) associated to the passed element pickID. For RFC and POPMesh geometries, if a model name with no pickID is passed, the whole geometry Bounding Sphere is returned. Not supported in SGL. |
|
|
getChildrenForPath |
sfunction |
Optional |
MSTRING getChildrenForPath.execute(FILE|TAG) Returns the list of children TAGs (first level only) for the specified TAG on a model FILE. For example, getChildrenForPath.execute(ARF/model_node|TAG) returns TAG1,TAG2 and so on. Note that if FILE corresponds to an SPC model, this function will return the full list of scans for that model. Not supported in SGL. |
|
|
getIDsForPath |
sfunction |
Optional |
MSTRING getIDsForPath.execute(FILE|TAG) Returns the pickIDs associated with the TAG on a FILE. For example, getIDsForPath.execute(ARF/model_node|TAG) returns ARF/model_node§uniqueID1, ARF/model_node§uniqueID2. It returns “NOT_FOUND” if the TAG was not found. It returns “” if the TAG was found but had no pickIDs. For POPMeshes it returns "" also if the tag was not found. Note that on MWX and SPC a FILE|TAG path always correspond to the pickID, so this function for those types of models will return back the provided string as is. Not supported in SGL. |
|
|
getIDsForSubtree |
sfunction |
Optional |
MSTRING getIDsForSubtree.execute(FILE|TAG) Returns the pickIDs associated with the TAG on a FILE and all pickIDs children to it in the model hierarchy. For example, getIDsForSubtree.execute(ARF/model_node|TAG) returns ARF/model_node§uniqueID1, ARF/model_node§uniqueID2. It returns “NOT_FOUND” if the TAG was not found. It returns “” if the TAG was found but no pickIDs were found in the subtree. For POPMeshes it returns "" also if the tag was not found. Note that on SPC a FILE|TAG path always correspond to the pickID, so this function for those types of models will return back the provided string as is. Not supported in SGL. |
|
|
getInsulationObstructionPids |
sfunction |
Optional |
MSTRING getInsulationObstructionPids.execute(SSTRING param) The param can be any valid pick id(ARF/model_node§uniqueID) in the RFC or the RFC node name(model_node). Returns the list of Insulation/Obstruction uniqueIDs for the specified RFC FILE. For example, getInsulationObstructionPids.execute(ARF/model_node§uniqueID) returns ARF/model_node§uniqueID1, ARF/model_node§uniqueID2 and so on. This function works only with RFC files and POPMesh files. . |
|
|
getIsSignificantForPath |
sfunction |
Optional |
SSTRING getIsSignificantForPath(FILE|TAG1|TAG2) Returns a pipe separated string with Boolean value for significance for each TAG in the provided path. For example: Providing ARF/rfc_model|TAG1|TAG2 the return value could be rfc|true|false SoupMeshes use a naming convention for tag significance: if the tag starts with a / then it is significant, otherwise it is not. RFCs of type GCD are not parsed for tag significance metadata, the only non-significant tags are the ones starting with “__UNNAMED-“, which are nodes originally exported with no name. Not supported in SGL. |
|
|
getTypeForPath |
sfunction |
Optional |
SSTRING resolveTypeForPath(FILE|TAG1|TAG2) Returns a pipe separated string with type for each TAG in the provided path. For example: Providing ARF/rfc_model|TAG1|TAG2 the return value could be rfc|EQUI|CYLI On RFCs, depending on how the models were exported, the type information can be absent. Whenever a type for a tag is not found, it is returned “UNKNOWN”, for example: rfc|UNKOWN|EQUI|… Not supported in SGL. |
|
|
hasGeometryForPath |
sfunction |
Optional |
SSTRING hasGeometryForPath.execute(PATH) Returns true, if the provided tag path features a pickable geometry in its subtree. Returns false, if the provided tag path does not feature a pickable geometry in its subtree. (For POPMeshes it returns "" in this case). Returns NOT_FOUND, if the provided tag path doesn't exist in the model hierarchy. Not supported in SGL. |
|
|
hideForAllID |
sfunction |
Optional |
VOID hideForAllID.execute(ID) Hides a whole file content. It accepts as ID the file node name or a valid file pickID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
hideForID |
sfunction |
Optional |
VOID hideForID.execute(ID) Hides a scene content. It accepts a valid pickID. For RFCs it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
highlightsIDs |
dstring |
Optional |
Used to show a colored silhouette around a scene element. The DSTRING format requires the element unique ID as key and the SVEC3/SVEC4 color definition, together with optional Z test skip SBOOL, as value. Always operates on all available visual contexts. |
|
|
jsonBatchOperation |
sfunction |
Optional |
Performs batched appearance operations on one or more models in the scene. See detailed explanation in the dedicated section above. |
|
|
resetColorAndOpacityForAllID |
sfunction |
Optional |
VOID resetColorAndOpacityForAllID.execute(ID) Resets the color and opacity settings for a whole file. It accepts as ID the file node name or a valid file uniqueID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resetColorAndOpacityForID |
sfunction |
Optional |
VOID resetColorAndOpacityForID.execute(ID) Resets the color and opacity settings for a scene element. It accepts as ID a valid file pickID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resetFillerForAllID |
sfunction |
Optional |
VOID reseFillerForAllID.execute(ID) Resets the filler settings for a whole file. It accepts as ID the file node name or a valid file pickID. For RFCs it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resetFillerForID |
sfunction |
Optional |
VOID resetFillerForID.execute(ID) Resets the filler settings for a scene element. It accepts as ID a valid file pickID. For RFCs it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resetHighlightForAllID |
sfunction |
Optional |
VOID resetHighlightForAllID.execute(ID) Resets the highlight settings for a whole file. It accepts as ID the file node name or a valid file pickID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resetHighlightForID |
sfunction |
Optional |
VOID resetHighlightForID.execute(ID) Resets the highlight settings for a scene element. It accepts as ID a valid file pickID. For RFCs it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
resolveContainerNodeForID |
sfunction |
Optional |
SSTRING resolveContainerNodeForID.execute(ID) Returns the container node name to the passes pickID. If the pickID is invalid, it returns an empty string. Not supported in SGL. |
|
|
resolveNameForID |
sfunction |
Optional |
SSTRING resolveNameForID.execute (SSTRING Id) Returns the name associated to the passed element pickID. On RFCs, it will resolve to the first significant tag from that node up in hierarchy. On SPCs, it will return the scan name of the pickID. Not supported in SGL. |
|
|
resolvePathForID |
sfunction |
Optional |
SSTRING resolvePathForID.execute (SSTRING Id) Returns the pipe-separated path associated to the passed element pickID as represented in the Scene Explorer hierarchy for any geometry type. On MWX and SPCs, it will return back the provided string, as for those model types there is no difference between pickID and TAG path. Not supported in SGL. |
|
|
resolveSecondaryPathsForID |
sfunction |
Optional |
SSTRING resolveSecondaryPathsForID.execute (SSTRING Id) Returns the list of pipe-separated Secondary Hierarchy paths separated by '§' associated to the passed element pickID as represented in the Scene Explorer hierarchy. This function works only with RFC files. Returns an empty string for other types and logs a warning. |
|
|
resolveTypeForID |
sfunction |
Optional |
SSTRING resolveTypeForID.execute(ID) Returns the element type to the passes pickID. If the ID is invalid, it returns an empty string. Not supported in SGL. |
|
|
setColorAndOpacityForAllID |
sfunction |
Optional |
VOID setColorAndOpacityForAllID.execute(ID=COLOR) Sets the color and opacity settings for a whole file. It accepts as ID as a valid file pickID. As COLOR it accepts an SFLOAT (to set opacity only) and an SVEC3 (to set color only), or an SVEC4 (to set both color and opacity). Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
setColorAndOpacityForID |
sfunction |
Optional |
VOID setColorAndOpacityForID.execute(ID=COLOR) Sets the color and opacity settings for a scene element. It accepts as ID a valid pickID. As COLOR it accepts an SFLOAT (to set opacity only) and an SVEC3 (to set color only), or an SVEC4 (to set both color and opacity). For RFCs, it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
setFillerForID |
sfunction |
Optional |
VOID setFillerForID.execute(ID=COLOR) Sets the filler settings for a scene element. It accepts as ID a valid pickID. As COLOR it accepts an SVEC3 (solid color) or an SVEC4 (color with alpha). For RFCs, it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
setHighlightForID |
sfunction |
Optional |
VOID setHighlightForID.execute(ID=COLOR) Sets the highlight settings for a scene element. It accepts as ID a valid pickID. As COLOR it accepts an SVEC3 (solid color) or an SVEC4 (color with alpha). For RFCs, it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
setVisibilityForID |
sfunction |
Optional |
VOID setVisibilityForID.execute(ID=STATE) Sets the visibility for a scene element. It accepts as ID a valid pickID. As STATE it accepts an SBOOL. For RFCs, it also accepts a TAG path. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
showForAllID |
sfunction |
Optional |
VOID showForAllID.execute(ID) Shows a whole file content. It accepts as ID the file node name or a valid file pickID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
showForId |
sfunction |
Optional |
VOID showForID.execute(ID) Shows a scene content. It accepts a valid uniqueID. Operates on the currently set visualContexts list. See visualContexts field description. |
|
|
visibilityIDs |
dstring |
Optional |
Sets object visibility. The DSTRING format requires the element unique ID as key and the SBOOL visibility state as value. Always operates on all available visual contexts. |
|
|
visualContexts |
mstring |
Optional |
Sets the Visual Contexts on which the operation is performed. If not specified, or if specified as an empty list, the operation will be performed on all currently available Visual Contexts. Visual Contexts are used for any operation involving visual aspects, such as: setColorAndOpacity, setFiller, setHighlight, show, hide, setVisibility and their reset and all counterparts. Not supported in SGL. |