Jump to content

How to Import Mesh withoud adding it to the scene


Recommended Posts

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 ? 






Link to comment
Share on other sites


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.

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.

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.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...