Jump to content
Hash, Inc. Forums
Sign in to follow this  
modernhorse

Squash & Stretch via null

Recommended Posts

Hi folks -

I'm trying to rig a character to behave like the rig that was used in the Animation Bootcamp exercise 1. It has one null that control the squash and stretch of the ball. I have successfully managed to get the character to squash in the the 'Y' direction via a pose slider. Now I want to -

 

1) Have this pose control the 'X' and 'Z' as well to have the character expand when he is crushed.

2) Control all of this via a null.

 

I've picked the Ball rig apart and only can see that the pose has a transform constraint for Y. And I see no way for the Pose to be constrained to the null that I've created.

 

Any suggestions?

 

Doug

Share this post


Link to post
Share on other sites

Doug,

 

Getting the X and Z scales to work with the pose slider is easily achieved with expressions. The ball rig has these but you've got to know where to look for them.

 

Controlling the pose slider with a null is achieved with a relationship.

 

I'm a bit busy at the moment, but I can get back to you later with more detail if you like. Perhaps I could run through how these are setup in something simple like the ball rig, and you can take that away and apply it to your character.

 

Gerard

Share this post


Link to post
Share on other sites
The ball rig has these but you've got to know where to look for them.

 

Yeah, i've looked and looked.

 

Thanks Gerard. That would be great if you can get back to me. I'd truly appreciate it. In the meantime I'll keep at it.

 

Doug

Share this post


Link to post
Share on other sites

Here's the Link to the tutorial that taught me how to make that ball. I don't understand it at all, I just followed along. I then made a null control from BillY's advice on making a face rig (I posted his advice in a face rig thread)

 

The link wasn't coming up for me, so I copy pasted the words from the code out here. Good luck.

 

-Alonso

 

 

 

 

Let's start with the same example we can find at the Hash website, but we'll make it simpler. Squash and stretch is a powerful effect used in many styles of character animation. If we have an elastic ball on the floor and we push down on it, we try to decrease its Y scale value. We see that the ball tries to "expand horizontally" increasing its X and Z scale. It tries to "maintain volume". So, we need to create expressions which will increase the X and Z scale parameters of a model when Y scale decreases and decrease X and Z scale when Y scale increases. In other words, X and Z scale must be "inversely proportional" to Y scale. X=1/Y and Z=1/Y will do the trick. Download the ball.prj file (11kb), or create a choreography with one model on a floor. In the Project Workspace click on Choreography/Shortcut to Ball/Transform/Scale to see the X, Y and Z parameters. Right-click on X scale, select Edit Expression from the popup menu and type "1/" in the expression text field (do not type the "", do not press Enter). Then, while the text cursor is blinking inside the expression text field, move the mouse pointer and click on the Y scale parameter. This will create the text we need to refer to the Y scale parameter inside the expression. Now press Enter. Do exactly the same for the Z scale parameter. Now that the expressions are complete, click on the Y scale parameter, keep the left mouse button pressed and drag the mouse to change the Y scale parameter ("virtual slider"). We see that the ball "squashes" and "stretches" automatically. All we have to do is animate the Y scale (create keyframes) and let the expressions take care of the X and Z scale parameters. If, for whatever reason, you could not create the expressions, just download the autosquash.prj file (12kb) and have a look.

Share this post


Link to post
Share on other sites

Okay, I'm making some headway on this thing. I've got X and Z to maintain volume as Y decreases and increases. Very cool.

 

Now another question. We add these expressions in a choreography. Is there a way to add these expression at the model level, so each time you add this model to a new chor these transformations are ready to go from the start?

 

This is powerful stuff and so glad I'm getting my head around them, sort of. :)

 

Doug

Share this post


Link to post
Share on other sites

Doug,

 

The expressions don't have to be added in the Choreography, the easiest thing would be to add the expressions when you are creating the pose slider. If you already have a pose slider created that adjusts the Y scale of your character (like you said in the original post) just right-click the slider, select Edit Relationship and away you go adding the extra expressions. Now the squash and stretch effect will transfer with your model (via the pose slider control) rather than creating it each time from scratch.

 

Gerard

Share this post


Link to post
Share on other sites

Doug,

 

You seem to be getting a handle on using the expressions to drive the X and Z scale. Once this is all done I guess you still want to know how to get the Null to control the pose slider, well here's a simple way:

 

This can be done from the bones mode window if you wish. Select the null, it will become highlighted in the PWS (and Properties panel if you have that open). Search down through the properties of the null to the Transform section. Under Transform you will see Translate, Scale and Rotate. Open the Translate section and right-click on the Y option. Now select New Relationship from the drop-down box.

 

A new relationship window will open (it looks just like an Action window). Open the pose slider window if it is not already open ... Alt 4 will do it. The pose should be in the 0% position. Select the null and move it up in the Y direction (I'm assuming that the null's roll handle i.e. it's Y axis, is pointing up the screen) to a suitable height, and then move the pose slider across to 100%. You've now created a relationship between the Y value of the null and the percentage of the pose slider.

 

That's it. Close the relationship window and you're done! Test your setup by opening an action and moving the null up and down ... the pose slider will adjust accordingly.

 

Let me know if you have any problems.

 

Gerard

Share this post


Link to post
Share on other sites

Thanks very much Gerard. I will spend some time with your post and report back.

 

Doug

Share this post


Link to post
Share on other sites

Gerard - Your instructions worked a treat ! I'm still refining the rig but I now have what I need to make this character behave as I wish. Thank you very much.

 

Doug

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...