Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- base_color_hex = (0.01, 0.01, 0.01, 1.0) # RGBA values for 282828 in Blender
- for obj in bpy.context.selected_objects:
- if obj.type == 'MESH':
- for slot in obj.material_slots:
- # Check if the material has a node tree
- if slot.material and slot.material.node_tree:
- principled_node = slot.material.node_tree.nodes.get("Principled BSDF")
- if principled_node:
- # Set base color to 282828
- principled_node.inputs[0].default_value = base_color_hex
Add Comment
Please, Sign In to add comment