pymel.core.effects.goal

goal(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
goal (g) unicode ../../../_images/create.gif ../../../_images/query.gif
 

This flag specifies string to be a goal of the particle object on the command line or the currently selected particle object. This flag can be used multiple times to specify multiple goals for a particle object. Query is for use by the attribute editor.

index (i) bool ../../../_images/query.gif
 
Returns array of multi-attribute indices for the goals. Intended for use by the Attribute Editor.
useTransformAsGoal (utr) bool ../../../_images/create.gif
 

Use transform of specified object instead of the shape. Meaningful only for particle and geometry objects. Can only be passed once, applies to all objects passed with -g. Flag can have multiple arguments, passed either as a tuple or a list.

weight (w) float ../../../_images/create.gif
 

This specifies the goal weight as a value from 0 to 1. A value of 0 means that the goal’s position will have no effect on the particle object, while a weight of 1 will make the particle object try to follow the goal object exactly. This flag can only be passed once and sets the weight for every goal passed with the -g/-goal flag.

Derived from mel command maya.cmds.goal

Example:

import pymel.core as pm

pm.sphere( name='surface1')
# Result: [nt.Transform(u'surface1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
pm.particle( name='Particle')
# Result: [nt.Transform(u'Particle'), nt.Particle(u'ParticleShape')] #

pm.goal( 'Particle', g='surface1', w=.75 )
# Result: [u'surface1Shape'] #

# This command assigns surface1 as a goal of Particle with a goal
# weight of 0.75.

pm.goal( 'Particle', g='surface1', w=.75, utr=1 )
# Result: [u'surface1'] #

# This command assigns the transform of surface1 as a goal of Particle
# with a goal weight of 0.75.

pm.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.

Previous topic

pymel.core.effects.getParticleAttr

Next topic

pymel.core.effects.gravity

Core

Core Modules

Other Modules

This Page