hw3web Posted March 5, 2014 Share Posted March 5, 2014 Hi There is there any one realize that if you load some .babylon file with multi material mesh , and then add mesh to this scene by import next multi material mesh from another .babylon, second loaded mesh will take material from multi material loaded on beginning. It is happen because of tag: "materialId":"Multimaterial#0" in . babylon file - is there any chance Multimaterial ID will be created as dynamic name in Blender Exporter : maybe number of milliseconds - epoch time , that it will be each time different and at least will be not repeated ,or as combine name of sub material : mat1 + mat2 + mat3 => Multi#mat1mat2mat3 by now I must go and edit .babylon files to give them individual names just to no repate it self thank you Python line in Blender Exporter 601 : multimat.name = "Multimaterial#" + str(len(multiMaterials)) I do not want mess with it as I prefer that it will be done and share with all users BabylonJS Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 6, 2014 Share Posted March 6, 2014 THe problem is that we must keep the same name between different exports Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 6, 2014 Share Posted March 6, 2014 I changed to this stuff: multimat.name = "Multimaterial#" + str(len(multiMaterials)) multimat.materials = [] Export_babylon.write_string(file_handler, "materialId", multimat.name) for mat in object.material_slots: multimat.materials.append(mat.name)multimat.name = multimat.name + "-" + mat.name Quote Link to comment Share on other sites More sharing options...
hw3web Posted March 6, 2014 Author Share Posted March 6, 2014 will you change on https://github.com please, that everyone could benefit from your improvements Thank you again for great stuff Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 6, 2014 Share Posted March 6, 2014 I will. Next release coming soon Quote Link to comment Share on other sites More sharing options...
hw3web Posted March 31, 2014 Author Share Posted March 31, 2014 Hi there I just wonder that new version Blender explorer out and still this same with multi-material , just please keep changes as when other people change this will be lost Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 1, 2014 Share Posted April 1, 2014 I do not understand. The change is online:multimat.name = "Multimaterial#" + str(len(multiMaterials)) multimat.materials = [] Export_babylon.write_string(file_handler, "materialId", multimat.name) for mat in object.material_slots: multimat.materials.append(mat.name) multiMaterials.append(multimat) Quote Link to comment Share on other sites More sharing options...
hw3web Posted April 1, 2014 Author Share Posted April 1, 2014 is that multimat.name = "Multimaterial#" + str(len(multiMaterials)) not mean the name of multimaterial will be : Multimaterial#(number) and if you loading few meshes from different babylon files where all will be only one multi-texture all of them will be Multimaterial#0 and last or first one will decide upon the rest material . ? solution it could be to add: import time and then replace : multimat.name = "Multimaterial#" + str(len(multiMaterials)) with multimat.name = "Multimaterial#" + str(math.floor(time.time())) I did it and it is working fine, but I would it will be helping everyone . Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 1, 2014 Share Posted April 1, 2014 Yes but we need some predictability here: each exportation must generate the same file Quote Link to comment Share on other sites More sharing options...
hw3web Posted April 1, 2014 Author Share Posted April 1, 2014 but we set this way just multi-material name that must be individual for specific mesh. problem with other is when you load more then one multi material mesh from different Babylon file , if all of them has only one multi material mesh then all multimaterial names will be Multimaterial#0 , so if in first babylon file we have sphere(half white half black) and in second box ( half red half blue) we will have sphere and box half black half white Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.