|
Blender V4.5
|
#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 | 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, AnimData &adt, const char *anim_type) |
| void | Assign_float_animations (const COLLADAFW::UniqueId &listid, AnimData &adt, const char *anim_type) |
| void | Assign_lens_animations (const COLLADAFW::UniqueId &listid, AnimData &adt, double aspect, const 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) |
| void | find_frames (std::vector< float > *frames, std::vector< FCurve * > *curves) |
| 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) |
Definition at line 40 of file AnimationImporter.h.
|
inline |
Definition at line 113 of file AnimationImporter.h.
References C, and TransformReader::TransformReader().
| AnimationImporter::~AnimationImporter | ( | ) |
Definition at line 205 of file AnimationImporter.cpp.
References BKE_fcurve_free().
Definition at line 1404 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), Object::adt, bc_get_joint_name(), BLI_assert, and AnimData::slot_handle.
Referenced by apply_matrix_curves().
| void AnimationImporter::apply_matrix_curves | ( | Object * | ob, |
| std::vector< FCurve * > & | animcurves, | ||
| COLLADAFW::Node * | root, | ||
| COLLADAFW::Node * | node, | ||
| COLLADAFW::Transformation * | tm ) |
Definition at line 639 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), add_bone_fcurve(), Object::adt, Bone::arm_mat, bc_get_joint_name(), BKE_armature_find_bone_name(), BKE_pose_channel_find_name(), calc_joint_parent_mat_rest(), copy_m4_m4(), CTX_data_main(), Object::data, ensure_action_and_slot_for_id(), evaluate_transform_at_frame(), find_frames(), get_joint_rest_mat(), i, Object::id, invert_m4(), invert_m4_m4(), mat4_decompose(), mul_m4_m4m4(), mul_m4_series, Object::pose, rot, ROT_MODE_QUAT, bPoseChannel::rotmode, Object::rotmode, AnimData::slot_handle, SNPRINTF, STRNCPY(), FCurve::totvert, and unit_m4().
Referenced by translate_Animations().
| void AnimationImporter::Assign_color_animations | ( | const COLLADAFW::UniqueId & | listid, |
| AnimData & | adt, | ||
| const char * | anim_type ) |
Creates the rna_paths and array indices of fcurves from animations using color and bound animation class of each animation.
Definition at line 477 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), BLI_assert, modify_fcurve(), AnimData::slot_handle, STRNCPY(), and unused_fcurve().
Referenced by translate_Animations().
| void AnimationImporter::Assign_float_animations | ( | const COLLADAFW::UniqueId & | listid, |
| AnimData & | adt, | ||
| const char * | anim_type ) |
XXX What About animation-type "rotation" ?
Definition at line 535 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), BLI_assert, BLI_strcasecmp_natural(), modify_fcurve(), AnimData::slot_handle, STREQ, and STRNCPY().
Referenced by translate_Animations().
| void AnimationImporter::Assign_lens_animations | ( | const COLLADAFW::UniqueId & | listid, |
| AnimData & | adt, | ||
| double | aspect, | ||
| const Camera * | cam, | ||
| const char * | anim_type, | ||
| int | fov_type ) |
Lens animations must be stored in COLLADA by using FOV, while blender internally uses focal length. The imported animation curves must be converted appropriately.
Definition at line 593 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), FCurve::bezt, BLI_assert, convert_to_focal_length(), i, modify_fcurve(), Camera::sensor_x, AnimData::slot_handle, STRNCPY(), 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 ) |
Creates the rna_paths and array indices of fcurves from animations using transformation and bound animation class of each animation.
Definition at line 359 of file AnimationImporter.cpp.
References ELEM, get_animation_axis_index(), modify_fcurve(), rot, SNPRINTF, STRNCPY(), transform(), 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 1370 of file AnimationImporter.cpp.
References calc_joint_parent_mat_rest(), copy_m4_m4(), TransformReader::get_node_mat(), i, mul_m4_m4m4(), and unit_m4().
Referenced by apply_matrix_curves(), calc_joint_parent_mat_rest(), and get_joint_rest_mat().
| float AnimationImporter::convert_to_focal_length | ( | float | in_xfov, |
| int | fov_type, | ||
| float | aspect, | ||
| float | sensorx ) |
Definition at line 581 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 ) |
Return true to indicate that mat contains a sane value.
Definition at line 1204 of file AnimationImporter.cpp.
References angle(), axis_angle_to_mat4(), copy_v3_v3(), UnitConverter::dae_matrix_to_mat4_(), TransformReader::dae_scale_to_v3(), TransformReader::dae_translate_to_v3(), ELEM, evaluate_fcurve(), report_class_type_unsupported(), size_to_mat4(), and SNPRINTF.
Referenced by evaluate_transform_at_frame().
| void AnimationImporter::evaluate_transform_at_frame | ( | float | mat[4][4], |
| COLLADAFW::Node * | node, | ||
| float | fra ) |
Internal, better make it private WARNING: evaluates only rotation and only assigns matrix transforms now prerequisites: animlist_map, curve_map.
Definition at line 1146 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(), i, mul_m4_m4m4(), and unit_m4().
Referenced by apply_matrix_curves().
| void AnimationImporter::find_frames | ( | std::vector< float > * | frames, |
| std::vector< FCurve * > * | curves ) |
Definition at line 324 of file AnimationImporter.cpp.
References FCurve::bezt, FCurve::totvert, and BezTriple::vec.
Referenced by apply_matrix_curves().
| AnimationImporter::AnimMix * AnimationImporter::get_animation_type | ( | const COLLADAFW::Node * | node, |
| std::map< COLLADAFW::UniqueId, const COLLADAFW::Object * > | FW_object_map ) |
Check if object is animated by checking if animlist_map holds the animlist_id of node transforms.
Definition at line 1037 of file AnimationImporter.cpp.
References i, setAnimType(), transform(), and types.
Referenced by translate_Animations().
| void AnimationImporter::get_joint_rest_mat | ( | float | mat[4][4], |
| COLLADAFW::Node * | root, | ||
| COLLADAFW::Node * | node ) |
Gives a world-space mat of joint at rest position.
Definition at line 1355 of file AnimationImporter.cpp.
References calc_joint_parent_mat_rest(), TransformReader::get_node_mat(), and mul_m4_m4m4().
Referenced by apply_matrix_curves().
| void AnimationImporter::modify_fcurve | ( | std::vector< FCurve * > * | curves, |
| const char * | rna_path, | ||
| int | array_index, | ||
| int | scale = 1 ) |
Sets the rna_path and array index to curve.
Definition at line 288 of file AnimationImporter.cpp.
References FCurve::array_index, BLI_strdup(), i, 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 278 of file AnimationImporter.cpp.
References BKE_object_apply_mat4(), copy_m4_m4(), TransformReader::get_node_mat(), and Object::runtime.
| void AnimationImporter::set_import_from_version | ( | std::string | import_from_version | ) |
Definition at line 1414 of file AnimationImporter.cpp.
| int AnimationImporter::setAnimType | ( | const COLLADAFW::Animatable * | prop, |
| int | type, | ||
| int | addition ) |
Definition at line 1132 of file AnimationImporter.cpp.
References types.
Referenced by get_animation_type().
| 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 819 of file AnimationImporter.cpp.
References AnimData::action, blender::animrig::action_fcurve_attach(), Camera::adt, Light::adt, Material::adt, Object::adt, apply_matrix_curves(), Assign_color_animations(), Assign_float_animations(), Assign_lens_animations(), Assign_transform_animations(), col, CTX_data_main(), Object::data, ensure_action_and_slot_for_id(), get_animation_type(), get_aspect_ratio(), i, Camera::id, Light::id, Material::id, Object::id, nullptr, ROT_MODE_EUL, Object::rotmode, AnimData::slot_handle, and transform().
| void AnimationImporter::unused_fcurve | ( | std::vector< FCurve * > * | curves | ) |
Definition at line 314 of file AnimationImporter.cpp.
Referenced by Assign_color_animations(), and Assign_transform_animations().
| bool AnimationImporter::write_animation | ( | const COLLADAFW::Animation * | anim | ) |
Definition at line 217 of file AnimationImporter.cpp.
References interp().
| bool AnimationImporter::write_animation_list | ( | const COLLADAFW::AnimationList * | animlist | ) |
Called on post-process stage after writeVisualScenes.
Definition at line 259 of file AnimationImporter.cpp.