|
Puppetshop Stretchy Leg tutorial Finished result: Final Script Expression: v = distance foot.transform.pos hip.transform.pos s = v - 34.0412 s = s/2.0 s Steps:
- Rig your Puppet and make sure the Stretchy options are enabled on the legs. - Enable TD Mode (button can be found in Customize menu in 3dsMax under: Puppetshop). - With the footCtrl selected, open the Curve Editor. - Browse all the way to 'Modifier', then find 'PuppetCA' and in there, open the 'Stretch_' attribute. - Then add a Float Script controller to the 'Pose' controller (under Stretch_)
- In the script controller, add 'Foot' and 'Hip' variables and point them to the Foot_Ctrl and Root nodes of your puppetshop rig.
- We need to know the base length of the leg, so we measure the distance between the foot ctrl and the root/hips.- We can do this in the maxscript listener with the 'distance' command: distance $'Puppet01_RightHip-FootCtrl'.transform.pos $'Puppet01_Root'.transform.pos This will return the base length of your leg without stretch, in our example: 34.0412
Fill the base lenght in the final expression and you are done. See the top of this page for the final expression. In the expression we measure the current distance between the footCtrl and the hips/root. We subtract the default length of the leg. Then we divide by 2, because we have 2 leg bones. A couple of notes: This example setup is kept as simple as posible, but you may want to optimize once you become more comfortable with it. For example, having an script controller on the footCtrl's 'stretch' attribute that reference the footCtrl.transform.pos is not the best for rig performance. However, those optimisations are out of the scope of this tutorial. |