Jump to content

Apply parent of instance with .babylon file


Pierre Glibert
 Share

Recommended Posts

Hello people,

I had a good conversation with @JCPalmer. I asked him if he could add parent variable for instance in .babylon file and he did it.

you can read it here : 

 

At the moment, the fileloader do not apply the right parent but always the same parent of original mesh.

I will try to find solution for the babylon fileloader read parent for instance and apply this ;)

My idea >

Add this in mesh file :

// Instances
if (parsedMesh.instances) {
...

  if (parsedInstance.parentId) {
    instance._waitingParentId = parsedInstance.parentId;
  }

...
}

 

Because in fileLoader, this code allready exist and all instances are in "meshes" array : 

// Connect parents 
for (index = 0, cache = scene.meshes.length; index < cache; index++) {
  var mesh = scene.meshes[index];
  if (mesh._waitingParentId) {
    mesh.parent = scene.getLastEntryByID(mesh._waitingParentId);
    mesh._waitingParentId = undefined;
  }
  
  ...
}

 

What do you think @Deltakosh?

Have a nice day,

Letsbro studio team.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...