MakeShadowChain

Introduced

4.0

Description

Traces a new shadow hierarchy (a chain or null hierarchy) on top of an existing chain. The shadow objects will be pose-constrained to the original objects.

Scripting Syntax

MakeShadowChain( Chain, ShadowParent, [SI3DStyleChain], [IconScale], [ShadowType], [ShadowCharacterSetName] )

Parameters

Parameter

Type

Description

Chain

String

A collection of chain objects to trace. Must be in the same order as order defined by the GetSkeleton command.

ShadowParent

String

The object to which the new shadow hierarchy will be parented.

SI3DStyleChain

Boolean

True to draw a SI|3D chain; False to draw a standard Softimage one.

Default Value: False

IconScale

Double

Icon scale of the skeleton.

Default Value: 1.0

ShadowType

Integer

The type of shadow tracing to be drawn. for convenience the numbers align with the UI options for the shadow type on the default rig generators. Box Shadows are not traced here, but are done as components because they need to make assumptions about the volume of each component.

Default Value: 0

Possible Values:

0: Skeleton shadow rig

1: Null shadow rig

ShadowCharacterSetName

String

The name of the shadow character set that should be used for this chain; it gets stored in a Custom PSet for use.

Default Value: ""

Return Value

Returns a Shadow JScript object.

Examples

JScript Example

/*
   This script creates an arm, then creates two shadow 
   chains over top of it. The first uses nulls the other
   uses a chain.
*/

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

guidecoll.Add( GetPrim("Null", "ShoulderGuide") ); 
guidecoll.Add( GetPrim("Null", "ElbowGuide") ); 
guidecoll.Add( GetPrim("Null", "HandGuide") ); 

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

var lPos = XSIMath.CreateVector3();

/*
   Right Arm
*/

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

lXfm.SetTranslationFromValues(4,0,-2);
guidecoll(1).Kinematics.Global.Transform = lXfm;

lXfm.SetTranslationFromValues(8,0,0);
guidecoll(2).Kinematics.Global.Transform = lXfm;

var RArm = MakeArm(ActiveSceneRoot, guidecoll, "R",null, 0,0,0,null ,null, 0);

/*
   Add a chain shadow
*/

//NULL shadow
var shadow = MakeShadowChain( GetSkeleton(RArm.Root), ActiveSceneRoot,0,1.0,1);
//BONE shadow
shadow = MakeShadowChain( GetSkeleton(RArm.Root), ActiveSceneRoot,0,2.0,0);

DumpShadow( shadow );

function DumpShadow( inShadow )
{
logmessage ("Data in the returned shadow object:");
logmessage ("-----------------------------------");
   logmessage ("ShadowParent : " + inShadow.Root);
logmessage ("SI3DStyle    : " + inShadow.Eff);
logmessage ("#ShadowObject: " + inShadow.Shadows.count);
   for(var b=0;b<inShadow.Shadows.count;b++)
   {logmessage (" ShadowObj" +  b + "  : " + inShadow.Shadows(b));}
   logmessage ("#ShadowEnds  : " + inShadow.ShadowEnds.count);
   for(var b=0;b<inShadow.ShadowEnds.count;b++)
   {logmessage (" ShadowEnd" + b + "  : " + inShadow.ShadowEnds(b));}
   logmessage ("Scale        : " + inShadow.Scale);
logmessage ("Hidden       : " + inShadow.Hidden);
logmessage ("Envelope     : " + inShadow.Envelope);
logmessage ("ShadowModel  : " + inShadow.ShadowModel);
}

//results from running this script:
//INFO : "Data in the returned shadow object:"
//INFO : "-----------------------------------"
//INFO : "ShadowParent : RRoot1"
//INFO : "SI3DStyle    : undefined"
//INFO : "#ShadowObject: 4"
//INFO : " ShadowObj0  : RRoot1"
//INFO : " ShadowObj1  : RBicep1"
//INFO : " ShadowObj2  : RForearm1"
//INFO : " ShadowObj3  : eff"
//INFO : "#ShadowEnds  : 1"
//INFO : " ShadowEnd0  : RRoot1"
//INFO : "Scale        : 1"
//INFO : "Hidden       : RRoot1"
//INFO : "Envelope     : RBicep1,RForearm1"
//INFO : "ShadowModel  : Scene_Root"

See Also

MakeShadowSpine



Autodesk Softimage v7.5