Resort

Category: Objects / Position
Since engine version: 4.9.1.0 GWE

Description

Resorts a single object in the internal object array.

Syntax

void Resort (object pObj);

Parameter

pObj:
[opt] Object to be resorted. Can be 0 in local calls. If 0 in a global call all objects will be resorted (used to fix sorting errors).

Remark

Objects are primarily sorted by the main categories (C4D_StaticBack through C4D_Object) and secondarily by their object definition (newly placed definitions are placed at the end of the list, so they are drawn at the very top). C4D_StaticBack objects, however, are not sorted by definition.
Internal sorting is always done at the end of each executed frame.

Example

var obj;
while (obj = FindObject(ELEC, 0,0,0,0, 0, 0,0, 0, obj))
  Resort(obj);
Makes sure that elevator cases are placed before all other objects.
See also: ResortObjects, SetObjectOrder
Sven2, Mai 2003