9 #include "COLLADAFWMorphController.h"
10 #include "COLLADAFWNode.h"
11 #include "COLLADAFWUniqueId.h"
36 #define UNLIMITED_CHAIN_MAX INT_MAX
37 #define MINIMUM_BONE_LENGTH 0.000001f
51 float leaf_bone_length;
57 struct ArmatureJoints {
59 std::vector<COLLADAFW::Node *> root_joints;
61 std::vector<ArmatureJoints> armature_joints;
66 std::map<COLLADAFW::UniqueId, COLLADAFW::UniqueId> geom_uid_by_controller_uid;
67 std::map<COLLADAFW::UniqueId, COLLADAFW::Node *> joint_by_uid;
68 std::vector<COLLADAFW::Node *> root_joints;
69 std::vector<COLLADAFW::Node *> finished_joints;
70 std::vector<COLLADAFW::MorphController *> morph_controllers;
71 std::map<COLLADAFW::UniqueId, Object *> joint_parent_map;
72 std::map<COLLADAFW::UniqueId, Object *> unskinned_armature_map;
80 std::map<COLLADAFW::UniqueId, SkinInfo>
83 JointData *get_joint_data(COLLADAFW::Node *
node);
87 COLLADAFW::Node *
node,
90 float parent_mat[4][4],
92 std::vector<std::string> &layer_labels);
95 COLLADAFW::Node *
node,
97 std::vector<std::string> &layer_labels,
106 void fix_leaf_bone_hierarchy(
bArmature *armature,
Bone *bone,
bool fix_orientation);
109 void connect_bone_chains(
bArmature *armature,
Bone *bone,
int max_chain_length);
111 void set_pose(
Object *ob_arm,
112 COLLADAFW::Node *root_node,
113 const char *parentname,
114 float parent_mat[4][4]);
116 void set_bone_transformation_type(
const COLLADAFW::Node *
node,
Object *ob_arm);
117 bool node_is_decomposed(
const COLLADAFW::Node *
node);
119 void set_leaf_bone_shapes(
Object *ob_arm);
120 void set_euler_rotmode();
123 Object *get_empty_for_leaves();
128 ArmatureJoints &get_armature_joints(
Object *ob_arm);
132 void create_armature_bones(
Main *bmain, std::vector<Object *> &arm_objs);
135 typedef std::map<std::string, ExtraTags *> TagsMap;
136 TagsMap uid_tags_map;
161 void link_armature(
Object *ob_arm,
162 const COLLADAFW::UniqueId &geom_id,
163 const COLLADAFW::UniqueId &controller_data_id);
170 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