Page 1 of 1

Node Management Confusion

Posted: Tue Feb 19, 2013 2:01 am
by IdeasVacuum
I have two Nodes, each 'containing' one or more Entities, all the Entities are instances of Meshes.

So far, so good. However, what I want to do is to have a parent Node and attach the other Nodes to it. The parent Node's Objects therefore consisting only of Nodes - the perpose being that all move/rotate commands are to be applied to the parent.

However, AttachNodeObject(#NodeALL, #NodeModel01) fails with:
[ERROR] Invalid memory access. (read error at address 10)

I can attach all of the entities to one Node, so does this mean it is not permissable to have a parent Node with only Nodes attached?

Re: Node Management Confusion

Posted: Tue Feb 19, 2013 6:20 am
by Comtois
Snipet ?

Re: Node Management Confusion

Posted: Tue Feb 19, 2013 9:37 am
by Fred
AttachNodeObject() needs an ID, so you probably want to to write this:

AttachNodeObject(#NodeALL, NodeID(#NodeModel01))

Re: Node Management Confusion

Posted: Tue Feb 19, 2013 11:54 am
by IdeasVacuum
AttachNodeObject(#NodeALL, NodeID(#NodeModel01))
Now that's something interesting to test, I have not needed to use any ID() up till now, thank you Fred :)

However, my overall idea has a flaw, there is no "Hide Node" command. So, I'm attaching everything to one Node and using HideEntity, which I didn't expect to be fast enough but using a ForEach loop it is almost instant even with a largish entity count. Still, HideNode() would be more logical so I will raise an enhancement request.

Re: Node Management Confusion

Posted: Tue Feb 19, 2013 12:30 pm
by IdeasVacuum
Yep, missing NodeID() is the cause! When adding Entities to a Node, I have been using EntityID(). So, definite issue with the brand of coffee I'm using..... :oops: