acoolrocket

Blender - Make all materials of selected object(s) alpha hashed

Mar 4th, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import bpy
  2.  
  3. # Check if there is an active object and if it has materials
  4. if bpy.context.object and bpy.context.object.material_slots:
  5. obj = bpy.context.object
  6.  
  7. # Iterate over all material slots in the selected object
  8. for slot in obj.material_slots:
  9. mat = slot.material
  10. if mat:
  11. # Assign blend_method HASHED to each material
  12. mat.blend_method = 'HASHED'
  13. else:
  14. print("No object selected or the selected object has no materials.")
Add Comment
Please, Sign In to add comment