Fix glTF import when a mesh node has children.
This commit is contained in:
parent
ca3fd182b0
commit
608d6b896d
@ -943,15 +943,19 @@ OV.ImporterGltf = class extends OV.ImporterBase
|
|||||||
node.SetTransformation (GetNodeTransformation (gltfNode));
|
node.SetTransformation (GetNodeTransformation (gltfNode));
|
||||||
parentNode.AddChildNode (node);
|
parentNode.AddChildNode (node);
|
||||||
|
|
||||||
if (gltfNode.mesh !== undefined) {
|
if (gltfNode.children !== undefined) {
|
||||||
node.SetType (OV.NodeType.MeshNode);
|
|
||||||
node.AddMeshIndex (gltfNode.mesh);
|
|
||||||
} else if (gltfNode.children !== undefined) {
|
|
||||||
for (let childIndex of gltfNode.children) {
|
for (let childIndex of gltfNode.children) {
|
||||||
let childGltfNode = gltf.nodes[childIndex];
|
let childGltfNode = gltf.nodes[childIndex];
|
||||||
this.ImportNode (gltf, childGltfNode, node);
|
this.ImportNode (gltf, childGltfNode, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gltfNode.mesh !== undefined) {
|
||||||
|
if (gltfNode.children === undefined || gltfNode.children.length === 0) {
|
||||||
|
node.SetType (OV.NodeType.MeshNode);
|
||||||
|
}
|
||||||
|
node.AddMeshIndex (gltfNode.mesh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetReaderFromBufferView (bufferView)
|
GetReaderFromBufferView (bufferView)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user