# ResortObjects

Objects
Position
4.9.1.0 GWE
bool
string resort_func Name of the function to be called for sorting.
int category Object category to be resorted (e.g. C4D_StaticBack). 0 resorts all objects.
Resorts all objects or all objects of a given category internally. This is done through a simple sort algorithm which calls the specified function to determine the relation of two objects being compared. The two object references are passed in Par(0) and Par(1). If the first object is to be sorted before the second, the function should return a value less than zero. Otherwise, the function should return a value greater than or equal to zero.
Internal sorting is not done immediately but at the end of the frame in which the function was called.
ResortObjects("ResortProc", C4D_StaticBack());

protected ResortProc: return(GetMass(Par(0))-GetMass(Par(1)));
Sorts all C4D_StaticBack objects by weight (lighter objects in front).
SetObjectOrder
Resort
Sven2
2001-11