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

Synopsis

spaceLocator([absolute=boolean], [name=string], [position=[linear, linear, linear]], [relative=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

spaceLocator is undoable, queryable, and editable.

The command creates a locator at the specified position in space. By default it is created at (0,0,0).

Return value

string[]The name for the new locator in space.

In query mode, return type is based on queried flag.

Flags

absolute, name, position, relative
Long name (short name) Argument types Properties
position(p) [linear, linear, linear] createqueryedit
Location in 3-dimensional space where locator is to be created.
name(n) string createedit
Name for the locator.
relative(r) boolean createedit
If set, the locator's position is relative to its local space. The locator is created in relative mode by default.
absolute(a) boolean createedit
If set, the locator's position is in world space.

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Creates a space locator at (1, 1, 1).
cmds.spaceLocator( p=(1, 1, 1) )
# Creates a space locator at (1, 1, 1) in inches.
cmds.spaceLocator( p=('1in', '1in', '1in') )
# Creates a space locator at the default position (0, 0, 0).
cmds.spaceLocator()