franMarz / TexTools-Blender

TexTools is a UV and Texture toolset created several years ago for Blender and Max by @renderhjs. In this open repository, originally created by @SavMartin, we develop the current version of this popular Blender add-on.
Other
2.02k stars 138 forks source link

Can't bake Material ID #184

Closed AspectofMaokai closed 9 months ago

AspectofMaokai commented 9 months ago

When i want to bake the material ID, it deselects everything and gives me this error message

Python: Traceback (most recent call last): File "C:\Users\PC\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\TexTools-Blender-master\op_bake.py", line 192, in execute bake( File "C:\Users\PC\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\TexTools-Blender-master\op_bake.py", line 315, in bake tiles.append( utilities_uv.get_UDIM_tiles( bset.objects_low ) ) File "C:\Users\PC\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\TexTools-Blender-master\utilities_uv.py", line 255, in get_UDIM_tiles nodes = slot.material.node_tree.nodes AttributeError: 'NoneType' object has no attribute 'nodes'

franMarz commented 9 months ago

I understand you're using the latest TexTools release and you're on Windows. Could you upload the blendfile or a simplified version of it that still fails, with the selection you have before pressing the bake button?

chromosthete commented 9 months ago

having the exact same issue with the exact same error. tried a fresh blender install and new file and everything and still getting it. even tried it on a different computer and got the same thing. using the latest main release of blender.

franMarz commented 9 months ago

I don't know how are you managing to trigger this error since all materials use nodes now even if the use_nodes option is set to False. I've just committed a possible fix, can any of you uninstall your current textools add-on and install the latest version from master, then test if this issue is gone and share the results here?

AspectofMaokai commented 9 months ago

i uninstalled nad installed the the tool but now i cant assign the colors even when i made separate materials for each side of a cube obrázek_2024-02-12_174610513 and when i press the "cube" button i get his error message

Python: Traceback (most recent call last): File "C:\Users\PC\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\TexTools-Blender-master__init__.py", line 429, in execute bpy.ops.object.select_all(action='DESELECT') File "C:\Program Files\Blender Foundation\Blender 3.5\3.5\scripts\modules\bpy\ops.py", line 113, in call ret = _op_call(self.idname_py(), None, kw) RuntimeError: Operator bpy.ops.object.select_all.poll() failed, context is incorrect

franMarz commented 9 months ago

So the original issue is now fixed. If I understood you correctly, you don't get the colors assigned with Color ID or other method rendered in the Material ID bake. That is normal, the original design of the utility is like this: Material ID assign a unique, random color to each material in the scene. Some bugs made the tool behave not like that, but they were fixed recently. To get the same colors you have in your object baked, use Diffuse or Base Color baking modes. Watch out with the color space of the baked image. The other issue regarding selecting bake sets should be fixed now in master. If any other problem arises, please open a new issue.