acoolrocket

Blender - Replace materials with .001 (For Alembic workflow)

Dec 10th, 2025 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import bpy
  2.  
  3. for obj in bpy.data.objects:
  4. if obj.type != "MESH":
  5. continue
  6.  
  7. for slot in obj.material_slots:
  8. mat = slot.material
  9. if not mat:
  10. continue
  11.  
  12. src_name = mat.name
  13. target_name = src_name + ".001"
  14.  
  15. target_mat = bpy.data.materials.get(target_name)
  16. if target_mat:
  17. slot.material = target_mat
Advertisement
Add Comment
Please, Sign In to add comment