本文整理汇总了Python中maya.OpenMayaMPx类的典型用法代码示例。如果您正苦于以下问题:Python OpenMayaMPx类的具体用法?Python OpenMayaMPx怎么用?Python OpenMayaMPx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OpenMayaMPx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: nodeCreator
def nodeCreator(cls):
"""
[email protected] Node creator function. Get maya API help for more informations.
"""
return OpenMayaMPx.asMPxPtr(cls())
示例2: cmdCreator
def cmdCreator():
# Create the command
"""
Return:
pointer to the command
"""
ptr = OpenMayaMPx.asMPxPtr(SamplePyCmd())
return ptr
示例3: readASCII
def readASCII(self, args, lastParsedElement):
try:
if args.length() > 0:
parsedIndex = OpenMaya.MScriptUtil.getUint(lastParsedElement)
self.__fValue = args.asDouble( parsedIndex )
parsedIndex += 1
OpenMaya.MScriptUtil.setUint(lastParsedElement,parsedIndex)
fValueDictionary[OpenMayaMPx.asHashable(self)]=self.__fValue
except:
sys.stderr.write("Failed to read ASCII value.")
raise
示例4: doEditFlags
def doEditFlags(self):
theParser = self._parser()
theControl = kPythonPtrTable.get(OpenMayaMPx.asHashable(self._control()), None)
if theParser.isFlagSet(kNopFlag):
theControl.setOperation(kNop)
elif theParser.isFlagSet(kMultFlag):
theControl.setOperation(kMult)
elif theParser.isFlagSet(kAddFlag):
theControl.setOperation(kAdd)
elif theParser.isFlagSet(kRedrawFlag):
theControl.redrawCells()
theControl.redrawLabels()
else:
OpenMayaMPx.MPxControlCommand.doEditFlags(self)
示例5: doPress
def doPress(self, event):
OpenMayaMPx.MPxSelectionContext.doPress(self, event)
spc = OpenMaya.MSpace.kWorld
# If we are not in selecting mode (i.e. an object has been selected)
# then set up for the translation.
#
if not self._isSelecting():
argX = OpenMaya.MScriptUtil()
argX.createFromInt(0)
argXPtr = argX.asShortPtr()
argY = OpenMaya.MScriptUtil()
argY.createFromInt(0)
argYPtr = argY.asShortPtr()
event.getPosition(argXPtr, argYPtr)
self.__startPos_x = OpenMaya.MScriptUtil(argXPtr).asShort()
self.__startPos_y = OpenMaya.MScriptUtil(argYPtr).asShort()
self.__view = OpenMayaUI.M3dView.active3dView()
camera = OpenMaya.MDagPath()
self.__view.getCamera(camera)
fnCamera = OpenMaya.MFnCamera(camera)
upDir = fnCamera.upDirection(spc)
rightDir = fnCamera.rightDirection(spc)
# Determine the camera used in the current view
#
if fnCamera.isOrtho():
if upDir.isEquivalent(OpenMaya.MVector.zNegAxis, kVectorEpsilon):
self.__currWin = MoveContext.kTop
elif rightDir.isEquivalent(OpenMaya.MVector.xAxis, kVectorEpsilon):
self.__currWin = MoveContext.kFront
else:
self.__currWin = MoveContext.kSide
else:
self.__currWin = MoveContext.kPersp
# Create an instance of the move tool command.
#
newCmd = self._newToolCommand()
self.__cmd = kTrackingDictionary.get(OpenMayaMPx.asHashable(newCmd), None)
self.__cmd.setVector(0.0, 0.0, 0.0)
示例6: contextCmdCreator
def contextCmdCreator():
"""Wrapper function that created the command"""
return OpenMayaMPx.asMPxPtr(mayaSelctionCtxCmd())
示例7: nodeCreator
def nodeCreator(cls):
return OpenMayaMPx.asMPxPtr(cls())
示例8: cmdCreator
def cmdCreator():
return OpenMayaMPx.asMPxPtr( scriptedCommand() )
示例9: moveManipContext
return OpenMayaMPx.asMPxPtr( moveManipContext() )
示例10: creator
def creator():
return OpenMayaMPx.asMPxPtr( gear_percentageToU() )
示例11: nodeCreator
def nodeCreator():
# TODO change this node name
return OpenMayaMPx.asMPxPtr(nodeName)
示例12: nodeCreator
def nodeCreator():
return OpenMayaMPx.asMPxPtr( sceneMsgCmd() )
示例13: nodeCreator
def nodeCreator():
return OpenMayaMPx.asMPxPtr( dynNode() )
示例14: creator
def creator():
return OpenMayaMPx.asMPxPtr(cvShapeInverter())
示例15: create
def create():
return OpenMayaMPx.asMPxPtr(Ik2bCGA())