acoolrocket

Blender - Copy BSDF specular to all material slots

Jan 18th, 2024
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import bpy
  2.  
  3. for obj in bpy.context.selected_objects:
  4. if obj.type == 'MESH':
  5. for slot in obj.material_slots:
  6. # Check if the material has a node tree
  7. if slot.material and slot.material.node_tree:
  8. principled_node = slot.material.node_tree.nodes.get("Principled BSDF")
  9.  
  10. if principled_node:
  11. # Set values for the Principled BSDF shader
  12. principled_node.inputs[2].default_value = 1 # Roughness
  13. principled_node.inputs[1].default_value = 1 # Metallic
Add Comment
Please, Sign In to add comment