~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/collada/ArmatureExporter.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:
41
41
#include "DNA_listBase.h"
42
42
#include "DNA_mesh_types.h"
43
43
#include "DNA_object_types.h"
 
44
#include "DNA_constraint_types.h"
44
45
#include "DNA_scene_types.h"
45
46
 
46
47
#include "TransformWriter.h"
53
54
// XXX exporter writes wrong data for shared armatures.  A separate
54
55
// controller should be written for each armature-mesh binding how do
55
56
// we make controller ids then?
56
 
class ArmatureExporter: public COLLADASW::LibraryControllers, protected TransformWriter, protected InstanceWriter
 
57
class ArmatureExporter : public COLLADASW::LibraryControllers, protected TransformWriter, protected InstanceWriter
57
58
{
58
59
public:
59
60
        ArmatureExporter(COLLADASW::StreamWriter *sw, const ExportSettings *export_settings);
60
61
 
61
62
        // write bone nodes
62
 
        void add_armature_bones(Object *ob_arm, Scene* sce, SceneExporter* se,
63
 
                                                        std::list<Object*>& child_objects);
64
 
 
65
 
        bool is_skinned_mesh(Object *ob);
66
 
 
67
 
        void add_instance_controller(Object *ob);
68
 
 
69
 
        void export_controllers(Scene *sce);
70
 
 
71
 
        void operator()(Object *ob);
 
63
        void add_armature_bones(Object *ob_arm, Scene *sce, SceneExporter *se,
 
64
                                std::list<Object *>& child_objects);
 
65
 
 
66
        bool add_instance_controller(Object *ob);
 
67
 
 
68
        //void export_controllers(Scene *sce);*/
 
69
 
 
70
        //void operator()(Object *ob);
72
71
 
73
72
private:
74
73
        Scene *scene;
76
75
        const ExportSettings *export_settings;
77
76
 
78
77
#if 0
79
 
        std::vector<Object*> written_armatures;
 
78
        std::vector<Object *> written_armatures;
80
79
 
81
80
        bool already_written(Object *ob_arm);
82
81
 
85
84
        void find_objects_using_armature(Object *ob_arm, std::vector<Object *>& objects, Scene *sce);
86
85
#endif
87
86
 
88
 
        Object *get_assigned_armature(Object *ob);
89
 
 
90
87
        std::string get_joint_sid(Bone *bone, Object *ob_arm);
91
88
 
92
89
        // Scene, SceneExporter and the list of child_objects
93
90
        // are required for writing bone parented objects
94
 
        void add_bone_node(Bone *bone, Object *ob_arm, Scene* sce, SceneExporter* se,
95
 
                                           std::list<Object*>& child_objects);
 
91
        void add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, SceneExporter *se,
 
92
                           std::list<Object *>& child_objects);
96
93
 
97
94
        void add_bone_transform(Object *ob_arm, Bone *bone, COLLADASW::Node& node);
98
95
 
100
97
 
101
98
        std::string get_controller_id(Object *ob_arm, Object *ob);
102
99
 
103
 
        // ob should be of type OB_MESH
104
 
        // both args are required
105
 
        void export_controller(Object* ob, Object *ob_arm);
106
 
 
107
 
        void add_joints_element(ListBase *defbase,
108
 
                                                        const std::string& joints_source_id, const std::string& inv_bind_mat_source_id);
109
 
 
110
 
        void add_bind_shape_mat(Object *ob);
111
 
 
112
 
        std::string add_joints_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
113
 
 
114
 
        std::string add_inv_bind_mats_source(Object *ob_arm, ListBase *defbase, const std::string& controller_id);
115
 
 
116
 
        Bone *get_bone_from_defgroup(Object *ob_arm, bDeformGroup* def);
117
 
 
118
 
        bool is_bone_defgroup(Object *ob_arm, bDeformGroup* def);
119
 
 
120
 
        std::string add_weights_source(Mesh *me, const std::string& controller_id,
121
 
                                                                   const std::list<float>& weights);
122
 
 
123
 
        void add_vertex_weights_element(const std::string& weights_source_id, const std::string& joints_source_id,
124
 
                                                                        const std::list<int>& vcount, const std::list<int>& joints);
 
100
        void write_bone_URLs(COLLADASW::InstanceController &ins, Object *ob_arm, Bone *bone);
125
101
};
126
102
 
127
103
#endif