|
Blender
V2.93
|
#include <AnimationImporter.h>
Inherits TransformReader, and AnimationImporterBase.
Public Member Functions | |
| AnimationImporter (bContext *C, UnitConverter *conv, ArmatureImporter *arm, Scene *scene) | |
| ~AnimationImporter () | |
| void | set_import_from_version (std::string import_from_version) |
| 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::multimap< COLLADAFW::UniqueId, Object * > &object_map, std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > FW_object_map, std::map< COLLADAFW::UniqueId, Material * > uid_material_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 | add_bone_animation_sampled (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) |
| void | Assign_lens_animations (const COLLADAFW::UniqueId &listid, ListBase *AnimCurves, const double aspect, Camera *cam, const char *anim_type, int fov_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, int scale=1) |
| void | unused_fcurve (std::vector< FCurve * > *curves) |
| 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) |
| float | convert_to_focal_length (float in_xfov, int fov_type, float aspect, float sensorx) |
| void | add_bone_fcurve (Object *ob, COLLADAFW::Node *node, FCurve *fcu) |
| void | extra_data_importer (std::string elementName) |
Definition at line 58 of file AnimationImporter.h.
|
inline |
Definition at line 136 of file AnimationImporter.h.
References scene.
| AnimationImporter::~AnimationImporter | ( | ) |
Definition at line 272 of file AnimationImporter.cpp.
References BKE_fcurve_free().
| void AnimationImporter::add_bone_animation_sampled | ( | Object * | ob, |
| std::vector< FCurve * > & | animcurves, | ||
| COLLADAFW::Node * | root, | ||
| COLLADAFW::Node * | node, | ||
| COLLADAFW::Transformation * | tm | ||
| ) |
Definition at line 1265 of file AnimationImporter.cpp.
References add_bone_fcurve(), Bone::arm_mat, bc_get_joint_name(), BKE_armature_find_bone_name(), BKE_pose_channel_find_name(), BLI_snprintf(), calc_joint_parent_mat_rest(), copy_m4_m4(), copy_v3_v3(), CTX_data_main(), Object::data, ED_id_action_ensure(), evaluate_transform_at_frame(), find_frames(), get_joint_rest_mat(), ArmatureImporter::get_rna_path_for_joint(), Object::id, invert_m4(), invert_m4_m4(), mat4_to_size(), mul_m4_m4m4(), mul_m4_series, node, Object::pose, BCQuat::quat(), ROT_MODE_QUAT, ROTATE, BCQuat::rotate_to(), bPoseChannel::rotmode, sort(), FCurve::totvert, and unit_m4().
Definition at line 2198 of file AnimationImporter.cpp.
References AnimData::action, action_groups_add_channel(), Object::adt, AGRP_SELECTED, bc_get_joint_name(), BKE_action_group_find_name(), BLI_addtail(), BLI_strncpy(), BLI_uniquename(), BLT_I18NCONTEXT_ID_ACTION, CTX_DATA_, bActionGroup::flag, bAction::groups, MEM_callocN, bActionGroup::name, and node.
Referenced by add_bone_animation_sampled(), apply_matrix_curves(), and translate_animation_OLD().
| void AnimationImporter::apply_matrix_curves | ( | Object * | ob, |
| std::vector< FCurve * > & | animcurves, | ||
| COLLADAFW::Node * | root, | ||
| COLLADAFW::Node * | node, | ||
| COLLADAFW::Transformation * | tm | ||
| ) |
Definition at line 816 of file AnimationImporter.cpp.
References AnimData::action, add_bone_fcurve(), Object::adt, Bone::arm_mat, bc_get_joint_name(), BKE_armature_find_bone_name(), BKE_pose_channel_find_name(), BLI_addtail(), BLI_snprintf(), BLI_strncpy(), calc_joint_parent_mat_rest(), copy_m4_m4(), CTX_data_main(), bAction::curves, Object::data, ED_id_action_ensure(), evaluate_transform_at_frame(), find_frames(), get_joint_rest_mat(), ArmatureImporter::get_rna_path_for_joint(), Object::id, invert_m4(), invert_m4_m4(), mat4_decompose(), mul_m4_m4m4(), mul_m4_series, node, NULL, Object::pose, rot, ROT_MODE_QUAT, bPoseChannel::rotmode, Object::rotmode, sort(), FCurve::totvert, unit_m4(), and unit_qt().
Referenced by translate_Animations().
| void AnimationImporter::Assign_color_animations | ( | const COLLADAFW::UniqueId & | listid, |
| ListBase * | AnimCurves, | ||
| const char * | anim_type | ||
| ) |
Definition at line 659 of file AnimationImporter.cpp.
References BLI_addtail(), BLI_strncpy(), modify_fcurve(), and unused_fcurve().
Referenced by translate_Animations().
| void AnimationImporter::Assign_float_animations | ( | const COLLADAFW::UniqueId & | listid, |
| ListBase * | AnimCurves, | ||
| const char * | anim_type | ||
| ) |
XXX What About animtype "rotation" ?
Definition at line 714 of file AnimationImporter.cpp.
References BLI_addtail(), BLI_strcasecmp_natural(), BLI_strncpy(), modify_fcurve(), and STREQ.
Referenced by translate_Animations().
| void AnimationImporter::Assign_lens_animations | ( | const COLLADAFW::UniqueId & | listid, |
| ListBase * | AnimCurves, | ||
| const double | aspect, | ||
| Camera * | cam, | ||
| const char * | anim_type, | ||
| int | fov_type | ||
| ) |
Definition at line 773 of file AnimationImporter.cpp.
References FCurve::bezt, BLI_addtail(), BLI_strncpy(), convert_to_focal_length(), modify_fcurve(), Camera::sensor_x, FCurve::totvert, and BezTriple::vec.
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 540 of file AnimationImporter.cpp.
References BLI_snprintf(), BLI_strncpy(), get_animation_axis_index(), modify_fcurve(), rot, Rotate, ROTATE, SCALE, transform(), TRANSFORM, TRANSLATE, and unused_fcurve().
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 2083 of file AnimationImporter.cpp.
References copy_m4_m4(), ArmatureImporter::get_joint_bind_mat(), TransformReader::get_node_mat(), mul_m4_m4m4(), node, and unit_m4().
Referenced by add_bone_animation_sampled(), apply_matrix_curves(), get_joint_rest_mat(), and translate_animation_OLD().
| float AnimationImporter::convert_to_focal_length | ( | float | in_xfov, |
| int | fov_type, | ||
| float | aspect, | ||
| float | sensorx | ||
| ) |
Definition at line 756 of file AnimationImporter.cpp.
References atanf, DEG2RADF, fov_to_focallength(), and tanf.
Referenced by Assign_lens_animations().
| bool AnimationImporter::evaluate_animation | ( | COLLADAFW::Transformation * | tm, |
| float | mat[4][4], | ||
| float | fra, | ||
| const char * | node_id | ||
| ) |
Definition at line 1919 of file AnimationImporter.cpp.
References angle(), axis_angle_to_mat4(), BLI_snprintf(), copy_v3_v3(), curve, UnitConverter::dae_matrix_to_mat4_(), TransformReader::dae_scale_to_v3(), TransformReader::dae_translate_to_v3(), evaluate_fcurve(), float(), report_class_type_unsupported(), ROTATE, Rotate, SCALE, size_to_mat4(), TRANSLATE, and type.
Referenced by evaluate_transform_at_frame().
| void AnimationImporter::evaluate_transform_at_frame | ( | float | mat[4][4], |
| COLLADAFW::Node * | node, | ||
| float | fra | ||
| ) |
Definition at line 1860 of file AnimationImporter.cpp.
References copy_m4_m4(), TransformReader::dae_matrix_to_mat4(), TransformReader::dae_rotate_to_mat4(), TransformReader::dae_scale_to_mat4(), TransformReader::dae_translate_to_mat4(), evaluate_animation(), mul_m4_m4m4(), node, ROTATE, SCALE, TRANSLATE, type, and unit_m4().
Referenced by add_bone_animation_sampled(), 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 503 of file AnimationImporter.cpp.
References FCurve::bezt, FCurve::totvert, and BezTriple::vec.
Referenced by add_bone_animation_sampled(), and apply_matrix_curves().
| void AnimationImporter::find_frames_old | ( | std::vector< float > * | frames, |
| COLLADAFW::Node * | node, | ||
| COLLADAFW::Transformation::TransformationType | tm_type | ||
| ) |
Definition at line 1518 of file AnimationImporter.cpp.
References FCurve::bezt, node, ROTATE, SCALE, 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 1408 of file AnimationImporter.cpp.
References node, 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 2067 of file AnimationImporter.cpp.
References calc_joint_parent_mat_rest(), ArmatureImporter::get_joint_bind_mat(), TransformReader::get_node_mat(), mul_m4_m4m4(), and node.
Referenced by add_bone_animation_sampled(), apply_matrix_curves(), and translate_animation_OLD().
| void AnimationImporter::modify_fcurve | ( | std::vector< FCurve * > * | curves, |
| const char * | rna_path, | ||
| int | array_index, | ||
| int | scale = 1 |
||
| ) |
Definition at line 467 of file AnimationImporter.cpp.
References FCurve::array_index, BLI_strdup(), and FCurve::rna_path.
Referenced by Assign_color_animations(), Assign_float_animations(), Assign_lens_animations(), and Assign_transform_animations().
| void AnimationImporter::read_node_transform | ( | COLLADAFW::Node * | node, |
| Object * | ob | ||
| ) |
Definition at line 351 of file AnimationImporter.cpp.
References BKE_object_apply_mat4(), copy_m4_m4(), TransformReader::get_node_mat(), node, and Object::obmat.
Referenced by DocumentImporter::create_instance_node(), and DocumentImporter::write_node().
| void AnimationImporter::set_import_from_version | ( | std::string | import_from_version | ) |
Definition at line 2227 of file AnimationImporter.cpp.
Referenced by DocumentImporter::writeGlobalAsset().
| int AnimationImporter::setAnimType | ( | const COLLADAFW::Animatable * | prop, |
| int | type, | ||
| int | addition | ||
| ) |
Definition at line 1503 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 1585 of file AnimationImporter.cpp.
References AnimData::action, add_bone_fcurve(), Object::adt, Bone::arm_mat, bc_get_joint_name(), BKE_armature_find_bone_name(), BKE_pose_channel_find_name(), BLI_addtail(), BLI_snprintf(), BLI_strncpy(), calc_joint_parent_mat_rest(), copy_m4_m4(), copy_v3_v3(), CTX_data_main(), bAction::curves, Object::data, ED_id_action_ensure(), evaluate_transform_at_frame(), find_frames_old(), ArmatureImporter::get_armature_for_joint(), get_joint_rest_mat(), ArmatureImporter::get_rna_path_for_joint(), Object::id, invert_m4(), invert_m4_m4(), mat4_to_quat(), mat4_to_size(), mul_m4_m4m4(), mul_m4_series, node, Object::pose, rot, ROT_MODE_EUL, ROT_MODE_QUAT, ROTATE, bPoseChannel::rotmode, Object::rotmode, SCALE, sort(), TRANSLATE, and unit_m4().
| void AnimationImporter::translate_Animations | ( | COLLADAFW::Node * | Node, |
| std::map< COLLADAFW::UniqueId, COLLADAFW::Node * > & | root_map, | ||
| std::multimap< COLLADAFW::UniqueId, Object * > & | object_map, | ||
| std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > | FW_object_map, | ||
| std::map< COLLADAFW::UniqueId, Material * > | uid_material_map | ||
| ) |
Definition at line 1018 of file AnimationImporter.cpp.
References AnimData::action, Camera::adt, Light::adt, Material::adt, Object::adt, apply_matrix_curves(), Assign_color_animations(), Assign_float_animations(), Assign_lens_animations(), Assign_transform_animations(), BKE_object_material_get(), BLI_addtail(), col, Color, CTX_data_main(), bAction::curves, Object::data, ED_id_action_ensure(), get_animation_curves(), get_animation_type(), ArmatureImporter::get_armature_for_joint(), get_aspect_ratio(), ArmatureImporter::get_rna_path_for_joint(), Camera::id, Light::id, Material::id, Object::id, if(), lamp, node, NULL, ROT_MODE_EUL, ROTATE, Object::rotmode, and transform().
Referenced by DocumentImporter::translate_anim_recursive().
| void AnimationImporter::unused_fcurve | ( | std::vector< FCurve * > * | curves | ) |
Definition at line 493 of file AnimationImporter.cpp.
Referenced by Assign_color_animations(), and Assign_transform_animations().
| bool AnimationImporter::write_animation | ( | const COLLADAFW::Animation * | anim | ) |
Definition at line 284 of file AnimationImporter.cpp.
References curve, interp(), and INTERPOLATION_LINEAR.
Referenced by DocumentImporter::writeAnimation().
| bool AnimationImporter::write_animation_list | ( | const COLLADAFW::AnimationList * | animlist | ) |
Definition at line 327 of file AnimationImporter.cpp.
Referenced by DocumentImporter::writeAnimationList().