Home › Forums › Programming › Dealing with material library
- This topic has 7 replies, 3 voices, and was last updated 5 months, 2 weeks ago by David Duperron.
-
AuthorPosts
-
2024-05-31 at 9:06 am #74455David DuperronCustomer
Hi,
It’s not very clear to me how the materials are handled when integrating objects in a scene.
I have a main scene with objects and material assigned to them. These materials come from a material library blender file. Everything works fine and look as it should, no problem with the materials themselves.
I now add objects in my scene by appending other gltf files (basically one single object). The appended object use the same blender material library. Again, the Objects look exactly as they should. However I am not sure that the material are not “duplicated” in the 3D scene at the end of the day.
Is there a way to use the same material as the one in the main scene when importing a new object in this scene? Perhaps checking in the import process if the material already exists and then replacing it? And if so, how about objects with several material slots in Blender?
That’s a lot of question but I’m sure it will help me better understand the material handing between Blender and WeBGL.
Thanks for the help in advance;David
2024-05-31 at 12:05 pm #74466Mikhail LuzyaninStaffYou can link materials into object not append them from library then on export they will rendered as one material, not duplicated. To assign new material on multimaterial object you will need to separate it on parts in blender so each part will have only one material. Unfortunately it’s the only way. If you append scenes into one scene from multiple GLTF files then better to have materials in main scene and append them on new appended objects to be sure they are not dublicated.
Co-founder and lead graphics specialist at Soft8Soft.
2024-05-31 at 4:16 pm #74468kdvParticipantadd objects in my scene by appending other gltf files
However I am not sure that the material are not “duplicated”
They are duplicated in appended scenes. You’ll have to re-assign materials like described above.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-06-02 at 8:30 am #74496David DuperronCustomerThanks for these answers!
Materials were already linked from the library, not appended.
@kdv if I use your plugin is it possible to keep only one object and reassign materials event if there are several slots?2024-06-02 at 8:37 am #74497kdvParticipantis it possible to keep only one object
Have no idea what you are talking about.
reassign materials even if there are several slots?
yes, it supports multi-materual objects.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-06-03 at 9:35 am #74514Mikhail LuzyaninStaffif I use your plugin is it possible to keep only one object and reassign materials event if there are several slots?
You can’t assign material to slot, only to an object fully replace materials on it if it have several slots with different materials.
Co-founder and lead graphics specialist at Soft8Soft.
2024-06-03 at 10:30 am #74515kdvParticipantYou can’t assign material to slot
This puzzle can do it.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2024-06-04 at 9:16 am #74533David DuperronCustomerThanks guys for these details.
I will see what I can do to better manage my materials! -
AuthorPosts
- You must be logged in to reply to this topic.