Visam Posted January 7, 2017 Share Posted January 7, 2017 Hi I am using BABYLON.SceneLoader.ImportMesh to load the files ( https://www.dropbox.com/s/75q86impdtutlwz/test.zip?dl=0 ) to a scene. If I am importing only one file from the files list, everything works fine. I can see correct colour of each 3D model. But when I am loading all (6) files to the same(!) scene, I can see wrong colours. Why? Can somebody help me? Brg Mikhail Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 7, 2017 Share Posted January 7, 2017 BABYLON.SceneLoader.ImportMesh is made to load a single mesh and not several. You should use instead BABYLON.SceneLoader.Load or BABYLON.SceneLoader.Append Maybe that's your problem. Visam 1 Quote Link to comment Share on other sites More sharing options...
Visam Posted January 8, 2017 Author Share Posted January 8, 2017 11 hours ago, Dad72 said: BABYLON.SceneLoader.ImportMesh is made to load a single mesh and not several. You should use instead BABYLON.SceneLoader.Load or BABYLON.SceneLoader.Append Maybe that's your problem. I will try to explain my problem. I have several files. Each file contains a 3D model. Each model has meshes. Each mesh has a name. Finally, I need to have one scene which includes the several 3D models and each model has to have only one name to be picked by scene.pick. One file - one mesh - one name. How can I have it? Any ideas? Quote Link to comment Share on other sites More sharing options...
Visam Posted January 8, 2017 Author Share Posted January 8, 2017 16 hours ago, iTekVR said: Hi I am using BABYLON.SceneLoader.ImportMesh to load the files ( https://www.dropbox.com/s/75q86impdtutlwz/test.zip?dl=0 ) to a scene. If I am importing only one file from the files list, everything works fine. I can see correct colour of each 3D model.But when I am loading all (6) files to the same(!) scene, I can see wrong colours. Why? Can somebody help me? Brg Mikhail the colours distribution between meshes are different each loading time. 3D model files are the same. loading meshes order is the same. but results are different: Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 8, 2017 Share Posted January 8, 2017 Your model must be merged into one to use ImportMesh (). If your models are detached into multiple pieces, you must use Load () or Append () and you can use pick () on your piece of your model. Visam 1 Quote Link to comment Share on other sites More sharing options...
Visam Posted January 8, 2017 Author Share Posted January 8, 2017 11 hours ago, Dad72 said: Your model must be merged into one to use ImportMesh (). If your models are detached into multiple pieces, you must use Load () or Append () and you can use pick () on your piece of your model. Can I move a mesh from one scene to another scene, if both scenes will be created for the same engine? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 9, 2017 Share Posted January 9, 2017 Yes. Quote Link to comment Share on other sites More sharing options...
Visam Posted January 9, 2017 Author Share Posted January 9, 2017 9 hours ago, Dad72 said: Yes. may be it is a stupid question, but what is the best way to move a mesh from one scene to another scene? I am trying, but have some problems. May be I will fix it by myself even before you answer to my question :-) Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 9, 2017 Share Posted January 9, 2017 with BABYLON.scenes[] Example of changing objects from scene to scene. http://playground.babylonjs.com/#2AEEZ4#2 Quote Link to comment Share on other sites More sharing options...
Visam Posted January 20, 2017 Author Share Posted January 20, 2017 On 08/01/2017 at 0:06 AM, Dad72 said: BABYLON.SceneLoader.ImportMesh is made to load a single mesh and not several. You should use instead BABYLON.SceneLoader.Load or BABYLON.SceneLoader.Append Maybe that's your problem. I am using Load and then Append... same problem with colours as I described here Quote Link to comment Share on other sites More sharing options...
gryff Posted January 20, 2017 Share Posted January 20, 2017 @iTekVR: Well I downloaded your files and took a look at them. I'm used to creating my .babylon files in Blender, so I'm really used to the format in your files - though it looks like they are derived from AutoCad initially. Anyway things that seem odd to me - using file 28.babylon as an example: 1. The materials. "materials":[ {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"51","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"52","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"53","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"54","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"55","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"56","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"57","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"58","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false} ], You are defining 8 materials by id, but they all have the same material name, and they, in fact they are all identical apart from the id . I looked at two more of your files and there is the same issue. 2. Mesh materialId. I then did a search of the file for materialId - to see what materials the meshes were using - again 28.babylon as an example: "materialId":"42_Polygon Mesh" ... "materialId":"43_Polygon Mesh" ... "materialId":"44_Polygon Mesh" ... "materialId":"45_Polygon Mesh" ... The materials associated with the meshes bear no resemblance to the materials listed above. Same issue with the two other files I looked at. So to me, and my Blender approach, there is an issue with the methods you are using to create these files. I don't know if that will help - hope it does cheers, gryff Visam 1 Quote Link to comment Share on other sites More sharing options...
Visam Posted January 21, 2017 Author Share Posted January 21, 2017 14 hours ago, gryff said: @iTekVR: Well I downloaded your files and took a look at them. I'm used to creating my .babylon files in Blender, so I'm really used to the format in your files - though it looks like they are derived from AutoCad initially. Anyway things that seem odd to me - using file 28.babylon as an example: 1. The materials. "materials":[ {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"51","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"52","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"53","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"54","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"55","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"56","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"57","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false}, {"alpha":1,"ambient":[1,0,0],"backFaceCulling":true,"diffuse":[1,0,0],"emissive":[0,0,0],"id":"58","name":"AutoCAD Color Index 1","specular":[0,0,0],"specularPower":0.011999999172985554,"wireframe":false} ], You are defining 8 materials by id, but they all have the same material name, and they, in fact they are all identical apart from the id . I looked at two more of your files and there is the same issue. 2. Mesh materialId. I then did a search of the file for materialId - to see what materials the meshes were using - again 28.babylon as an example: "materialId":"42_Polygon Mesh" ... "materialId":"43_Polygon Mesh" ... "materialId":"44_Polygon Mesh" ... "materialId":"45_Polygon Mesh" ... The materials associated with the meshes bear no resemblance to the materials listed above. Same issue with the two other files I looked at. So to me, and my Blender approach, there is an issue with the methods you are using to create these files. I don't know if that will help - hope it does cheers, gryff thank you! 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.