Proxy geometry / bounding boxes / corner postions of bounding boxes

Plan outline.

Create a piece of geometry to represent every skinned joint on the mesh. The geometry will serve as a proxy layer when animation gets too high. Very easy - writing a loop to place a cube/sphere pr joint.

In some cases it will be nice to draw a cv -d 1 on the bounding box to create a cube control.

Is it possible to the the positions of corners on a bounding box with either API or pure mayaPython?

Many thanks

Kasper

Hi,

Maybe this idea may helpful,

so can ignore the order of the 8 points of bounding box maybe draw a polygon cube then convert the geos edges to curves.

for the cube just need width (assuming x), height (y), depth (z)

bounding box reference: http://download.autodesk.com/us/maya/2011help/Commands/xform.html#flagboundingBox
can see what get back for bounding box.
center bounding box reference: http://download.autodesk.com/us/maya/2011help/Commands/objectCenter.html

then maybe using something like
width = [3] - [0]
height = [4] - [1]
depth = [5] - [2], where the [li] is [ the index of what get back from xform -q -ws -bb ]
[/li]
this bit will select all edges of cube (MEL)


select -r `polyListComponentConversion -toEdge pCube1`

this should make curves for all edges selected

DuplicateCurve;

then can put all these curves into one transform (example use first curve, then parent all the other shapes to this transform)
Check out Ed Whetstone’s online tip “creating compound curve icons in maya”

Hope this is helpful,
cheers,
Nate

Nate is correct: if you draw a curve down the joint you’ll get a world space bbox, which is better than nothing but won’t look much like the bone geo

What I usually get the bone length, draw a cube at origin with the same ‘height’ as as the bone (which axis is ‘height’ depends on your skeletal setup). for the other two dimensions I uses a minimal preset value or maybe the joint size from the skeleton.

Then offset all the vertices by half the ‘height’ along the bone axis. That puts the ‘bottom’ of the cube at origin.

Now just parent -add -r -s the shape of your cube to the bone and it automatically picks up the correct orientation and position. Finally, delete the transform of the cube. Repeat for all bones. You’ll probably need to set a fixed height for the stubs