23 #include "COLLADAFWMorphController.h"
24 #include "COLLADAFWNode.h"
25 #include "COLLADAFWUniqueId.h"
50 #define UNLIMITED_CHAIN_MAX INT_MAX
51 #define MINIMUM_BONE_LENGTH 0.000001f
65 float leaf_bone_length;
71 struct ArmatureJoints {
73 std::vector<COLLADAFW::Node *> root_joints;
75 std::vector<ArmatureJoints> armature_joints;
80 std::map<COLLADAFW::UniqueId, COLLADAFW::UniqueId> geom_uid_by_controller_uid;
81 std::map<COLLADAFW::UniqueId, COLLADAFW::Node *> joint_by_uid;
82 std::vector<COLLADAFW::Node *> root_joints;
83 std::vector<COLLADAFW::Node *> finished_joints;
84 std::vector<COLLADAFW::MorphController *> morph_controllers;
85 std::map<COLLADAFW::UniqueId, Object *> joint_parent_map;
86 std::map<COLLADAFW::UniqueId, Object *> unskinned_armature_map;
94 std::map<COLLADAFW::UniqueId, SkinInfo>
97 JointData *get_joint_data(COLLADAFW::Node *
node);
101 COLLADAFW::Node *
node,
104 float parent_mat[4][4],
106 std::vector<std::string> &layer_labels);
109 COLLADAFW::Node *
node,
111 std::vector<std::string> &layer_labels,
114 void fix_leaf_bone_hierarchy(
bArmature *armature,
Bone *bone,
bool fix_orientation);
117 void connect_bone_chains(
bArmature *armature,
Bone *bone,
const int max_chain_length);
119 void set_pose(
Object *ob_arm,
120 COLLADAFW::Node *root_node,
121 const char *parentname,
122 float parent_mat[4][4]);
124 void set_bone_transformation_type(
const COLLADAFW::Node *
node,
Object *ob_arm);
125 bool node_is_decomposed(
const COLLADAFW::Node *
node);
127 void set_leaf_bone_shapes(
Object *ob_arm);
128 void set_euler_rotmode();
131 Object *get_empty_for_leaves();
136 ArmatureJoints &get_armature_joints(
Object *ob_arm);
140 void create_armature_bones(
Main *bmain, std::vector<Object *> &arm_objs);
143 typedef std::map<std::string, ExtraTags *> TagsMap;
144 TagsMap uid_tags_map;
164 void link_armature(
Object *ob_arm,
165 const COLLADAFW::UniqueId &geom_id,
166 const COLLADAFW::UniqueId &controller_data_id);
173 COLLADAFW::UniqueId *
get_geometry_uid(
const COLLADAFW::UniqueId &controller_uid);
Object is a sort of wrapper for general info.
static Controller * controller
void make_shape_keys(bContext *C)
void get_rna_path_for_joint(COLLADAFW::Node *node, char *joint_path, size_t count)
void make_armatures(bContext *C, std::vector< Object * > &objects_to_scale)
bool write_skin_controller_data(const COLLADAFW::SkinControllerData *data)
bool write_controller(const COLLADAFW::Controller *controller)
void set_tags_map(TagsMap &tags_map)
ArmatureImporter(UnitConverter *conv, MeshImporterBase *mesh, Main *bmain, Scene *sce, ViewLayer *view_layer, const ImportSettings *import_settings)
Object * get_armature_for_joint(COLLADAFW::Node *node)
void add_root_joint(COLLADAFW::Node *node, Object *parent)
bool get_joint_bind_mat(float m[4][4], COLLADAFW::Node *joint)
COLLADAFW::UniqueId * get_geometry_uid(const COLLADAFW::UniqueId &controller_uid)
std::map< std::string, BoneExtended * > BoneExtensionMap