Thursday, February 14, 2013

Real Time Secondary Motion Script

This was the script I used to get secondary motion on the attributes of the Panda Rig. It is quite long, but the resulting real time secondary action in the viewport is fun to look at and gives the animator a good sense of what the animation will look like. 32 total lines of code for the angler on the top of the Panda's head alone.


if (Angler_Attribute_Control.AutoOverlap == 1){
    hairSystemShape2.currentTime += 1;
    float $refresh_rx = Angler_1_Control.rotateX;
    float $refresh_ry = Angler_1_Control.rotateY;
    float $refresh_rz = Angler_1_Control.rotateZ;
    float $refresh_rx = Head_Control.rotateX;
    float $refresh_ry = Head_Control.rotateY;
    float $refresh_rz = Head_Control.rotateZ;
    float $refresh_rx = Neck_Control.rotateX;
    float $refresh_ry = Neck_Control.rotateY;
    float $refresh_rz = Neck_Control.rotateZ;
    float $refresh_rx = Upper_Torso_Control.rotateX;
    float $refresh_ry = Upper_Torso_Control.rotateY;
    float $refresh_rz = Upper_Torso_Control.rotateZ;
    float $refresh_rx = Spine_Rotation_Control.rotateX;
    float $refresh_ry = Spine_Rotation_Control.rotateY;
    float $refresh_rz = Spine_Rotation_Control.rotateZ;
    float $refresh_tx = COM.translateX;
    float $refresh_rx = COM.rotateX;
    float $refresh_ty = COM.translateY;
    float $refresh_ry = COM.rotateY;
    float $refresh_tz = COM.translateZ;
    float $refresh_rz = COM.rotateZ;
    float $refresh_tx = Master_Movement_Control.translateX;
    float $refresh_rx = Master_Rotation_Control.rotateX;
    float $refresh_ty = Master_Movement_Control.translateY;
    float $refresh_ry = Master_Rotation_Control.rotateY;
    float $refresh_tz = Master_Movement_Control.translateZ;
    float $refresh_rz = Master_Rotation_Control.rotateZ;
}else if (Angler_Attribute_Control.AutoOverlap == 0){
    hairSystemShape2.currentTime = time;
}

No comments:

Post a Comment