MakeShadowSpine

Introduced

4.0

Description

Traces a shadow hierarchy (a chain or null hierarchy) on top of an existing spine. Shadow objects are created and pose-constrained for each vertebra in the spine.

Scripting Syntax

    MakeShadowSpine( Spline, Base, Vertebra, TopVertebra, ShadowParent, [ChestTop], [IconScale], [ShadowType], [ShadowCharacterSetName] )

Parameters

Parameter | Type | Description
Spline | String | The Spline object of the spine to be traced.
Base | String | The base object (hip) of the spine to be traced.
Vertebra | String | A collection of the vertebrae on the spine to be traced.
TopVertebra | String | The top vertebra object (chest) on the spine to be traced.
ShadowParent | String | The parent of the new Shadow hierarchy.
ChestTop | String | (optional) The chest top object of the spine to be traced. If empty it is assumed the spine was generated without this option.
IconScale | Double | The scale value of the spine. Used to control the icon scale of the shadow 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: 1 Possible Values: • 0: No shadow • 1: SI|3D Skeleton shadow rig • 2: XSI Skeleton shadow rig • 3: Null shadow rig
ShadowCharacterSetName | String | The name of the character set that should be used for this chain. Default Value: ""

Return Value

Returns a Shadow JScript object.

Examples

JScript Example

    /*
       Make a spine with 3 vertebrae, then attach
       a skeleton shadow to it
    */

    var Base  = GetPrim("Null", "Base");
    var Top   = GetPrim("Null", "Top");
    var Depth  = GetPrim("Null", "Depth");
    var TopDepth= GetPrim("Null", "TopDepth");

    /*
       Make Spine
    */

    var lXfm = XSIMath.CreateTransform();

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

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

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

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

    var Spine = MakeSpine( ActiveSceneRoot,  //model
                  ActiveSceneRoot,  //parent
                  3,         //number of vertebrae
                  0,         //quat spine with polygon vertebrae
                  false,     //non-stretchy
                  Base, Top,
                  Depth,TopDepth);

    /*
       Make Shadow
    */

    var ShadowSpine = MakeShadowSpine(Spine.Curve, Spine.base, Spine.Vertebra, Spine.TopVertebra, ActiveSceneRoot,Spine.chestTop);

    DumpShadowSpine(ShadowSpine);

    function DumpShadowSpine(inShadowSpine)
    {
       logmessage ("Data in the returned spine object:");
       logmessage ("---------------------------------");
       logmessage ("Spline      : " + inShadowSpine.Spline);
       logmessage ("TopVertebra : " + inShadowSpine.TopVertebra );
       logmessage ("Scale       : " + inShadowSpine.Scale);
       logmessage ("Parent      : " + inShadowSpine.Parent);
       logmessage ("#ShadowObj  : " + inShadowSpine.Shadows.count);
       for(var b=0;b<inShadowSpine.Shadows.count;b++)
           {logmessage ("  Shadow" + b + ": " + inShadowSpine.Shadows(b));}

       logmessage ("#EnvelopeObj: " + inShadowSpine. Envelope.count);
       for(var b=0;b<inShadowSpine.Envelope.count;b++)
           {logmessage ("  EnvelopeObj" + b + ": " + inShadowSpine.Envelope(b));}

       logmessage ("#Vertebrae  : " + inShadowSpine.Vertebra.count);
       for(var b=0;b<inShadowSpine.Vertebra.count;b++)
           {logmessage ("  Vertebra" + b + ": " + inShadowSpine.Vertebra(b));}

       logmessage ("#UpVectors  : " + inShadowSpine.UpVectors.count);
       for(var b=0;b<inShadowSpine.UpVectors.count;b++)
           {logmessage ("  UpVector" + b + ": " + inShadowSpine.UpVectors(b));}

    }

    //results from running this script:
    //INFO : "Data in the returned spine object:"
    //INFO : "---------------------------------"
    //INFO : "Spline      : crvlist"
    //INFO : "TopVertebra : TopVertebra"
    //INFO : "Scale       : 1"
    //INFO : "Parent      : Scene_Root"
    //INFO : "#ShadowObj  : 6"
    //INFO : "  Shadow0: SpineRoot"
    //INFO : "  Shadow1: Spine1"
    //INFO : "  Shadow2: Spine2"
    //INFO : "  Shadow3: Spine3"
    //INFO : "  Shadow4: Chest"
    //INFO : "  Shadow5: ChestEffector"
    //INFO : "#EnvelopeObj: 0"
    //INFO : "#Vertebrae  : 3"
    //INFO : "  Vertebra0: Vertebra"
    //INFO : "  Vertebra1: Vertebra1"
    //INFO : "  Vertebra2: Vertebra2"
    //INFO : "#UpVectors  : 4"
    //INFO : "  UpVector0: Shadow_upVa"
    //INFO : "  UpVector1: Shadow_upVa1"
    //INFO : "  UpVector2: Shadow_upVa2"
    //INFO : "  UpVector3: Shadow_upVa3"

See Also

MakeShadowChain

Autodesk Softimage v7.5