Grim-es / material-combiner-addon

Blender addon for material combining, uv bounds fixing
MIT License
450 stars 36 forks source link

Atlas won't generate, materials don't actually combine, textures get reassigned, all materials are Principled BDSF #52

Closed TacticalNerd1963 closed 10 months ago

TacticalNerd1963 commented 1 year ago

So my model has 6 materials. As I'm trying to create an atlas for these materials, I keep seeing no atlas generated, I STILL have 6 materials, and the textures are looking... odd. The python traceback error I'm getting is as follows-

Python: Traceback (most recent call last): File "C:\Users\patri\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\material-combiner-addon-master\operators\combiner\combiner.py", line 33, in execute assign_comb_mats(scn, self.data, self.mats_uv, atlas) File "C:\Users\patri\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\material-combiner-addon-master\operators\combiner\combiner_ops.py", line 277, in assign_comb_mats comb_mats = get_comb_mats(scn, atlas, mats_uv) File "C:\Users\patri\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\material-combiner-addon-master\operators\combiner\combiner_ops.py", line 241, in get_comb_mats existedids = [int(i.mat.name.split('')[-2]) for i in scn.smc_ob_data if (i.type == 1) and File "C:\Users\patri\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\material-combiner-addon-master\operators\combiner\combiner_ops.py", line 241, in existedids = [int(i.mat.name.split('')[-2]) for i in scn.smc_ob_data if (i.type == 1) and ValueError: invalid literal for int() with base 10: 'atlas'

Before and after screenshots are posted. A little help here? unknown1 unknown

Grim-es commented 1 year ago

Hello, looks like you are not have your textures unpacked, more info here. You could also try the dev build that is not require pillow library and uses another method of finding the right texture Download.

TacticalNerd1963 commented 1 year ago

Hello, looks like you are not have your textures unpacked, more info here. You could also try the dev build that is not require pillow library and uses another method of finding the right texture Download.

When I go to File>External Data>Unpack resources it says "No packed files to unpack," so the textures are definitely fine. I also tried the dev build to combine the textures but I'm getting the exact same results

Mysteryem commented 1 year ago

Rename your materials so that they don't start with material_atlas_, that should fix the Python error.

In particular, it's probably the material_atlas_low and material_atlas_hi, since material combiner is expecting their names to be of the format material_atlas_<unique_number>_<layer_number>. Due to them only having two _ in them, the code that tries to get the <unique number> instead gets atlas, which it tries to convert into an integer and fails with this error.