From BlenderWiki

Jump to: navigation, search

Animation Importer (phabtar)

This is a description of the new importer design of the project. After the importer is made and committed ultimately the code must be able to describe what's happening in it self.

  • WriteAnimation() method writes the Animation Curves data parsed in from the COLLADA document in to blender fcurves, which are stored in the curve_map which match animation unique id's with fcurves vectors.
  • writeAnimationList() method maps COLLADAFW::AnimationLists objects in to animlist_map which maps animationList uids with animationList objects.

Animation list objects have animation bindings which binds animations to animations classes defined in COLLADAFWAnimationList.h. Animation lists are references by objects which implement animatable interface.

  • in the finish() method in DocumentImporter animations are assigned to transformations in nodes recursively in translate_anim_recursive() the translate_Animation() method is called on each node.
  • translate_Animation() -
    • Get the transforms of the parameter node.
    • Test if object has animations in the animation list. If not return.
    • Calculate bone node matrices. This is not needed at the moment.
    • For each node get the animation list , if exists
    • for each binding in the animation list get the curves referenced by the animation binding and call assign_transform_animations on each curve of the animation.
    • assign_transform_animations assigns rna_paths and array indices to curves according to the transform and animation class.
    • For objects add the modified curves to the animdata->action->curves of the objects. For joints create action groups and assign the fcurves to the bones.
    • some background work.

This implementation still needs to be tested intensely.

Animation Import New.png