Advertisement
metalx1000

Blender Python Create Cube and add Material

Jan 28th, 2024
1,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. bpy.ops.mesh.primitive_cube_add(enter_editmode=False, align='WORLD', location=(9,15, 0), scale=(.5, .5, .5))
  2. mat = bpy.data.materials.new('material_TEST1')
  3. mat.use_nodes = True
  4. bpy.data.materials["material_TEST1"].node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.4601, 0.228801, 0.450716, 1)
  5. bpy.context.object.active_material = mat
  6.  
  7.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement