Skip to content

Transform your 3D texturing workflow with the power of generative AI, directly within Blender!

fix generating for objects without a material

sakalondc709c843b3c1
diff --git a/stablegen/utils.py b/stablegen/utils.py
index f1a9874..c18703a 100644
--- a/stablegen/utils.py
+++ b/stablegen/utils.py
@@ -200,7 +200,7 @@ def get_last_material_index(obj):
if obj.data.materials:
for mat in obj.data.materials:
- if mat.use_nodes:
+ if mat and mat.use_nodes:
for node in obj.active_material.node_tree.nodes:
if node.type == 'MATH' and node.operation == 'SUBTRACT':
if node.inputs[0].default_value > highest_index: