Jump to content

SceneLoader.ImportMesh creates a new scene ?!


Vousk-prod.
 Share

Recommended Posts

Heyo,

 

I'm trying to mix some .babylon files together in the same scene so they can interact together...

 

The first file creates the BJS scene with SceneLoader.Load, then I would have tought that SceneLoader.ImportMesh with the second file updates the existing scene with new meshes, but in fact it creates a new BJS scene...

 

Am I missing something or this is the expected behavior ?

 

How can I add many new meshes from different .babylon files to one unique same (without creating 2 scenes then manually copying everything from one to other) ?

Link to comment
Share on other sites

Vousk-prod, you might want to take a look at this example of mine:

 

Desk and Book

 

Here is some of the code:

BABYLON.SceneLoader.Load("https://dl.dropboxusercontent.com/u/70260871/webgl/desk/", "desk_drawers3b_anim4_6retex4e.babylon", engine, function (newScene) {                           newScene.executeWhenReady(function () {                newScene.activeCamera.attachControl(canvas);                mySkeleton[0] = newScene.getSkeletonById(0);                                                        BABYLON.SceneLoader.ImportMesh(null, "https://dl.dropboxusercontent.com/u/70260871/webgl/desk/", "newbook4_4b1.babylon", newScene, function (newMeshes, particleSystems, skeletons) {                book = newMeshes[0];                mySkeleton[1] = skeletons[0];

Both "Load" and "ImportMesh" use the same scene "newScene"

 

cheers, gryff :)

 

Edit: too late!! :o

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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