예제 #1
0
 def setSpacing(cls, size, setManip=False, log=False):
     if log:
         print("Grid spacing value is: " + str(sp))
     pm.grid(spacing=size)
     if setManip:
         pm.manipMoveContext('Move',
                             e=True,
                             snapRelative=True,
                             snapValue=size)
예제 #2
0
def cycleManipXformConstraint():

    contextNames = [
        ['Move', pm.manipMoveContext],
        ['Rotate', pm.manipRotateContext],
        ['Scale',pm.manipScaleContext],
    ]

    result = pm.manipMoveContext( 'Move', xformConstraint=True, query=True )


    if result=='none':
        for contextName, contextFunc in contextNames:
            contextFunc(contextName, xformConstraint='edge', edit=True)
        om.MGlobal.displayInfo( 'edge constraint mode active' )
    elif result=='edge':
        for contextName, contextFunc in contextNames:
            contextFunc(contextName, xformConstraint='surface', edit=True)
        om.MGlobal.displayInfo( 'surface constraint mode active' )
    else:
        for contextName, contextFunc in contextNames:
            contextFunc(contextName, xformConstraint='none', edit=True)
        om.MGlobal.displayInfo( 'no constraint mode active' )
 def setSpacing(cls, size, setManip=False, log=False):
     if log:
         print( "Grid spacing value is: " + str(sp) )        
     pm.grid( spacing=size )
     if setManip:
         pm.manipMoveContext( 'Move', e=True, snapRelative=True, snapValue=size )
The default move context is 'Move'

Notes from the Maya documentation

    0 - U axis handle is active
    1 - V axis handle is active
    2 - N axis handle is active ( default )
    3 - Center handle (all 3 axes) is active

applicable only when the manip mode is 3.
alignAlong(aa)     [float, float, float]     createedit
    Aligns active handle along vector.
constrainAlongNormal(xn)     boolean     queryedit
    When true, transform constraints are applied along the vertex normal first and only use the closest point when no intersection is found along the normal.
currentActiveHandle(cah)     int     queryedit
    Sets the active handle for the manip. Values can be:

    0 - X axis handle is active
    1 - Y axis handle is active
    2 - Z axis handle is active
    3 - Center handle (all 3 axes) is active
    4 - XY plane handle is active
    5 - YZ plane handle is active
    6 - XZ plane handle is active
"""

import pymel.all as pm
import maya.cmds as cmds
mpName = 'Move'
pm.manipMoveContext( mpName, edit=True, currentActiveHandle=3 )
The default move context is 'Move'

Notes from the Maya documentation

    0 - U axis handle is active
    1 - V axis handle is active
    2 - N axis handle is active ( default )
    3 - Center handle (all 3 axes) is active

applicable only when the manip mode is 3.
alignAlong(aa)     [float, float, float]     createedit
    Aligns active handle along vector.
constrainAlongNormal(xn)     boolean     queryedit
    When true, transform constraints are applied along the vertex normal first and only use the closest point when no intersection is found along the normal.
currentActiveHandle(cah)     int     queryedit
    Sets the active handle for the manip. Values can be:

    0 - X axis handle is active
    1 - Y axis handle is active
    2 - Z axis handle is active
    3 - Center handle (all 3 axes) is active
    4 - XY plane handle is active
    5 - YZ plane handle is active
    6 - XZ plane handle is active
"""

import pymel.all as pm
import maya.cmds as cmds
mpName = 'Move'
pm.manipMoveContext(mpName, edit=True, currentActiveHandle=3)