Blender V2.61 - r43446
|
#include <AnimationImporter.h>
Classes | |
struct | AnimMix |
Public Member Functions | |
AnimationImporter (UnitConverter *conv, ArmatureImporter *arm, Scene *scene) | |
~AnimationImporter () | |
bool | write_animation (const COLLADAFW::Animation *anim) |
bool | write_animation_list (const COLLADAFW::AnimationList *animlist) |
void | read_node_transform (COLLADAFW::Node *node, Object *ob) |
void | translate_Animations (COLLADAFW::Node *Node, std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &root_map, std::map< COLLADAFW::UniqueId, Object * > &object_map, std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > FW_object_map) |
AnimMix * | get_animation_type (const COLLADAFW::Node *node, std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > FW_object_map) |
void | apply_matrix_curves (Object *ob, std::vector< FCurve * > &animcurves, COLLADAFW::Node *root, COLLADAFW::Node *node, COLLADAFW::Transformation *tm) |
void | Assign_transform_animations (COLLADAFW::Transformation *transform, const COLLADAFW::AnimationList::AnimationBinding *binding, std::vector< FCurve * > *curves, bool is_joint, char *joint_path) |
void | Assign_color_animations (const COLLADAFW::UniqueId &listid, ListBase *AnimCurves, const char *anim_type) |
void | Assign_float_animations (const COLLADAFW::UniqueId &listid, ListBase *AnimCurves, const char *anim_type) |
int | setAnimType (const COLLADAFW::Animatable *prop, int type, int addition) |
void | modify_fcurve (std::vector< FCurve * > *curves, const char *rna_path, int array_index) |
Object * | translate_animation_OLD (COLLADAFW::Node *node, std::map< COLLADAFW::UniqueId, Object * > &object_map, std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > &root_map, COLLADAFW::Transformation::TransformationType tm_type, Object *par_job=NULL) |
void | find_frames (std::vector< float > *frames, std::vector< FCurve * > *curves) |
void | find_frames_old (std::vector< float > *frames, COLLADAFW::Node *node, COLLADAFW::Transformation::TransformationType tm_type) |
void | evaluate_transform_at_frame (float mat[4][4], COLLADAFW::Node *node, float fra) |
bool | evaluate_animation (COLLADAFW::Transformation *tm, float mat[4][4], float fra, const char *node_id) |
void | get_joint_rest_mat (float mat[4][4], COLLADAFW::Node *root, COLLADAFW::Node *node) |
bool | calc_joint_parent_mat_rest (float mat[4][4], float par[4][4], COLLADAFW::Node *node, COLLADAFW::Node *end) |
void | add_bone_fcurve (Object *ob, COLLADAFW::Node *node, FCurve *fcu) |
void | add_bezt (FCurve *fcu, float fra, float value) |
void | extra_data_importer (std::string elementName) |
Definition at line 63 of file AnimationImporter.h.
AnimationImporter::AnimationImporter | ( | UnitConverter * | conv, |
ArmatureImporter * | arm, | ||
Scene * | scene | ||
) |
Definition at line 243 of file AnimationImporter.cpp.
AnimationImporter::~AnimationImporter | ( | ) |
Definition at line 246 of file AnimationImporter.cpp.
References free_fcurve().
void AnimationImporter::add_bezt | ( | FCurve * | fcu, |
float | fra, | ||
float | value | ||
) |
Definition at line 1738 of file AnimationImporter.cpp.
References BEZT_IPO_LIN, calchandles_fcurve(), BezTriple::f1, BezTriple::f2, BezTriple::f3, BezTriple::h1, BezTriple::h2, HD_AUTO, insert_bezt_fcurve(), BezTriple::ipo, SELECT, and BezTriple::vec.
Referenced by apply_matrix_curves(), and translate_animation_OLD().
void AnimationImporter::add_bone_fcurve | ( | Object * | ob, |
COLLADAFW::Node * | node, | ||
FCurve * | fcu | ||
) |
Definition at line 1714 of file AnimationImporter.cpp.
References AnimData::action, action_groups_add_channel(), action_groups_find_named(), Object::adt, AGRP_SELECTED, bc_get_joint_name(), BLI_addtail(), BLI_strncpy(), BLI_uniquename(), bActionGroup::flag, bAction::groups, MEM_callocN(), bActionGroup::name, and NULL.
Referenced by apply_matrix_curves(), translate_animation_OLD(), and translate_Animations().
void AnimationImporter::apply_matrix_curves | ( | Object * | ob, |
std::vector< FCurve * > & | animcurves, | ||
COLLADAFW::Node * | root, | ||
COLLADAFW::Node * | node, | ||
COLLADAFW::Transformation * | tm | ||
) |
Definition at line 637 of file AnimationImporter.cpp.
References AnimData::action, add_bezt(), add_bone_fcurve(), Object::adt, Bone::arm_mat, bc_get_joint_name(), BLI_addtail(), BLI_snprintf(), BLI_strncpy(), calc_joint_parent_mat_rest(), copy_m4_m4(), copy_v3_v3(), bAction::curves, Object::data, evaluate_transform_at_frame(), find_frames(), get_joint_rest_mat(), get_named_bone(), get_pose_channel(), ArmatureImporter::get_rna_path_for_joint(), i, Object::id, invert_m4(), invert_m4_m4(), mat4_to_quat(), mat4_to_size(), mul_serie_m4(), mult_m4_m4m4(), NULL, Object::pose, ROT_MODE_QUAT, Object::rotmode, bPoseChannel::rotmode, sort(), FCurve::totvert, unit_m4(), and verify_adt_action().
Referenced by translate_Animations().
void AnimationImporter::Assign_color_animations | ( | const COLLADAFW::UniqueId & | listid, |
ListBase * | AnimCurves, | ||
const char * | anim_type | ||
) |
Definition at line 567 of file AnimationImporter.cpp.
References BLI_addtail(), BLI_strncpy(), and modify_fcurve().
Referenced by translate_Animations().
void AnimationImporter::Assign_float_animations | ( | const COLLADAFW::UniqueId & | listid, |
ListBase * | AnimCurves, | ||
const char * | anim_type | ||
) |
Definition at line 610 of file AnimationImporter.cpp.
References BLI_addtail(), BLI_strncpy(), and modify_fcurve().
Referenced by translate_Animations().
void AnimationImporter::Assign_transform_animations | ( | COLLADAFW::Transformation * | transform, |
const COLLADAFW::AnimationList::AnimationBinding * | binding, | ||
std::vector< FCurve * > * | curves, | ||
bool | is_joint, | ||
char * | joint_path | ||
) |
Definition at line 460 of file AnimationImporter.cpp.
References BLI_snprintf(), BLI_strncpy(), modify_fcurve(), ROTATE, Rotate, and TRANSLATE.
Referenced by translate_Animations().
bool AnimationImporter::calc_joint_parent_mat_rest | ( | float | mat[4][4], |
float | par[4][4], | ||
COLLADAFW::Node * | node, | ||
COLLADAFW::Node * | end | ||
) |
Definition at line 1605 of file AnimationImporter.cpp.
References copy_m4_m4(), ArmatureImporter::get_joint_bind_mat(), TransformReader::get_node_mat(), mult_m4_m4m4(), NULL, and unit_m4().
Referenced by apply_matrix_curves(), get_joint_rest_mat(), and translate_animation_OLD().
bool AnimationImporter::evaluate_animation | ( | COLLADAFW::Transformation * | tm, |
float | mat[4][4], | ||
float | fra, | ||
const char * | node_id | ||
) |
Definition at line 1442 of file AnimationImporter.cpp.
References angle(), axis_angle_to_mat4(), BLI_snprintf(), copy_v3_v3(), TransformReader::dae_matrix_to_mat4(), TransformReader::dae_scale_to_v3(), TransformReader::dae_translate_to_v3(), evaluate_fcurve(), ROTATE, Rotate, size_to_mat4(), and TRANSLATE.
Referenced by evaluate_transform_at_frame().
void AnimationImporter::evaluate_transform_at_frame | ( | float | mat[4][4], |
COLLADAFW::Node * | node, | ||
float | fra | ||
) |
Definition at line 1397 of file AnimationImporter.cpp.
References copy_m4_m4(), TransformReader::dae_matrix_to_mat4(), evaluate_animation(), i, mult_m4_m4m4(), and unit_m4().
Referenced by apply_matrix_curves(), and translate_animation_OLD().
void AnimationImporter::extra_data_importer | ( | std::string | elementName | ) |
void AnimationImporter::find_frames | ( | std::vector< float > * | frames, |
std::vector< FCurve * > * | curves | ||
) |
Definition at line 442 of file AnimationImporter.cpp.
References FCurve::bezt, find(), FCurve::totvert, and BezTriple::vec.
Referenced by apply_matrix_curves().
void AnimationImporter::find_frames_old | ( | std::vector< float > * | frames, |
COLLADAFW::Node * | node, | ||
COLLADAFW::Transformation::TransformationType | tm_type | ||
) |
Definition at line 1079 of file AnimationImporter.cpp.
References FCurve::bezt, find(), i, ROTATE, FCurve::totvert, transform(), TRANSLATE, and BezTriple::vec.
Referenced by translate_animation_OLD().
AnimationImporter::AnimMix * AnimationImporter::get_animation_type | ( | const COLLADAFW::Node * | node, |
std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > | FW_object_map | ||
) |
Definition at line 997 of file AnimationImporter.cpp.
References i, NULL, setAnimType(), transform(), and types.
Referenced by translate_Animations().
void AnimationImporter::get_joint_rest_mat | ( | float | mat[4][4], |
COLLADAFW::Node * | root, | ||
COLLADAFW::Node * | node | ||
) |
Definition at line 1591 of file AnimationImporter.cpp.
References calc_joint_parent_mat_rest(), ArmatureImporter::get_joint_bind_mat(), TransformReader::get_node_mat(), mult_m4_m4m4(), and NULL.
Referenced by apply_matrix_curves(), and translate_animation_OLD().
void AnimationImporter::modify_fcurve | ( | std::vector< FCurve * > * | curves, |
const char * | rna_path, | ||
int | array_index | ||
) |
Definition at line 427 of file AnimationImporter.cpp.
References FCurve::array_index, BLI_strdup(), i, and FCurve::rna_path.
Referenced by Assign_color_animations(), Assign_float_animations(), and Assign_transform_animations().
void AnimationImporter::read_node_transform | ( | COLLADAFW::Node * | node, |
Object * | ob | ||
) |
Definition at line 322 of file AnimationImporter.cpp.
References copy_m4_m4(), TransformReader::get_node_mat(), object_apply_mat4(), and Object::obmat.
Referenced by DocumentImporter::create_instance_node(), and DocumentImporter::write_node().
int AnimationImporter::setAnimType | ( | const COLLADAFW::Animatable * | prop, |
int | type, | ||
int | addition | ||
) |
Definition at line 1070 of file AnimationImporter.cpp.
References types.
Referenced by get_animation_type().
Object * AnimationImporter::translate_animation_OLD | ( | COLLADAFW::Node * | node, |
std::map< COLLADAFW::UniqueId, Object * > & | object_map, | ||
std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > & | root_map, | ||
COLLADAFW::Transformation::TransformationType | tm_type, | ||
Object * | par_job = NULL |
||
) |
Definition at line 1142 of file AnimationImporter.cpp.
References AnimData::action, add_bezt(), add_bone_fcurve(), Object::adt, Bone::arm_mat, bc_get_joint_name(), BLI_addtail(), BLI_snprintf(), BLI_strncpy(), calc_joint_parent_mat_rest(), copy_m4_m4(), copy_v3_v3(), bAction::curves, Object::data, evaluate_transform_at_frame(), find_frames_old(), ArmatureImporter::get_armature_for_joint(), get_joint_rest_mat(), get_named_bone(), get_pose_channel(), ArmatureImporter::get_rna_path_for_joint(), i, Object::id, invert_m4(), invert_m4_m4(), mat4_to_quat(), mat4_to_size(), mul_serie_m4(), mult_m4_m4m4(), NULL, Object::pose, MakeCursor::root, ROT_MODE_QUAT, ROTATE, Object::rotmode, bPoseChannel::rotmode, sort(), TRANSLATE, unit_m4(), simple_enum_gen::val, and verify_adt_action().
void AnimationImporter::translate_Animations | ( | COLLADAFW::Node * | Node, |
std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > & | root_map, | ||
std::map< COLLADAFW::UniqueId, Object * > & | object_map, | ||
std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > | FW_object_map | ||
) |
Definition at line 781 of file AnimationImporter.cpp.
References AnimData::action, add_bone_fcurve(), Lamp::adt, Material::adt, Camera::adt, Object::adt, apply_matrix_curves(), Assign_color_animations(), Assign_float_animations(), Assign_transform_animations(), bc_get_joint_name(), BLI_addtail(), bAction::curves, Object::data, get_animation_type(), ArmatureImporter::get_armature_for_joint(), get_pose_channel(), ArmatureImporter::get_rna_path_for_joint(), give_current_material(), i, Camera::id, Material::id, Object::id, Lamp::id, if(), NULL, OB_ARMATURE, Object::pose, MakeCursor::root, ROT_MODE_EUL, ROTATE, Object::rotmode, bPoseChannel::rotmode, transform(), Object::type, and verify_adt_action().
Referenced by DocumentImporter::translate_anim_recursive().
bool AnimationImporter::write_animation | ( | const COLLADAFW::Animation * | anim | ) |
Definition at line 256 of file AnimationImporter.cpp.
References interp().
Referenced by DocumentImporter::writeAnimation().
bool AnimationImporter::write_animation_list | ( | const COLLADAFW::AnimationList * | animlist | ) |
Definition at line 298 of file AnimationImporter.cpp.
Referenced by DocumentImporter::writeAnimationList().