MakeBicepRoll
 
 
 

MakeBicepRoll

Introduced

v4.0

Description

Creates roll nulls along 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.

The start and end rotations are determined differently for a bicep division than a forearm division (MakeForearmRoll). In a bicep roll division, the bicep's local rotation without spin is the start rotation, while its rotation with spin is used for the end rotation. Roll divisions are then interpolated between start and end. In the case of forearm roll, the forearm's rotation minus spin (calculated using the bicep's rotation) is used as the starting rotation, while the end rotation is the next bone's rotation (wrist) including spin.

Scripting Syntax

oBicepRoll = MakeBicepRoll( Bicep, [Prefix], [NbDivisions] );

Return Value

Returns a BicepRoll JScript object.

Parameters

Parameter Type Description
Bicep String The chain element used for the start and end rotations of the roll division.
Prefix String Prefix added to the name of the roll divisions.
NbDivisions Integer The number of roll divisions. If the value is zero no roll is created.

Default Value: 3

Examples

JScript Example

/*
        This script creates 3 roll divisions on a bone
*/
var lPosStart = XSIMath.CreateVector3();
var lPosEnd = XSIMath.CreateVector3();
lPosStart.Set(0,0,0);
lPosEnd.Set(-5,0,0);
var Chain = ActiveSceneRoot.Add2DChain(lPosStart, lPosEnd);
var BicepRoll = MakeBicepRoll(Chain.Bones(0), "L");
DumpBicepRoll (BicepRoll );
function DumpBicepRoll (inBicepRoll)
{
        logmessage ("Data in the returned bicep roll object:");
        logmessage ("---------------------------------------");
        logmessage ("#Divisions: " + inBicepRoll.Nb);
        if(inBicepRoll.Nb > 0)
        {
                for(var b=0;b<inBicepRoll.Divisions.count;b++)
                {logmessage ("  RollDiv" + b + ": " + inBicepRoll.Divisions(b));}
        }
}
//results from running this script
//INFO : "Data in the returned bicep roll object:"
//INFO : "---------------------------------------"
//INFO : "#Divisions: 3"
//INFO : "  RollDiv0: LBicepRoll1"
//INFO : "  RollDiv1: LBicepRoll2"
//INFO : "  RollDiv2: LBicepRoll3"
//INFO : "  RollDiv3: LBicepRoll_4"

See Also

MakeForearmRoll MakeArm