Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

instance [-leaf] [-name string] [-smartTransform] [objects]

instance is undoable, NOT queryable, and NOT editable.

Instancing is a way of making the same object appear twice in the scene. This is accomplished by creation of a new transform node that points to an exisiting object. Changes to the transform are independent but changes to the "instanced" object affect all instances since the node is shared. If no objects are given, then the selected list is instanced. When an object is instanced a new transform node is created that points to the selected object. The smart transform feature allows instance to transform newly instanced objects based on previous transformations between instances. Example: Instance an object and move it to a new location. Instance it again with the smart transform flag. It should have moved once again the distance you had previously moved it. Note: changing the selected list between smart instances will cause the transform information to be deleted. It returns a list of the new objects created by the instance operation. See also: duplicate

Return value

string - the name of the new transform node is returned.

Flags

leaf, name, smartTransform
Long name (short name) Argument types Properties
-leaf(-lf) create
Instances leaf-level objects. Acts like duplicate except leaf-level objects are instanced.
-smartTransform(-st) create
Transforms instances item based on movements between transforms
-name(-n) string create
Name to give new instance

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

  // Create a hierarchy
  sphere -n sphere1; move 3 0 0;
  sphere -n sphere2; move -3 0 0;
  group -n group1 sphere1 sphere2;
  group -n group2 group1;

  // Create an instance of one of the spheres
instance sphere1;

  // Duplicate the hierarchy except for the shapes which are
  // instanced.instances of all leaf level shapes
instance -leaf group1;

  // Create a row of 4 instanced circles which are equally spaced
  circle -n circle1;
  instance; move 3 0 0;
  instance -smartTransform;
  instance -smartTransform;