Sign in to follow this  

Question objfileloader Multimaterial

Recommended Posts

I tried to import the obj file, and obj contained a number of posts, but in babylonjs, it seemed that each child's map was replaced with the last one.

I looked at the console, and the network window shows these stickers loaded.


Here's the demo:

The correct effect should be:







babylonjs:(The wrong)




Share this post

Link to post
Share on other sites

hi @renjianfeng,

the OBJ file you pasted has no group or object definitions (keys 'o' and 'g'), which prevents babylon from knowing which mesh is which. Babylon will use the entire vertex data you provided and will convert it to a single mesh with one material. is it possible for you to export mesh names as well? if you use blender, it is the option to export "Objects as OBJ Objects", or "Groups", both should actually work.


Share this post

Link to post
Share on other sites
9 hours ago, Deltakosh said:

If you are in Blender, why not directly using the .babylonjs format? It will be far better than obj

Yes, but all the models currently are in.obj format, and the number is very large. I can only use a method that can be used in batches.:(

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.