How to get group node's object space bounding box

495 views
Skip to first unread message

BWV 656

unread,
Feb 22, 2016, 9:48:05 PM2/22/16
to Python Programming for Autodesk Maya
For a regular geo I get the local bounding box by getting a bounding box info from its shape node.

pyobj = selected()[0] #py.nt.Transform
shpbb = pyobj .boundingBox()#datatypes.
BoundingBox  

Now, let's say I have 3 different objects under a group node. How can I get this group node's object space bounding box?

Any help would be very much appreciated. Thank you so much!

Ian Jones

unread,
Feb 22, 2016, 9:57:35 PM2/22/16
to Python Programming for Autodesk Maya

try this:

http://download.autodesk.com/us/maya/2009help/CommandsPython/exactWorldBoundingBox.html


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/db0012c9-13c6-47bb-9984-b2f39572199d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

BWV 656

unread,
Feb 22, 2016, 10:34:35 PM2/22/16
to Python Programming for Autodesk Maya
Thank you Ian.

I've tried the exactWorldBoundingBox command and yes it works with an object under root. But when I parent it to something else and transform it would no longer match. For example, I have a cube parented to a group node which is translated and rotated and uniformly scaled. and I run this command and locators will not match the bounding box of the cube.

And this is why I got the BB from the shape node and multiply by worldMatrix. This method always worked. And as I mentioned in my first post. I am trying to do this on a group node which has no shape node. So I am lost here :)

Would you please tell me what I am doing wrong here? Thanks again.

pyObj = selected()[0]
wbb= exactWorldBoundingBox(pyObj)
wbb_max = datatypes.Point(wbb[0:3])
wbb_min = datatypes.Point(wbb[3:6])
olocx = spaceLocator (p=wbb_max)
olocn = spaceLocator (p=wbb_min)

BWV 656

unread,
Feb 23, 2016, 8:27:14 AM2/23/16
to Python Programming for Autodesk Maya
Just in case anybody wondering how to do this. ThE_JacO from cgtalk answered my question. If you are interested take a look.

Marcus Ottosson

unread,
Feb 23, 2016, 9:05:13 AM2/23/16
to python_in...@googlegroups.com
If you get a script going, I'd be interesting in having a look!

On 23 February 2016 at 13:27, BWV 656 <bwv...@gmail.com> wrote:
Just in case anybody wondering how to do this. ThE_JacO from cgtalk answered my question. If you are interested take a look.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

BWV 656

unread,
Feb 23, 2016, 9:56:35 AM2/23/16
to Python Programming for Autodesk Maya
sure once I have a working version I'll post it here.
Reply all
Reply to author
Forward
0 new messages