pymel.core.effects.connectDynamic

connectDynamic(*args, **kwargs)

Dynamic connection specifies that the force fields, emitters, or collisions of an object affect another dynamic object. The dynamic object that is connected to a field, emitter, or collision object is influenced by those fields, emitters and collision objects. Connections are made to individual fields, emitters, collisions. So, if an object owns several fields, if the user wants some of the fields to affect an object, s/he can specify each field with a “-f” flag; but if the user wants to connect all the fields owned by an object, s/he can specify the object name with the “-f” flag. The same is true for emitters and collisions. Different connection types (i.e., for fields vs. emitters) between the same pair of objects are logically independent. In other words, an object can be influenced by another object’s fields without being influenced by its emitters or collisions. Each connected object must be a dynamic object. The object connected to can be any object that owns fields, emitters, etc.; it need not be dynamic. Objects that can own influences are particles, geometry objects (nurbs and polys) and lattices. You can specify either the shape name or the transform name of the object to be influenced.

Flags:
Long name (short name) Argument Types Properties
collisions (c) unicode ../../../_images/create.gif
 
Connects each object to the collision models of the given object.
delete (d) bool ../../../_images/create.gif
 
Deletes existing connections.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
emitters (em) unicode ../../../_images/create.gif
 
Connects each object to the emitters of the given object.
fields (f) unicode ../../../_images/create.gif
 
Connects each object to the fields of the given object.

Derived from mel command maya.cmds.connectDynamic

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.connectDynamic( 'Book', c='Floor' )
# Connects the dynamic object "Book" to the collision model of the
# "Floor". This means that the book will collide with and bounce off of
# the floor.

pm.connectDynamic( 'Moon', 'Spaceship', f='Moon' )
# Connects dynamic object "Spaceship" to the all fields and emitters
# owned by "Moon".

pm.connectDynamic( 'Spaceship', f='newtonField1' )
# Connects dynamic object "Spaceship" to "newtonField1" owned by "Moon".

pm.connectDynamic( 'Moon', f='newtonField1' )
# If the selection list consists of "Spaceship", connects dynamic object
# "Spaceship" to "newtonField1" and all emitters owned by "Moon".

pm.connectDynamic( 'Spaceship', d=True, f='Moon' )
# Deletes the field connection between all the fields owned by "Moon" and
# "Spaceship". Note that the command establishing the connection need not
# be in the undo queue.

pm.connectDynamic( 'Spaceship', d=True, f='newtonField1' )
# Deletes the field connection between "newtonField1" owned by "Moon" and
# "Spaceship".

Previous topic

pymel.core.effects.colorAtPoint

Next topic

pymel.core.effects.constrain

Core

Core Modules

Other Modules

This Page