Fix creating bone data for non-bones
(cherry picked from commit 8d1bdd1456e70e4efc47aa36dce660bc91e7dfcf)
This commit is contained in:
@@ -97,7 +97,7 @@ namespace AZ
|
||||
EnumChildren(scene, child, mainBoneList, boneLookup);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma optimize("", off)
|
||||
Events::ProcessingResult AssImpBoneImporter::ImportBone(AssImpNodeEncounteredContext& context)
|
||||
{
|
||||
AZ_TraceContext("Importer", "Bone");
|
||||
@@ -112,11 +112,11 @@ namespace AZ
|
||||
|
||||
bool isBone = false;
|
||||
|
||||
if (NodeParentIsOfType(context.m_scene.GetGraph(), context.m_currentGraphPosition, DataTypes::IBoneData::TYPEINFO_Uuid()))
|
||||
{
|
||||
isBone = true;
|
||||
}
|
||||
else
|
||||
//if (NodeParentIsOfType(context.m_scene.GetGraph(), context.m_currentGraphPosition, DataTypes::IBoneData::TYPEINFO_Uuid()))
|
||||
//{
|
||||
// isBone = true;
|
||||
//}
|
||||
//else
|
||||
{
|
||||
AZStd::unordered_map<AZStd::string, const aiNode*> mainBoneList;
|
||||
AZStd::unordered_map<AZStd::string, const aiBone*> boneLookup;
|
||||
@@ -171,11 +171,22 @@ namespace AZ
|
||||
createdBoneData = AZStd::make_shared<SceneData::GraphData::RootBoneData>();
|
||||
}
|
||||
|
||||
// L_Lower_Eyelid_Jnt_01
|
||||
if (context.m_sourceNode.GetName() == AZStd::string("L_Lower_Eyelid_Jnt_01"))
|
||||
{
|
||||
//__debugbreak();
|
||||
}
|
||||
|
||||
AZStd::vector<DataTypes::MatrixType> transforms;
|
||||
aiMatrix4x4 transform = currentNode->mTransformation;
|
||||
const aiNode* parent = currentNode->mParent;
|
||||
|
||||
|
||||
auto addTrans = [&](auto mat) { transforms.push_back(AssImpSDKWrapper::AssImpTypeConverter::ToTransform(mat)); };
|
||||
addTrans(transform);
|
||||
|
||||
while (parent)
|
||||
{
|
||||
addTrans(parent->mTransformation);
|
||||
transform = parent->mTransformation * transform;
|
||||
parent = parent->mParent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user