Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bpy.ops.material.new()
- bpy.context.object.active_material.diffuse_color = (1, 0, 0)
- bpy.ops.material.new()
- bpy.data.materials.new(name="MaterialName")
- activeObject = bpy.context.active_object #Set active object to variable
- mat = bpy.data.materials.new(name="MaterialName") #set new material to variable
- activeObject.data.materials.append(mat) #add the material to the object
- bpy.context.object.active_material.diffuse_color = (1, 0, 0) #change color
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement