Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. bpy.ops.material.new()
  2. bpy.context.object.active_material.diffuse_color = (1, 0, 0)
  3.  
  4. bpy.ops.material.new()
  5.  
  6. bpy.data.materials.new(name="MaterialName")
  7.  
  8. activeObject = bpy.context.active_object #Set active object to variable
  9. mat = bpy.data.materials.new(name="MaterialName") #set new material to variable
  10. activeObject.data.materials.append(mat) #add the material to the object
  11. bpy.context.object.active_material.diffuse_color = (1, 0, 0) #change color
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement