Sign in to follow this  
Followers 0
iTekVR

FbxExporter and materials

3 posts in this topic

Hi

I have many FBX files. Each FBX file has unique material names.

FbxExporter.exe converts these files to babylon files. The FBX material names go to babylon materials.name

But many babylon files contain materials with id value "45" ("id": "45"). It seems that FbxExporter.exe generates these id somehow by itself.

This is the reason why loading many babylon files to one (same) scene shows incorrecet colors.

Are there any ways to fix it?

Share this post


Link to post
Share on other sites

I don't know if there is a parameter you need to pass or something further up the chain you can do, but I think theoretically you could loop through your materials in the BABYLON.SceneLoader.Append/ImportMesh/Load callback and  assign them new ids based on the loop's current index or something. Another thing you can do is edit the Babylon JSON directly, but the major disadvantage to that is you have to do that all over again next time you re-export from your FBX. But, if you are confident you have the final versions then it is better to have the data correct in the JSON.

Anyway, those are a couple hacky ideas....stay tuned for someone who knows the real answer you are looking for.

Share this post


Link to post
Share on other sites
21 hours ago, jeremybyington said:

I don't know if there is a parameter you need to pass or something further up the chain you can do, but I think theoretically you could loop through your materials in the BABYLON.SceneLoader.Append/ImportMesh/Load callback and  assign them new ids based on the loop's current index or something. Another thing you can do is edit the Babylon JSON directly, but the major disadvantage to that is you have to do that all over again next time you re-export from your FBX. But, if you are confident you have the final versions then it is better to have the data correct in the JSON.

Anyway, those are a couple hacky ideas....stay tuned for someone who knows the real answer you are looking for.

Hi

thank you. I fixed the problem by loading babylon file from a server (XMLHttpRequest) / JSON.parse / change material ids / JSON.stringify / ImportMesh.

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  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.