c4d.InstanceObject

New in version R20.

The instance object class of type Oinstance.

Represents one or multiple instances of an object with single-instance or multi-instance mode.

Inheritance

Members

InstanceObject.__init__()

Creates an InstanceObject.

Return type:c4d.InstanceObject
Returns:An InstanceObject instance.
InstanceObject.IsMultiInstance()

Checks if the instance object is in multi-instance mode.

Return type:bool
Returns:True if in multi-instance mode, otherwise False.
InstanceObject.GetReferenceObject(doc)

Return the instanciated object.

Note

Same as accessing the INSTANCEOBJECT_LINK parameter in the object’s data container.

Parameters:doc (c4d.documents.BaseDocument) – The document the instance object belongs to.
Return type:c4d.BaseObject
Returns:The reference object. None if the instance object is unassigned.
InstanceObject.SetReferenceObject(refObj)

Sets the instanciated object used for the multiple instances.

Note

Same as assigning the INSTANCEOBJECT_LINK parameter in the object’s data container.

Parameters:refObj (c4d.BaseObject) – The reference object to set.
InstanceObject.GetInstanceCount()

Returns the instance count (number of instances and matrices).

Return type:int
Returns:The instance count.
InstanceObject.GetInstanceMatrix(index)

Returns the global matrix of the instance at the specified index.

Parameters:index (int) – The instance index.
Return type:c4d.Matrix
Returns:The instance matrix.
InstanceObject.GetInstanceMatrices()

Returns the instance matrices.

Return type:List[c4d.Matrix]
Returns:The list of instance matrices.
InstanceObject.SetInstanceMatrices(matrices)

Sets the instance matrices.

Note

The size of matrices iterable determines the instance count.

Parameters:matrices (Union[List[c4d.Matrix], Tuple[c4d.Matrix]]) – The iterable (list or tuple) for the instance matrices to set.
Return type:bool
Returns:True if successful, otherwise False.
InstanceObject.GetInstanceColor(index)

Returns the color of the instance at the specified index.

Parameters:index (int) – The instance index.
Return type:c4d.Vector
Returns:The instance color.
InstanceObject.GetInstanceColors()

Returns the instance colors.

Return type:List[c4d.Vector]
Returns:The list of instance colors.
InstanceObject.SetInstanceColors(colors)

Sets the instance colors.

Parameters:colors (Union[List[c4d.Vector], Tuple[c4d.Vector]]) – The iterable (list or tuple) for the instance colors to set.
Return type:bool
Returns:True if successful, otherwise False.