Grim-es / material-combiner-addon

Blender addon for material combining, uv bounds fixing
MIT License
447 stars 34 forks source link

I can't merge materials #98

Open zzwzzw12345 opened 1 month ago

zzwzzw12345 commented 1 month ago

I use it to merge materials and it just makes all the materials the first material (the top one in the selection) I don't know what's wrong with me, even if I switch my language to English, I don't know what I'm supposed to do. Can I choose where to save the material? ![image](https://github.com/Grim-es/material-combiner-addon/assets/163805519/938b7d93-f008-416b-be88-d69d37cd9e05 5 3~~OC$TCQH$ZRZ19F U0Q Before merging materials 8LAH1W1_FPCPFDRXN7)~7R6 After merging materials

zzwzzw12345 commented 1 month ago

There are no changes to the material I've tried both 3.3.16 and 3.6.9 with this issue

Grim-es commented 1 month ago

When using materials with the same image in their Image Texture node, the materials will merge instead of being atlased. Or, if the proper image is not found, they will default to the color property, which, if the same, will also merge materials. To ensure proper functionality, make sure the shader you're using is listed in the supported shaders in utils/materials.py, and that the name property is in English and matches exactly as listed in that file.

The easiest will be using the Diffuse BSDF shader with a name property set to Diffuse BSDF. Then, directly connect the image intended for the atlas to the shader using an Image Texture node with its name property set to Image Texture. To verify the name property of nodes, select the node and press the 'N' key on keyboard to open a small right-side panel displaying that data.

Note that simply changing Blender to English will not automatically rename already imported or saved nodes. It will be necessary to manually rename them or reimport the model from the beginning.

So, combined materials either use the same texture (which you can export by pressing File > External Data > Unpack files to current directory), or have the name property and shader not match the pre-hardcoded listed ones, and their texture is not used in the atlasing process.