CHIMAIRA Posted October 8, 2017 Share Posted October 8, 2017 Hello everyone, I have two questions about the SceneLoader.ImportMesh() function. 1- Does it import objects including their materials or should we do it by ourselves in the callback body ? I tried importing object from a babylon file (generated with 3DsMax plugin including materials) but the Mesh in babylon scene has no mateiral ! 2- The meshes are added automatically to the scene (given as an argument to the importScene function). But I wish to import the objects and then have the control to add the desired mesh with Scene.addMesh(newMesh) Is that possible ? Thanks A. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted October 8, 2017 Share Posted October 8, 2017 Hi @CHIMAIRA As for material, are you sure the material is supported by BJS and the 3ds max exporter? Any console errors? As for imported mesh, Simply "add" the newMesh to a predefined variable, array or object. In import code; Hide or disable mesh. When you need the mesh, un-hide/un-disable or clone or instance it via the predefined var/array/obj PG example; http://playground.babylonjs.com/#PR5SWB#1 (Wait for skull to load, might take a few moments, click on canvas to enable/disable.) if you un-comment line 16, the skull will be disabled on scene load. GameMonetize 1 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.