Get the selected object's parent
24 June 2015 18:57
Hi, I'm trying to get a selected object's parent, but it always returns NULL. What am I doing wrong?
I'm using get_object_dg_parent.
I'm successfully using get_object_children to get the children, but the opposite won't work!
I'm using get_object_dg_parent.
I'm successfully using get_object_children to get the children, but the opposite won't work!
Website: http://www.danielfrgordillo.com | YouTube: https://www.youtube.com/user/dranath999
24 June 2015 19:57
Hello and welcome to our forum!
Unfortunately, get_object_dg_parent() is not the opposite of get_object_children(). It's completely different thing, because it returns dupli group parent for given object e.g some EMPTY used to duplicate linked group.
There is no get_object_parent() because it's not very efficient to do search for parent among all objects located on the scene.
If you still need it you can implement it yourself by iterating over all possible objects (returned by get_all_objects(), specify type here to limit search set) and compare their children with your original object.
Unfortunately, get_object_dg_parent() is not the opposite of get_object_children(). It's completely different thing, because it returns dupli group parent for given object e.g some EMPTY used to duplicate linked group.
There is no get_object_parent() because it's not very efficient to do search for parent among all objects located on the scene.
If you still need it you can implement it yourself by iterating over all possible objects (returned by get_all_objects(), specify type here to limit search set) and compare their children with your original object.
Blend4Web Team
https://twitter.com/AlexKowel
https://twitter.com/AlexKowel
24 June 2015 20:22
oh ok. Thanks!
Website: http://www.danielfrgordillo.com | YouTube: https://www.youtube.com/user/dranath999
29 January 2016 15:30
29 January 2016 18:51