Lab 4
In this lab you will learn the following:
Skeletons (p. 175), OutputJoints script (p. 178), ScaleSkeleton script (p. 184), CopySkeletonMotion script (p. 186).

Working methods:
Study pages 175-193.

Assignment:
(1) Write the buildArm() function that builds a skeleton of an arm with 4 fingers as shown at the picture bellow:



The specification of a buildArm() function is:
proc buildArm(string $name)
Notice that this function receives the name of a root transform node as a parameter. Bellow is the hierarchy build after calling this function and passing "arm1" as a root node name:



(2) Write the buildArms() function that receives no parameters and builds 4 arms (by calling the buildArm() function and passing each time a different name) and places the arms in their positions as shown at the picture bellow:



(3) Write the animation1() function that receives no parameters and animates "arm1" skeleton as shown in the movie bellow:
Download movie "lab4blast1.avi" (approx. 2MB)

Notice that in order to create this animation only joint1 and joint3 of arm1 need to be animated. The duration of the animation is 90 frames.

(4) Write the copySkeletonMotion() function that accepts 2 parameters of type string: the names of source and destination root nodes. You will use this function to copy animation from arm1 to arm2, from arm1 to arm3 and from arm1 to arm4. See an example of such script on page 186. You can use some parts of the script introduced in the book, however you can not just copy paste it since it does not copy the rotation for example, and it creates an extra node called _moveSkeleton which will not fit into your situation. Your skeletons are already grouped to their corresponding root transform nodes "arm1", "arm2" etc.

(5) Test your functions by executing the following calls:
buildArms();
animation1();
copySkeletonMotion("arm1", "arm2");
copySkeletonMotion("arm1", "arm3");
copySkeletonMotion("arm1", "arm4");
You should see all arm skeletons animated as in the movie bellow:
Download movie "lab4blast2.avi" (approx. 2MB)