Jump to content

Babylon js Instance and materials export from 3dsmax


Pab144
 Share

Recommended Posts

Hey guys,

Love babylonjs, been using it to create arch-viz products and it's great.

My questions is:

I'm exporting from 3dsmax a scene that contains 4 specific house models each with specific materials, then I instanced the houses all over the map and changed the material on specific houses according to their location relative to my sunlight(directional light). I did this so that I could  use different ambient maps for the different houses.

My issue is that all the instances are exported with the same material even though some have a different material, example ; I want the  mesh for House-South-1 to have material of House-South-1, and House-North-1 to have  material House-North-1, but all the instances of the mesh are exported with the same material.

Thanks,

Link to comment
Share on other sites

We have the same or a similar problem here.

And in 3ds those are not instances, but completely independant meshes with their own textures.

Once we try to export them, only one material will get exported and all the meshes will have this material.

Where could the problem be located?

Link to comment
Share on other sites

Okay, so I followed @Deltakosh advice and did the following to get it to work.

They key is to have a UNIQUE copy of the mesh you are going to instance for each different material, so if you have Mesh-1(UNIQUE) and apply Material-1 you can then instance this mesh as many times as needed, as long as the instances are being made from a UNIQUE copy of the original mesh you should be able to have for example 4 meshes that are exact copies or clones of each other with different materials and then instance those copies with their different materials being preserved at export time. 

It worked for me. I hope it helps @RedMax .

 

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