Skip to content

Commit

Permalink
[Fix] Fix to recent change to RenderComponent.rootBone when instantia…
Browse files Browse the repository at this point in the history
…ting glb container (#7215)

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Dec 19, 2024
1 parent 577c14c commit 00692fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framework/parsers/glb-container-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ class GlbContainerResource {
if (attachedMi) {
entity.addComponent('render', Object.assign({
type: 'asset',
meshInstances: attachedMi,
rootBone: root
meshInstances: attachedMi
}, options));

// assign asset id without recreating mesh instances which are already set up with materials
Expand All @@ -189,6 +188,7 @@ class GlbContainerResource {
// now that the hierarchy is created, create skin instances and resolve bones using the hierarchy
skinnedMeshInstances.forEach((data) => {
data.meshInstance.skinInstance = SkinInstanceCache.createCachedSkinInstance(data.meshInstance.mesh.skin, data.rootBone, data.entity);
data.meshInstance.node.render.rootBone = data.rootBone;
});

// return the scene hierarchy created from scene clones
Expand Down

0 comments on commit 00692fb

Please sign in to comment.