NodeIDs are generated during runtime. There is no guarantee, that the nodeIDs of a loaded model
are the same, if the 3D Space was reloaded in the browser.
The NodePathAPI allows the user to handle nodes with static identifiers, which are not
changed during runtime. This holds, if the model resource is not changed.
Example
// Get an instance of the ContextAPIconstmyContext = webvis.getContext( "example" )// add some modelmyContext.add(someModelURI);// the model is currently loading in the browser and we know, that the parts which are of interest have the nodeIDds 170 and 171// we execute the following code in the console to get a string that can be used to refer to the part everytimeconsthandles = awaitmyContext.createNodePathHandles([170, 171]);constnodePathStrings = awaitmyContext.requestNodePathStrings(handles);// Afterwards the nodePathStrings can be used to retrieve the runtime nodeIDs by scriptconstnodePathHandleMap = awaitmyContext.requestNodePathHandleMap(nodePathStrings);for (constnodePathStringofnodePathStrings) {console.log(nodePathString + " has the nodeID " + nodePathHandleMap[nodePathString].nodeID);}
NodeIDs are generated during runtime. There is no guarantee, that the nodeIDs of a loaded model are the same, if the 3D Space was reloaded in the browser.
The NodePathAPI allows the user to handle nodes with static identifiers, which are not changed during runtime. This holds, if the model resource is not changed.
Example