Skip to content
Snippets Groups Projects
Commit 36a8b39d authored by Philipp Oeser's avatar Philipp Oeser
Browse files

Fix T41871: F2 addon throws error if there is a material slot with no

material assigned to it

Reviewed By: sergey
parent 3d5cd195
No related branches found
Tags
No related merge requests found
...@@ -50,6 +50,7 @@ def get_uv_layer(ob, bm, mat_index): ...@@ -50,6 +50,7 @@ def get_uv_layer(ob, bm, mat_index):
uv = me.uv_textures.active.name uv = me.uv_textures.active.name
else: else:
mat = ob.material_slots[mat_index].material mat = ob.material_slots[mat_index].material
if mat is not None:
slot = mat.texture_slots[mat.active_texture_index] slot = mat.texture_slots[mat.active_texture_index]
if slot and slot.uv_layer: if slot and slot.uv_layer:
uv = slot.uv_layer uv = slot.uv_layer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment