1
0
mirror of https://github.com/drewcassidy/TexTools-Blender synced 2024-09-01 14:54:44 +00:00

Merge pull request #1 from taniwha/find_texture_fix

Update texture slot check for blender 2.80+
This commit is contained in:
Andrew Cassidy 2020-05-01 13:53:15 -07:00 committed by GitHub
commit 48553aff52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,9 +54,10 @@ def get_object_texture_image(obj):
if slot_mat.material:
# Check for traditional texture slots in material
for slot_tex in slot_mat.material.texture_paint_slots:
if slot_tex and slot_tex.texture and hasattr(slot_tex.texture , 'image'):
return slot_tex.texture.image
if slot_mat.material.texture_paint_images:
active_slot = slot_mat.material.paint_active_slot
if slot_mat.material.texture_paint_images[active_slot]:
return slot_mat.material.texture_paint_images[active_slot]
# Check if material uses Nodes
if hasattr(slot_mat.material , 'node_tree'):