PDA

View Full Version : BoundingBox() question


Lotar
03-25-2008, 11:52 AM
Hi,

I noticed that when some object has one or more children, this function always returns bounding box that contains parent and all its children.
So, my questions is, what should I do if I want to get only parent's bounding box and (this is important) I want to get if _after_ I attach some child to it ?

Thank you.

farshizzo
03-25-2008, 04:55 PM
You can use the optional node parameter of the getBoundingBox function to specify the specific subgraph that you want to compute the bounding box of. This will work as long as the child nodes don't have a subgraph with the same name. Another workaround would be to temporarily detach the children from the parent while computing the bounding box, then reattaching them using the node.unparent/parent commands.