samlan Posted November 28, 2015 Share Posted November 28, 2015 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 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 30, 2015 Share Posted November 30, 2015 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. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted November 30, 2015 Share Posted November 30, 2015 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. Quote Link to comment Share on other sites More sharing options...
samlan Posted December 2, 2015 Author Share Posted December 2, 2015 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 ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.