## ReorderSceneItem

### Introduced

v7.0

### Description

Moves a scene item (such as object, model group or cluster) to a different position in its parent's list of children. You can move the input object directly to the first or last position, or you can pick a specific point by designating a sibling as a reference object and indicating whether the input object should be moved before or after the reference object in the list.
A sibling is another scene item on the same hierarchical level: an immediate child of the input object's parent.

### Scripting Syntax

    ReorderSceneItem( Parent, InputObj, MoveAction, [Marker] );

### Parameters

Parameter | Type | Description
--- | --- | ---
Parent | String | Specifies the parent item under which you are modifying the position of a child item.
InputObj | String | Specifies the scene item to be reordered.
MoveAction | Integer | Specifies where the scene item will be moved: first child, before/after the reference item, or last child. Default Value: 0
Possible Values: | Description:
0 | Move to become the first child.
1 | Move just before the marker item.
2 | Move just after the marker item.
3 | Move to become the last child.
Marker | String | Specifies the marker item. This parameter is ignored if MoveAction=0 or 3.

### Examples

#### JScript Example

    //

    // This JScript example creates several objects and then changes

    // their child order using several of the ReorderSceneItem options.

    //

    NewScene(null, false);

    GetPrim("Null");

    NullMarker = GetPrim("Null");

    GetPrim("Null");

    GetPrim("Null");

    NullToMove = GetPrim("Null");

    // If you open the Explorer and change the "General Sort" option to "None (creation)"

    // you'll see that we have null, null1, null2, null3, null4.

    // Move "null4" after "null1".

    ReorderSceneItem("Scene_Root", NullToMove, 2, NullMarker);

    // Now make "null4" the first child.

    ReorderSceneItem("Scene_Root", NullToMove, 0);

### See Also

MoveOperator MoveOperatorBefore MoveOperatorAfter