ProfessorF Posted December 31, 2013 Share Posted December 31, 2013 Okay, so I exported a house interior created in Maya using FBX Exporter. This is what the scene looks like in Babylon.js: I use scene.pick to select objects in the room for turning on and off (like lights). Problem: *everything* I select is named: #0 or #N (where N is 0,1, 2...) For example, if I click on the TV and use picked = scene.pick(...) to get the mesh, then picked.pickedMesh.name is "#0" Solution: To get the actual name of the mesh, I need to do: picked.pickedMesh.parent.name, which returns "TV_A", which is correct. DIGGING The culprit is in the XNAExporter.cs. A dummy mesh is created with the correct name TV_A, but then the actual meshes are created with the names: #0, #1, etc... Here is the line that does it: mesh.AddPart(indexName.ToString(), vertices.ToList(), indices.Select(i => (int)i).ToList()); This line is in two places, BUT if this were changed to: mesh.AddPart(modelMesh.Name+"#"+ indexName.ToString(), vertices.ToList(), indices.Select(i => (int)i).ToList()); Then scene.pick could return TV_A#0, TV_A#1, etc. <== This is easier to check than having to go to the parent. QUESTIONS 1) Does the Blender exporter have the same behavior? If so, I think that should be changed too.2) Could you change the code in XNAExporter.cs (two places) to pre-pend the mesh name before the #N? Thanks, - Nick Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 31, 2013 Share Posted December 31, 2013 Hello 1. No Blender has no problem with sub parts so names are kept 2. Sure, but I have a better idea to thank you correctly: why don't you create a pull request on the github in order to be added to contributors ?? Quote Link to comment Share on other sites More sharing options...
ProfessorF Posted December 31, 2013 Author Share Posted December 31, 2013 Thanks! haha, okay. Hold on... Okay I created a pull request. What a hassle! Windows github wasn't working so I had to learn the command line github... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 2, 2014 Share Posted January 2, 2014 I saw it, thank you very muchAs soon as I get back from holidays, I will validate it 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.