Node Management Confusion

Everything related to 3D programming
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Node Management Confusion

Post 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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Re: Node Management Confusion

Post by Comtois »

Snipet ?
Please correct my english
http://purebasic.developpez.com/
Fred
Administrator
Administrator
Posts: 18384
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Node Management Confusion

Post by Fred »

AttachNodeObject() needs an ID, so you probably want to to write this:

AttachNodeObject(#NodeALL, NodeID(#NodeModel01))
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Node Management Confusion

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Node Management Confusion

Post 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:
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply