• Home
    • Projects >
      • Finn's Golden Sword - Adventure Time
      • Game Development
      • Animation
      • Graphic Design
      • Photography
      • Archviz
      • HCI Systems
      • 3D Printing
    • Creative Blog >
      • AME 394
  • Contact
  • 3D Gallery
  CMA3D

Motion Capture Animation | Unity/Autodesk/JS | 10/10/13

10/11/2013

0 Comments

 
For Assignment 2 I was trying to implement more of what I've been learning to do in other packages, languages, and processes and 'trying' to combine it with what we've been learning in class. The first video doesn't actually have any coding on my part done, but I did model, rig, characterize, and set up the model to a skeleton so it would take in .c3d (motion capture data) through MotionBuilder as seen. (I previously had to rig it in 3Ds Max)

I took the baked .FBX file into a scene I set up in Unity where the scripting began. Animating an object (.FBX in general) you have a better time using a legacy format just a tip to those who'd like to know.  I then split up the 2700+ frames into 3 segmented animations and set those up for loops. 

In MonoDevelop (Unity's Built in API) I can program in C#, Java, VB, Boo, and just for shaders.

Based off something I've used before, another class, and discussed in class I can toggle between animations.

var aniClip0: AnimationClip;
var aniClip1: AnimationClip;
var aniClip2: AnimationClip;
private var parent: GameObject;
private var aniClip: AnimationClip;
private var objStateMode: int = 0;

function OnMouseDown(){
if (objStateMode == 0){
aniClip = aniClip0;
objStateMode ++;
}
else if(objStateMode == 1){
aniClip = aniClip1;
objStateMode ++;
}
else {
aniClip = aniClip2;
objStateMode = 0;
}
if(animation)animation.Play(aniClip.name);
else parent.animation.Play(aniClip.name);

}



I was trying to implement an update function as seen below, but it seems to be only making the rigged 'robots' jitter and not play backwards like I was intending.


function Update () {
if (Input.GetKeyDown ("r"))
print ("R key was pressed");
if(animation)animation.IsPlaying(aniClip.name);
else parent.animation.Rewind(aniClip.name);
//animation.Rewind();

}
So basically the code has the three variables for each clip and lets them inherit AnimationClip. So everytime we click the mouse it will parse the objStateMode variable integer (it initially is stated to be 0). With consecutive clicks it will add 1. Once it gets to the third state it will go back to 0 and the whole process loops over. The parent will inherit the Game Object data which you set in Unity. Same with the aniClip and AnimationClip. These are both steps required for scripts to be functional in a game development engine like Unity. 
0 Comments

    Michael A.

    Digital Culture @ ASU + Game Development Certificate 14'

    Archives

    December 2013
    November 2013
    October 2013
    September 2013

    Categories

    All

    RSS Feed

Copyright (c) 2010 Christopher Michael Andrew