Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

addDynamic object object

addDynamic is undoable, NOT queryable, and NOT editable.

Makes the "object" specified as second argument the source of an existing field or emitter specified as the first argument. In practical terms, what this means is that a field will emanate its force from its owner object, and an emitter will emit from its owner object. addDynamic makes the specified field or emitter a child of the owner's transform (adding it to the model if it was not already there), and makes the necessary attribute connections. If either of the arguments is omitted, addDynamic searches the selection list for objects to use instead. If more than one possible owner or field/emitter is selected, addDynamic will do nothing. If the specified field/emitter already has a source, addDynamic will remove the current source and replace it with the newly specified source. If a subset of the owner object's cvs/particles/vertices is selected, addDynamic will add the field/emitter to that subset only.

Return value

string The name of the source object and the field or emitter which was attached to it.

Related

air, drag, emitter, gravity, newton, radial

MEL examples

// Create an emitter
emitter -pos 0 0 0 -type omni -r 100 -sro 0 -nuv 0 -cye none -cyi 1 -spd 1 -srn 0 -nsp 1 -tsp 0 -mxd 0 -mnd 0 -dx 1 -dy 0 -dz 0 -sp 0 ;
// Result: emitter1 //
// Get the emitter to emit particles
particle;
// Result: particle2
connectDynamic -em emitter1 particle1;
// Create a particle to use as the source of the emitter
  particle -p 6.0 0 7.0 -p 6.0 0 2.0 -c 1 ;
// Result: particle2
// Use particle2 as a source of the emitter
addDynamic emitter1 particle2;