Add new IgnoreNodesScale option to skip skeleton nodes scale during import

This commit is contained in:
2026-04-14 09:05:31 +02:00
parent 330049d732
commit 3830267a1e
4 changed files with 9 additions and 0 deletions
@@ -227,6 +227,8 @@ void ProcessNodes(AssimpImporterData& data, aiNode* aNode, int32 parentIndex)
Matrix transform = ToMatrix(aNode->mTransformation);
transform.Decompose(node.LocalTransform);
if (data.Options.IgnoreNodesScale)
node.LocalTransform.Scale = Float3::One;
data.Nodes.Add(node);
// Process the children
@@ -416,6 +416,8 @@ void ProcessNodes(OpenFbxImporterData& data, const ofbx::Object* aNode, int32 pa
}
#endif
transform.Decompose(node.LocalTransform);
if (data.Options.IgnoreNodesScale)
node.LocalTransform.Scale = Float3::One;
data.Nodes.Add(node);
// Process the children
@@ -571,6 +571,7 @@ void ModelTool::Options::Serialize(SerializeStream& stream, const void* otherObj
SERIALIZE(Translation);
SERIALIZE(UseLocalOrigin);
SERIALIZE(CenterGeometry);
SERIALIZE(IgnoreNodesScale);
SERIALIZE(Duration);
SERIALIZE(FramesRange);
SERIALIZE(DefaultFrameRate);
@@ -627,6 +628,7 @@ void ModelTool::Options::Deserialize(DeserializeStream& stream, ISerializeModifi
DESERIALIZE(Translation);
DESERIALIZE(UseLocalOrigin);
DESERIALIZE(CenterGeometry);
DESERIALIZE(IgnoreNodesScale);
DESERIALIZE(Duration);
DESERIALIZE(FramesRange);
DESERIALIZE(DefaultFrameRate);
@@ -253,6 +253,9 @@ public:
// If checked, the imported geometry will be shifted to the center of mass.
API_FIELD(Attributes="EditorOrder(540), EditorDisplay(\"Transform\")")
bool CenterGeometry = false;
// If checked, the importer will ignore nodes scale property.
API_FIELD(Attributes = "EditorOrder(545), EditorDisplay(\"Transform\")")
bool IgnoreNodesScale = false;
public: // Animation