|
@@ -247,7 +247,7 @@ struct FBXConverter::PotentialNode {
|
|
/// todo: get bone from stack
|
|
/// todo: get bone from stack
|
|
/// todo: make map of aiBone* to aiNode*
|
|
/// todo: make map of aiBone* to aiNode*
|
|
/// then update convert clusters to the new format
|
|
/// then update convert clusters to the new format
|
|
-void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node) {
|
|
|
|
|
|
+void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node, const aiMatrix4x4& parent_transform) {
|
|
const std::vector<const Connection *> &conns = doc.GetConnectionsByDestinationSequenced(id, "Model");
|
|
const std::vector<const Connection *> &conns = doc.GetConnectionsByDestinationSequenced(id, "Model");
|
|
|
|
|
|
std::vector<PotentialNode> nodes;
|
|
std::vector<PotentialNode> nodes;
|
|
@@ -278,7 +278,7 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
|
|
if (nullptr != model) {
|
|
if (nullptr != model) {
|
|
nodes_chain.clear();
|
|
nodes_chain.clear();
|
|
post_nodes_chain.clear();
|
|
post_nodes_chain.clear();
|
|
- aiMatrix4x4 new_abs_transform = parent->mTransformation;
|
|
|
|
|
|
+ aiMatrix4x4 new_abs_transform = parent_transform;
|
|
std::string node_name = FixNodeName(model->Name());
|
|
std::string node_name = FixNodeName(model->Name());
|
|
// even though there is only a single input node, the design of
|
|
// even though there is only a single input node, the design of
|
|
// assimp (or rather: the complicated transformation chain that
|
|
// assimp (or rather: the complicated transformation chain that
|
|
@@ -345,7 +345,7 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
|
|
}
|
|
}
|
|
|
|
|
|
// recursion call - child nodes
|
|
// recursion call - child nodes
|
|
- ConvertNodes(model->ID(), last_parent, root_node);
|
|
|
|
|
|
+ ConvertNodes(model->ID(), last_parent, root_node, new_abs_transform);
|
|
|
|
|
|
if (doc.Settings().readLights) {
|
|
if (doc.Settings().readLights) {
|
|
ConvertLights(*model, node_name);
|
|
ConvertLights(*model, node_name);
|
|
@@ -1676,14 +1676,14 @@ void FBXConverter::ConvertCluster(std::vector<aiBone*> &local_mesh_bones, const
|
|
|
|
|
|
//bone->mOffsetMatrix = cluster->Transform();
|
|
//bone->mOffsetMatrix = cluster->Transform();
|
|
// store local transform link for post processing
|
|
// store local transform link for post processing
|
|
-
|
|
|
|
|
|
+
|
|
bone->mOffsetMatrix = cluster->TransformLink();
|
|
bone->mOffsetMatrix = cluster->TransformLink();
|
|
bone->mOffsetMatrix.Inverse();
|
|
bone->mOffsetMatrix.Inverse();
|
|
|
|
|
|
const aiMatrix4x4 matrix = (aiMatrix4x4)absolute_transform;
|
|
const aiMatrix4x4 matrix = (aiMatrix4x4)absolute_transform;
|
|
|
|
|
|
bone->mOffsetMatrix = bone->mOffsetMatrix * matrix; // * mesh_offset
|
|
bone->mOffsetMatrix = bone->mOffsetMatrix * matrix; // * mesh_offset
|
|
-
|
|
|
|
|
|
+
|
|
//
|
|
//
|
|
// Now calculate the aiVertexWeights
|
|
// Now calculate the aiVertexWeights
|
|
//
|
|
//
|