Jump to content

Problem with multimaterial export from blender


mandim
 Share

Recommended Posts

Hello,

I'm having an issue when trying to import a blender model (i.e. .babylon). I have created a simple bottle in blender with multimaterials (3 colors) and export it to .babylon. Here is the snippet code:

var bottleMeshTask = assetsManager.addMeshTask("BottleTask", "Bottle", "assets/Bottle/", "bottle.babylon");
                bottleMeshTask.onSuccess = function (task) {
                    console.log(task);
                    bottle = BABYLON.Mesh.MergeMeshes(task.loadedMeshes, true, true, null);
                    bottle.position.z = -150;
                    bottle.position.y = 0;
                    bottle.position.x = 10;
                    bottle.rotation.z = Math.PI / 2.0;
                    bottle.scaling = new BABYLON.Vector3(0.3, 0.3, 0.3);
                    console.log(bottle);
                    
                };
                bottleMeshTask.onError = function (task, message, ex) {
                    console.log(message, ex);
                }

                assetsManager.load();

 

The problem is that when I insert the asset using the addMeshTask(...) it only shows the top first material.

Any ideas?

bottle.babylon

bottle.blend

Link to comment
Share on other sites

3 hours ago, RaananW said:

Seems like the multimaterial is defined ("multiMaterials":[{"name":"bottle.Multimaterial#0","id":"bottle.Multimaterial#0","materials":["bottle.White","bottle.Blue","bottle.Red"]}]) but it is missing a few parameters. 

What material is applied to the mesh?

Actually only the white material is being applied.

Link to comment
Share on other sites

3 hours ago, JCPalmer said:

I checked the .babylon in the sandbox, and it loads fine from there.  I see no problem in what Blender produces.

I know that in sandbox its loading fine. That's why I created this topic. Is it possible to load the .babylon in the playground and how?

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