Changeset View
Changeset View
Standalone View
Standalone View
source/blender/collada/AnimationExporter.h
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| private: | private: | ||||
| Scene *scene; | Scene *scene; | ||||
| COLLADASW::StreamWriter *sw; | COLLADASW::StreamWriter *sw; | ||||
| public: | public: | ||||
| AnimationExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings): | AnimationExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings): | ||||
| COLLADASW::LibraryAnimations(sw), export_settings(export_settings) | COLLADASW::LibraryAnimations(sw), | ||||
| { this->sw = sw; } | export_settings(export_settings) | ||||
| { | |||||
| this->sw = sw; | |||||
| } | |||||
| bool exportAnimations(Scene *sce); | bool exportAnimations(Scene *sce); | ||||
| // called for each exported object | // called for each exported object | ||||
| void operator() (Object *ob); | void operator() (Object *ob); | ||||
| protected: | protected: | ||||
| const ExportSettings *export_settings; | const ExportSettings *export_settings; | ||||
| void dae_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma = NULL); | |||||
| void export_object_constraint_animation(Object *ob); | void export_object_constraint_animation(Object *ob); | ||||
| void export_morph_animation(Object *ob); | void export_morph_animation(Object *ob); | ||||
| void write_bone_animation_matrix(Object *ob_arm, Bone *bone); | void write_bone_animation_matrix(Object *ob_arm, Bone *bone); | ||||
| void write_bone_animation(Object *ob_arm, Bone *bone); | void write_bone_animation(Object *ob_arm, Bone *bone); | ||||
| Show All 24 Lines | protected: | ||||
| void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param, | void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param, | ||||
| COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform); | COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform); | ||||
| void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool is_angle, float *values, int *length); | void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool is_angle, float *values, int *length); | ||||
| float* get_eul_source_for_quat(Object *ob ); | float* get_eul_source_for_quat(Object *ob ); | ||||
| void export_keyframed_animation_set(Object *ob); | |||||
| void create_keyframed_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma = NULL); | |||||
| void export_sampled_animation_set(Object *ob); | |||||
| void create_sampled_animation(int channel_count, std::vector<float> ×, std::vector<float> &values, std::string, std::string label, std::string axis_name, bool is_rot); | |||||
| void evaluate_anim_with_constraints(Object *ob, float ctime); | |||||
| std::string create_source_from_fcurve(COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id, const char *axis_name); | std::string create_source_from_fcurve(COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id, const char *axis_name); | ||||
| std::string create_source_from_fcurve(COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id, const char *axis_name, Object *ob); | |||||
| std::string create_lens_source_from_fcurve(Camera *cam, COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id); | std::string create_lens_source_from_fcurve(Camera *cam, COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id); | ||||
| std::string create_source_from_array(COLLADASW::InputSemantic::Semantics semantic, float *v, int tot, bool is_rot, const std::string& anim_id, const char *axis_name); | std::string create_source_from_array(COLLADASW::InputSemantic::Semantics semantic, float *v, int tot, bool is_rot, const std::string& anim_id, const char *axis_name); | ||||
| std::string create_source_from_vector(COLLADASW::InputSemantic::Semantics semantic, std::vector<float> &fra, bool is_rot, const std::string& anim_id, const char *axis_name); | std::string create_source_from_vector(COLLADASW::InputSemantic::Semantics semantic, std::vector<float> &fra, bool is_rot, const std::string& anim_id, const char *axis_name); | ||||
| std::string create_xyz_source(float *v, int tot, const std::string& anim_id); | std::string create_xyz_source(float *v, int tot, const std::string& anim_id); | ||||
| std::string create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id); | std::string create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id); | ||||
| std::string create_interpolation_source(FCurve *fcu, const std::string& anim_id, const char *axis_name, bool *has_tangents); | std::string create_interpolation_source(FCurve *fcu, const std::string& anim_id, const char *axis_name, bool *has_tangents); | ||||
| std::string fake_interpolation_source(int tot, const std::string& anim_id, const char *axis_name); | std::string fake_interpolation_source(int tot, const std::string& anim_id, const char *axis_name); | ||||
| // for rotation, axis name is always appended and the value of append_axis is ignored | // for rotation, axis name is always appended and the value of append_axis is ignored | ||||
| std::string get_transform_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | std::string get_transform_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | ||||
| std::string get_light_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | std::string get_light_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | ||||
| std::string get_camera_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | std::string get_camera_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis); | ||||
| void find_frames(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name); | void find_keyframes(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name); | ||||
| void find_frames(Object *ob, std::vector<float> &fra); | void find_keyframes(Object *ob, std::vector<float> &fra); | ||||
| void find_sampleframes(Object *ob, std::vector<float> &fra); | |||||
| void make_anim_frames_from_targets(Object *ob, std::vector<float> &frames ); | void make_anim_frames_from_targets(Object *ob, std::vector<float> &frames ); | ||||
| void find_rotation_frames(Object *ob, std::vector<float> &fra, const char *prefix, int rotmode); | void find_rotation_frames(Object *ob, std::vector<float> &fra, const char *prefix, int rotmode); | ||||
| // enable fcurves driving a specific bone, disable all the rest | // enable fcurves driving a specific bone, disable all the rest | ||||
| // if bone_name = NULL enable all fcurves | // if bone_name = NULL enable all fcurves | ||||
| void enable_fcurves(bAction *act, char *bone_name); | void enable_fcurves(bAction *act, char *bone_name); | ||||
| bool hasAnimations(Scene *sce); | bool hasAnimations(Scene *sce); | ||||
| char *extract_transform_name(char *rna_path); | char *extract_transform_name(char *rna_path); | ||||
| std::string getObjectBoneName(Object *ob, const FCurve * fcu); | std::string getObjectBoneName(Object *ob, const FCurve * fcu); | ||||
| std::string getAnimationPathId(const FCurve *fcu); | std::string getAnimationPathId(const FCurve *fcu); | ||||
| void getBakedPoseData(Object *obarm, int startFrame, int endFrame, bool ActionBake, bool ActionBakeFirstFrame); | void getBakedPoseData(Object *obarm, int startFrame, int endFrame, bool ActionBake, bool ActionBakeFirstFrame); | ||||
| bool validateConstraints(bConstraint *con); | bool validateConstraints(bConstraint *con); | ||||
| void calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4]); | //void calc_obmat_at_time(Object *ob, float ctime); | ||||
| }; | }; | ||||