~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to source/blender/collada/AnimationExporter.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "DNA_camera_types.h"
35
35
#include "DNA_armature_types.h"
36
36
#include "DNA_material_types.h"
 
37
#include "DNA_constraint_types.h"
 
38
 
 
39
#include "BLI_math.h"
 
40
#include "BLI_string.h"
 
41
#include "BLI_listbase.h"
 
42
#include "BLI_utildefines.h"
37
43
 
38
44
#include "BKE_DerivedMesh.h"
39
45
#include "BKE_fcurve.h"
40
46
#include "BKE_animsys.h"
41
47
#include "BKE_scene.h"
 
48
#include "BKE_action.h" // pose functions
 
49
#include "BKE_armature.h"
 
50
#include "BKE_object.h"
 
51
#include "BKE_constraint.h"
 
52
#include "BIK_api.h"
 
53
#include "BKE_global.h"
 
54
#include "ED_object.h"
 
55
 
42
56
#ifdef NAN_BUILDINFO
43
57
extern char build_rev[];
44
58
#endif
46
60
 
47
61
#include "MEM_guardedalloc.h"
48
62
 
49
 
#include "BKE_action.h" // pose functions
50
 
#include "BKE_armature.h"
51
 
#include "BKE_object.h"
52
 
 
53
 
#include "BLI_math.h"
54
 
#include "BLI_string.h"
55
 
#include "BLI_listbase.h"
56
 
 
57
63
#include "RNA_access.h"
58
64
 
59
65
#include "COLLADASWSource.h"
72
78
 
73
79
#include "collada_internal.h"
74
80
 
 
81
#include "IK_solver.h"
 
82
 
75
83
#include <vector>
76
84
#include <algorithm> // std::find
77
85
 
 
86
 
 
87
 
78
88
class AnimationExporter: COLLADASW::LibraryAnimations
79
89
{
80
90
private:
96
106
protected:
97
107
        const ExportSettings *export_settings;
98
108
 
99
 
        void dae_animation(Object* ob, FCurve *fcu, char* transformName , bool is_param, Material *ma = NULL);
 
109
        void dae_animation(Object *ob, FCurve *fcu, char *transformName, bool is_param, Material *ma = NULL);
 
110
    
 
111
        void export_object_constraint_animation(Object *ob);
 
112
 
 
113
        void export_morph_animation(Object *ob);
100
114
 
101
115
        void write_bone_animation_matrix(Object *ob_arm, Bone *bone);
102
116
 
116
130
        // (blend this into dae_bone_animation)
117
131
        void dae_bone_animation(std::vector<float> &fra, float *v, int tm_type, int axis, std::string ob_name, std::string bone_name);
118
132
        
119
 
        void dae_baked_animation(std::vector<float> &fra, Object *ob_arm , Bone *bone);
 
133
        void dae_baked_animation(std::vector<float> &fra, Object *ob_arm, Bone *bone);
 
134
 
 
135
        void dae_baked_object_animation(std::vector<float> &fra, Object *ob);
120
136
 
121
137
        float convert_time(float frame);
122
138
 
123
139
        float convert_angle(float angle);
124
140
 
125
 
        std::string get_semantic_suffix(COLLADASW::InputSemantic::Semantics semantic);  
 
141
        std::string get_semantic_suffix(COLLADASW::InputSemantic::Semantics semantic);
126
142
 
127
143
        void add_source_parameters(COLLADASW::SourceBase::ParameterNameList& param,
128
 
                                                           COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis , bool transform);
 
144
                                                           COLLADASW::InputSemantic::Semantics semantic, bool is_rot, const char *axis, bool transform);
129
145
        
130
146
        void get_source_values(BezTriple *bezt, COLLADASW::InputSemantic::Semantics semantic, bool rotation, float *values, int *length);
131
147
        
132
 
        float * get_eul_source_for_quat(Object *ob );
 
148
        float* get_eul_source_for_quat(Object *ob );
133
149
 
134
150
        std::string create_source_from_fcurve(COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id, const char *axis_name);
135
151
 
 
152
        std::string create_lens_source_from_fcurve(Camera *cam, COLLADASW::InputSemantic::Semantics semantic, FCurve *fcu, const std::string& anim_id);
 
153
 
136
154
        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);
137
155
 
138
156
        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);
139
157
 
140
158
        std::string create_xyz_source(float *v, int tot, const std::string& anim_id);
141
159
 
142
 
        std::string create_4x4_source(std::vector<float> &frames , Object * ob_arm, Bone *bone , const std::string& anim_id);
143
 
 
 
160
        std::string create_4x4_source(std::vector<float> &frames, Object * ob_arm, Bone *bone, const std::string& anim_id);
 
161
    
144
162
        std::string create_interpolation_source(FCurve *fcu, const std::string& anim_id, const char *axis_name, bool *has_tangents);
145
163
 
146
164
        std::string fake_interpolation_source(int tot, const std::string& anim_id, const char *axis_name);
 
165
        
147
166
        // for rotation, axis name is always appended and the value of append_axis is ignored
148
167
        std::string get_transform_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
149
168
        std::string get_light_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
150
169
        std::string get_camera_param_sid(char *rna_path, int tm_type, const char *axis_name, bool append_axis);
 
170
        
151
171
        void find_frames(Object *ob, std::vector<float> &fra, const char *prefix, const char *tm_name);
152
172
        void find_frames(Object *ob, std::vector<float> &fra);
153
173
 
 
174
        void make_anim_frames_from_targets(Object *ob, std::vector<float> &frames );
 
175
 
154
176
        void find_rotation_frames(Object *ob, std::vector<float> &fra, const char *prefix, int rotmode);
155
177
        
156
178
        // enable fcurves driving a specific bone, disable all the rest
159
181
        
160
182
        bool hasAnimations(Scene *sce);
161
183
        
162
 
        char* extract_transform_name(char *rna_path);
163
 
 
164
 
        std::string getObjectBoneName ( Object *ob,const FCurve * fcu);
 
184
        char *extract_transform_name(char *rna_path);
 
185
 
 
186
        std::string getObjectBoneName(Object *ob, const FCurve * fcu);
 
187
 
 
188
        void getBakedPoseData(Object *obarm, int startFrame, int endFrame, bool ActionBake, bool ActionBakeFirstFrame);
 
189
 
 
190
        bool validateConstraints(bConstraint *con);
 
191
 
 
192
        void calc_ob_mat_at_time(Object *ob, float ctime , float mat[][4]);
 
193
 
165
194
};