MakeDogLeg

Introduced

v4.0

Description

Creates a three-bone leg with an and up-vector control object, and a rigged three bone foot (see MakeFoot). The leg and foot bones are created from a collection of 9 or more guide objects (see the GuideObjectCollection parameter below for guide requirements).

MakeDogLeg can optionally add roll divisions to the thigh. Roll divisions are used to distribute the roll difference between adjacent bones over the length of a bone. When used as deformers on an envelope they evenly distribute twist along the length of a bone giving a more natural skin deformation. Roll divisions can also be added separately using the MakeBicepRoll command.

Optionally a shadow rig can be attached to the leg. Shadow objects are created for each chain element in the leg, and shadow bones are pose constrained to the actual leg bones. Shadow rigs can be used to plot animation off of a rig.

Scripting Syntax

oDogLeg = MakeDogLeg( Model, Parent, FootParent, GuideObjectCollection, [ShortPrefix], [FullPrefix], Sliders, [NbThighDivisions], [ShadowType], [ShadowParent] );

Return Value

Returns a DogLeg JScript object.

Parameters

Parameter Type Description
Model String The model that the dog leg will belong to.
Parent String The parent of the dog leg root.
FootParent String The parent of the dog leg's foot controls
GuideObjectCollection String A list of at least 9 objects to search for when making the leg: Femur; Tibia; Metarsal; Middle Pivot; Right Pivot; Left Pivot; and at least 3 objects running from the start of the foot to the end of the toe (this means the foot must be at least a two bone chain). Extra items are added onto the length of the foot.
ShortPrefix String The short name (typically "L" or "R") to be used in the new rig. If the prefix is not given a dialog box appears prompting for one.
FullPrefix String The long name (typically "Left" or "Right") to be used in the new rig. If the prefix is not given a dialog box appears prompting for one.
Sliders String A slider PPG for dog leg parameters. If none is supplied a slider page is created.
NbThighDivisions Integer The number of roll divisions on the upper leg. If the value is zero no roll is created.

Default Value: 3

ShadowType Integer The type of shadow rig to attach to the dog leg. Shadow rigs can be used to transfer or remap animation.

Default Value: 0

Possible Values:

Description:

0 No shadow
1 SI|3D Skeleton shadow rig
2 XSI Skeleton shadow rig
3 Null shadow rig
4 Box shadow rig
ShadowParent String Parent of the shadow rig hiearchy. If empty, no shadow rig is generated.

Examples

JScript Example

/*

	This script creates a dog leg using a collection

	of nulls as the guide objects. 

*/

var guidecoll = new ActiveXObject("XSI.Collection");

guidecoll.Add( GetPrim("Null", "Guide_Femur") ); 

guidecoll.Add( GetPrim("Null", "Guide_Tibia") ); 

guidecoll.Add( GetPrim("Null", "Guide_Metarsal") ); 

guidecoll.Add( GetPrim("Null", "Guide_MiddlePivot") ); 

guidecoll.Add( GetPrim("Null", "Guide_RightPivot") ); 

guidecoll.Add( GetPrim("Null", "Guide_LeftPivot") ); 

guidecoll.Add( GetPrim("Null", "Guide_Ankle") ); 

guidecoll.Add( GetPrim("Null", "Guide_Foot") ); 

guidecoll.Add( GetPrim("Null", "Guide_Toe") ); 

var lXfm = guidecoll(0).Kinematics.Global.Transform

var lNull = GetPrim("Null", "Legs");

/*

	Left Leg

*/

//Leg

lXfm.SetTranslationFromValues(1,11,-0.5);

guidecoll(0).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(1.5,7.5,0.5);

guidecoll(1).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(2,4,-1);

guidecoll(2).Kinematics.Global.Transform = lXfm;

//Pivots

lXfm.SetTranslationFromValues(2,0,-0.5);

guidecoll(3).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(2.5,0,-0.5);

guidecoll(4).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(1.5,0,-0.5);

guidecoll(5).Kinematics.Global.Transform = lXfm;

//Foot

lXfm.SetTranslationFromValues(2,1,0.25);

guidecoll(6).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(2,0.5,1);

guidecoll(7).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(2,0,2);

guidecoll(8).Kinematics.Global.Transform = lXfm;

var LLeg= MakeDogLeg(lNull,

			GetPrim("Null", "LLegParent"),

			GetPrim("Null", "LFootParent"),

			guidecoll, "L", "Left" );

DumpLeg(LLeg);

function DumpLeg(inLeg)

{

	logmessage ("Data in the returned leg:");

	logmessage ("------------------------");

	logmessage ("Root        : " + inLeg.Root);

	logmessage ("Foot Root   : " + inLeg.Foot.Root);

	logmessage ("UpVector    : " + inLeg.Knee);

	logmessage ("Tarsus      : " + inLeg.Tarsus);

	logmessage ("BaseGuide   : " + inLeg.Foot.BaseGuide);

	logmessage ("UpVector    : " + inLeg.UpVec);

	logmessage ("Skeleton    : " + inLeg.Skel);

	logmessage ("Hidden      : " + inLeg.Hidden);

	logmessage ("Envelope    : " + inLeg.Envelope);

	logmessage ("ShadowsStart: " + inLeg.ShadowStart);

	logmessage ("ShadowsEnds : " + inLeg.ShadowEnds);

	logmessage ("Shadows     : " + inLeg.Shadows);

}

//results from running this script:

//INFO : Data in the returned leg:

//INFO : ------------------------

//INFO : Root        : LLegRoot

//INFO : Foot Root   : LFootRoot

//INFO : UpVector    : LkneeGuide

//INFO : Tarsus      : LtarsusGuide

//INFO : BaseGuide   : LFootGuide3

//INFO : UpVector    : LUpVector

//INFO : Skeleton    : LLegRoot,LFemur,LTibia,LMetarsal,LLegEff

//INFO : Hidden      : LLegRoot,LLegEff,LUpVectorParent,LkneeGuide,LtarsusGuide,lastboneUpV,baseNull

//INFO : Envelope    : LTibia,LMetarsal,LBicepRoll1,LBicepRoll2,LBicepRoll3,LBicepRoll_4

//INFO : ShadowsStart: undefined

//INFO : ShadowsEnds : undefined

//INFO : Shadows     : undefined

See Also

MakeLeg MakeArm MakeThighSlide MakeFoot