Jump to content

[bug] Blender Exporter : wrong position of nested object instances


samlan
 Share

Recommended Posts

Hello,

 

If I export a scene containing nested instances of the same mesh/object (a tree of objects linked by a parent/child relashionship), and that I load the scene in BabylonJS, mesh positions are altered.

 

Cases that works:

- If I make every objects "single user", then it works fine.

- If objects are duplicated but not nested, it works too.

 

In the attachment, a Blender test scene with several layers :

- the first is a tree made of duplicated copies (data is not shared between instances).

- the second is a tree made of duplicated linked instances (same data shared by several object).

- the third one is just a linked duplicate of the same object.

 

The tested version of BabylonJS is 2.2.

testBabylonExportParenting.zip

Link to comment
Share on other sites

Thanks for coming with a test blend.  They take time.  I got it, but I do not have time today to look at it, but I suspect either 1 of 2 problems is occurring.

 

First, the instances version are being parented to the higher level original not the higher level instance, or second the timing of the parenting, then taking up initial position might be reversed for instances.  The 1st one can be detected looking at the .babylon file, if you would like to check.

Link to comment
Share on other sites

Did have a thought, (not a good one for you), a parent of a mesh instance is not even written into a babylon file.  Checked exporter source, afraid so. 

 

Went further to see if this was just a Blender omission.  Looking at the bottom of Mesh.Parse(), parent is never assigned, so it is more than just a Blender issue.  I need to investigate no further.  If you need to do this today, you are going to have to assign the parent yourself after load, then set the relative position.

Link to comment
Share on other sites

Ok thanks. Fortunely, the project I'm working on isn't relying heavily on instances. I'm using them more for having a quick workflow in Blender than for performances reasons in Babylon.

 

For now I will convert the meshes to single user, it's easier for me than altering the scene graph in Babylon. By the way, if someone wants to know how to do it fast in Blender :

 

hit "U" key -> Make single user -> Object+Data, and check "All meshes" in the side bar. Then, export to BabylonJS. Do not forget to CTRL+Z the changes before doing changes on your scene !

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...