Skip to content

Latest commit

 

History

History
 
 

Readme.md

Blender Procedural Animation

I. Rig

Using ArmatureUnity.py will create a rig with IK constraint ready for Unity Mecanim. Script could be optimized, but works okay for now

II. Animation

Efforts have been put into a script that can generate automatic animations. Here's how it works:

  • The script creates a class based on the armature generated by ArmatureUnity.py
  • If you need to create more animations, you'll have to set an initial pose, which is the T-pose (because this program computes the difference between current pose and initial pose). In this case, run the script once with the argument load = False. Make sure you specify the path in the initialization of the instance.
  • Methods are being designed to create keyframes of animation, theoretically usable over many different sized rigs because description of the movement is based on arms and legs length

To record more animation:

Create your animation as usual, using keyframes. Then, for each step, use the print_pose method to get a log on the console with what you should copy in a new method. This implies running the script multiple times with the initial pose recorded. I'll try to post a tutorial soon but basically:

  1. Run the script for the first time with load = False. Create the initial pose data (this saves a pickle file in the path chosen)
  2. For an smoother workflow, create your full animation in a temporary action data
  3. For each frame where a keyframe is inserted do the following:
    1. Move the cursor to the frame. Run the script with load = True (make sure the only method called is print_pose)
    2. In the terminal, you'll see a print which you just need to copy and paste in your animation method
    3. After pasting, call the confirmation method, and specify number of frames to move on forward
    4. Move on to the next keyframe

You can use existing animations methods for example and inspiration. Of course, the workflow could be improved and I'm thinking about it.

To use the animations already created:

Modify the script:

  • Commentprint_pose() method
  • Call whichever animation method you wish. For instance RunMale, IdleCombat...

To do:

  • Think of a better way to structure the code. One idea would be to record movements in pickable objects rather than writing them in code

  • Is it possible to use the F-curves ?

  • Add path selection in the main method