I have a issue where I need to add a translate/rotate as a parent.
The node I'm adding the parent to has a peer(insert is therefore not
an option) so I'm unclear just how to do this with the current API.
Here is the code that I tried. ( The main issue here is that the
plane body and the propeller are peers in the scene graph, I could
just deal with the propeller children, but that would require making
changes to my application and then some additional work dealing with
the other renderer that I currently have implemented)
var id =
this.name( rotNode )+"Rotation";
var rotNodeID = rotNode.get( "id" );
var parent = rotNode.parent();
parent.remove( { node: rotNodeID } );
var newN = parent.add( "node", {
"type": "rotate",
"id": id,
"x": 0,
"y": 0,
"z": 0,
"angle": 0,
} );
newN.add( "node", rotNodeID ); // fails
// rot = rotNode.insert( "node", {
// "type": "rotate",
// "id": id,
// "x": 0,
// "y": 0,
// "z": 0,
// "angle": 0,
// } );
The last add fails in the two cases I've tried.
If I comment out the remove, I get: Uncaught Node#addNode - node
argument is still attached to another parent!
with remove: Uncaught Node#addNode - node not found:
'org.scenejs.examples.collada.seymourplane.propShape-libX'
It appears that the remove is deleting the node, or at least making
the node not accessible via the ID.
Can anyone shed some light on what I might try, please?
Scott