Go to: Synopsis. Return value. Related. Flags. Python examples.
goal(
selectionList
, [goal=string], [index=boolean], [useTransformAsGoal=boolean], [weight=float])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
goal is undoable, queryable, and NOT editable.
Specifies the given objects as being goals for the given particle object. If the goal objects are geometry, each particle in the particle object will each try to follow or match its position to that of a certain vertex/CV/lattice point of the goal. If the goal object is another particle object, each particle will try to follow a paricle of the goal. In any other case, all the particles will try to follow the current location of the goal object's transform. You can get this latter behavior for a geometry or particle object too by using -utr true.The goal weight can be keyframed. It lives on the particle object to which the goal was added and is a multi-attribute.
| string |
In query mode, return type is based on queried flag.
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
goal(g)
|
string
|
|
||
|
||||
index(i)
|
boolean
|
|
||
|
||||
useTransformAsGoal(utr)
|
boolean
|
|
||
|
||||
weight(w)
|
float
|
|
||
|
||||
import maya.cmds as cmds cmds.sphere( name='surface1') cmds.particle( name='Particle') cmds.goal( 'Particle', g='surface1', w=.75 ) # This command assigns surface1 as a goal of Particle with a goal # weight of 0.75. cmds.goal( 'Particle', g='surface1', w=.75, utr=1 ) # This command assigns the transform of surface1 as a goal of Particle # with a goal weight of 0.75. cmds.goal( 'Particle', g='camera1', w=.75 ) # This command assigns the transform of camera1 as a goal of Particle # with a goal weight of 0.75. The -utr flag is not relevant because # only the transform can be used for any object other than geometry # or particles.