PDA

View Full Version : Box Rig


benjii19
09-09-2007, 11:13 AM
Hi first off I'm using Maya 8.0, and you may have seen me post some queries about this rig before.

A freind of mine called Admiral Ra has been building a cardboard box rig for me. Which works great so far, although I didn't realise how much flexibilty I would need in the end.

To be able to understand you may have to take a look at the rig which I'll post up here.

BOX RIG (http://www.benhealy.com/BOXRIG.zip)


This is what I'm after, bearing in mind the box is being used in an animation.

http://www.benhealy.com/BOXCLOSE.jpg

And here is a quick doodle on what the box does now, and what I think it needs to be able to do.
http://www.benhealy.com/untitled-1.jpg


Any suggestions or even help would be much appreciated (this rig will also be available to people to have a play with, if anyone fancies it)

Sepheon
09-19-2007, 11:06 AM
hey there,
im not quite sure i understand your dillema but let me take a shot at it. but firstly, next time you are going to upload an image could you resize it first? that picture doesnt even fit inside my 1280x1024 resolution, not to mention takes a considerable amount of time to load.

ok so, first off you want a rig for a box is that right?

Judging by the picture you drew you want the flaps to close one after another?
Ok, there is two ways i know of that you can do that.

your choices are

Blend shapes or Set Driven Keys.

I believe blend shapes would give you the most freedom so it is probably your best bet. I will cover a combination of the two.

First, duplicate your box (move duplicate to side), Fold one of the duplicates flaps down, create blend shape, Duplicate again (with flap down) and lower another flap, create blend shape, duplicate again, lower another flap, create blend shape, lower flap and create last blend shape.

now you have 4 blend shapes (name them 1-4), one for each stage of the box folding. Click on the box or rig, or better yet create a torus and turn its render attribute off. (attribute editor for shape -> render stats -> primary visibility) now that torus will be your remote control for the box folding. close attribute editor and right click on the torus channels. Select "add attribute", name the attribute FoldBox and under the numeric attributes section give it a Minimum of 0, a max of lets say 20 and default of 0.

Now to make it all work!

Select the torus, now click on the new Foldbox attribute u just created.
Under your Animate toolset in maya select animate -> Set driven key. a new window will pop up. with the torus still selected (or whatever you assigned the "foldbox" attribute to) hit Load driver. Now that object is the driver. Select the Foldbox attribute under your Drivers channels (in the box beside the driver). Now select the Original box, the one with all the blend shapes on it. Hit Load Driven. Beside the driven select the first blend shape (Make sure all the blend shapes are at their starting positions!!! (this is very important)
and hit KEY!! YAY!! almost done. Next, move the first blend shape to its end position. Then move the FoldBox attribute to 5. KEY!! WOOHOO!! Next select the next blend shape in the list and with Foldbox at 5 and the second blend shape at 0, KEY!! move Foldbox to 10, move second blend shape to end position and KEY!! select third blend shape, with foldbox at 10, KEY!! move Foldbox to 15 and third blend shape to end position, KEY! (almost done!!) select fourth blend shape, with foldbox at 15, guess what? KEY!! and lastly, move the fourth blend shape to its end position and foldbox to 20. LAST KEY!!

What we did.

We created 4 blend shapes, 1 for each flap of the box.
Then we added an attribute to the box, or any object in the scene(doesnt matter which object, so long as you remember which, thats why we created a torus remote).
We then Set that attribute to control the blend shapes via the set driven key function.
Lastly we set the driver (the Foldbox attribute) to drive the Driven (the 4 blend shapes) at difference places on the Foldbox attribute.

Test it out:
click the foldbox attribute in the channel editor, now middle mouse click and drag anywhere on the screen to slide the attribute.

As the foldbox attribute changes from 0-5 the first blend shape animation will play, closing the first flap. 5-10 the first flap is already closed and it will play the second blend shape animation closing the second flap. 10-15 the second is closed and now the third will close. 15-20 finally the fourth flap will close.

HURRAY!!!

Technically you dont need to rig your box at all, just rotate the flaps and blend shape.
and because your used blend shapes you can open just one or two of the flaps at a time if you wish.
if you have any more problems let me know

CGTalk Moderation
09-19-2007, 11:06 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.