Duplicate(mesh=0,
surface=0,
curve=0,
text=0,
metaball=0,
armature=0,
lamp=0,
material=0,
texture=0,
ipo=0)
| source code
|
Duplicate selected objects on visible layers from Blenders current
scene, de-selecting the currently visible, selected objects and making a
copy where all new objects are selected. By default no data linked to the
object is duplicated; use the keyword arguments to change this. Object.GetSelected() will return the list of objects
resulting from duplication.
Note: This command will raise an error if used from the command
line (background mode) because it uses the 3D view context.
- Parameters:
mesh (bool) - When non-zero, mesh object data will be duplicated with the
objects.
surface (bool) - When non-zero, surface object data will be duplicated with the
objects.
curve (bool) - When non-zero, curve object data will be duplicated with the
objects.
text (bool) - When non-zero, text object data will be duplicated with the
objects.
metaball (bool) - When non-zero, metaball object data will be duplicated with
the objects.
armature (bool) - When non-zero, armature object data will be duplicated with
the objects.
lamp (bool) - When non-zero, lamp object data will be duplicated with the
objects.
material (bool) - When non-zero, materials used by the object or its object data
will be duplicated with the objects.
texture (bool) - When non-zero, texture data used by the object's materials
will be duplicated with the objects.
ipo (bool) - When non-zero, Ipo data linked to the object will be
duplicated with the objects.
Example:
The example below creates duplicates the active object 10
times and moves each object 1.0 on the X axis:
import Blender
scn = Scene.GetCurrent()
ob_act = scn.objects.active
# Unselect all
scn.objects.selected = []
ob_act.sel = 1
for x in xrange(10):
Blender.Object.Duplicate() # Duplicate linked
ob_act = scn.objects.active
ob_act.LocX += 1
Blender.Redraw()
|