Page 1 of 1

How can I get the ID of 3d engine elements by the handle?

Posted: Fri Jul 26, 2024 7:42 pm
by eNano
Is there a way to find the purebasic ID number of a 3d element (for example a node) by using the handle of that element? I was thinking that maybe there is something similar to form elements IDs.
For example if you need to get the ID number of a button you can write:

Code: Select all

GetProp_(GadgetID(buttonNumber),"PB_ID")

;or 
GetWindowLongPtr_(GadgetID(buttonNumber), #GWLP_ID)

;or the number of a window:
GetProp_(WindowID(windowNumber), "PB_WINDOWID") - 1
is there something similar for 3d elements?

Re: How can I get the ID of 3d engine elements by the handle?

Posted: Mon Jul 29, 2024 5:29 pm
by eNano
Hi! I know there is no answer yet but I need to add some details to my question, maybe someone can give me a clue.
I didn't found any internal function inside pb to manage dynamic parent / child relationships, many 3d engines (including ogre) have the option to get the children count or get the parent of an object or the root object of a scene with the possibility to add/remove objects in the tree without loosing control of each object, this is important for example in objects selections or local/parent/world/referenced transformations.
if I have indexed objects I loose the control of an specific object when I change the list because the indices are redefined, so I can't access that object again without doing an entire iteration on the list again to find a match, I can't find a way to control the objects directly by handle.
Is there a way to use some kind of dynamic parent/child management in 3d objects or maybe a way to access some additional functions in ogre?

Re: How can I get the ID of 3d engine elements by the handle?

Posted: Tue Jul 30, 2024 5:32 pm
by tft
I have written separate procedures for every 3Dengin command that creates or deletes something. Which logs such lists with links in the background. It's actually quite easy to implement.

TFT