pymel.core.general.inheritTransform¶
- inheritTransform(*args, **kwargs)¶
This command toggles the inherit state of an object. If this flag is off the object will not inherit transformations from its parent. In other words transformations applied to the parent node will not affect the object and it will act as though it is under the world. If the -p flag is specified then the object’s transformation will be modified to compensate when changing the inherit flag so the object will not change its world-space location. In query mode, return type is based on queried flag.
Flags:
Long Name / Short Name Argument Types Properties off / off bool on / on bool preserve / p bool preserve the objects world-space position by modifying the object(s) transformation matrix. toggle / tgl bool toggle the inherit state for the given object(s) (default if no flags are given) -on turn on inherit state for the given object(s) -off turn off inherit state for the given object(s) Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.inheritTransform
Example:
import pymel.core as pm # create an circle, move it off center, group it # and move the group so that the circle is back in center pm.circle( nr=(0, 1, 0), n='circle1' ) # Result: [nt.Transform(u'circle1'), nt.MakeNurbCircle(u'makeNurbCircle1')] # pm.move( 2, 0, 0 ) pm.group() # Result: nt.Transform(u'group1') # pm.move( -2, 0, 0 ) # turn off inherits transform flag of circle1. # The circle will now appear at (2, 0, 0) pm.inheritTransform( 'circle1', off=True ) # turn off inherits transform flag of circle1 but preserve the # position of the circle. The circle will stay centered at (0, 0, 0) pm.inheritTransform( 'circle1', on=True ) pm.inheritTransform( 'circle1', off=True, preserve=True ) # query state of inherits transform flag pm.inheritTransform( 'circle1', q=True ) # Result: False #