mesh = bpy.data.meshes['Cube']
obj = bpy.data.objects.new("copy", mesh)
bpy.context.scene.objects.link(obj)
obj.location = (0,0,3)
obj.material_slots[0].material = bpy.data.materials['red']
|
Blender python API quick-start
Syntax highlighting by Pygments.