pymel.core.general.spaceLocator

spaceLocator(*args, **kwargs)

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

Modifications:
  • returns a single Transform instead of a list with a single locator

Flags:

Long Name / Short Name Argument Types Properties
absolute / a bool ../../../_images/create.gif ../../../_images/edit.gif
  If set, the locator’s position is in world space.
name / n unicode ../../../_images/create.gif ../../../_images/edit.gif
  Name for the locator.
position / p float, float, float ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Location in 3-dimensional space where locator is to be created.
relative / r bool ../../../_images/create.gif ../../../_images/edit.gif
  If set, the locator’s position is relative to its local space. The locator is created in relative mode by default. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.spaceLocator

Example:

import pymel.core as pm

# Creates a space locator at (1, 1, 1).
pm.spaceLocator( p=(1, 1, 1) )
# Result: nt.Transform(u'locator1') #
# Creates a space locator at (1, 1, 1) in inches.
pm.spaceLocator( p=('1in', '1in', '1in') )
# Result: nt.Transform(u'locator2') #
# Creates a space locator at the default position (0, 0, 0).
pm.spaceLocator()
# Result: nt.Transform(u'locator3') #