We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Dealing with material library

Home Forums Programming Dealing with material library

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #74455
    David Duperron
    Customer

    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

    #74466

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

    #74468
    kdv
    Participant

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

    #74496
    David Duperron
    Customer

    Thanks 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?

    #74497
    kdv
    Participant

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

    #74514

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

    #74515
    kdv
    Participant

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

    #74533
    David Duperron
    Customer

    Thanks guys for these details.
    I will see what I can do to better manage my materials!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.