本文整理汇总了Python中maya.OpenMayaMPx.asMPxPtr方法的典型用法代码示例。如果您正苦于以下问题:Python OpenMayaMPx.asMPxPtr方法的具体用法?Python OpenMayaMPx.asMPxPtr怎么用?Python OpenMayaMPx.asMPxPtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.OpenMayaMPx
的用法示例。
在下文中一共展示了OpenMayaMPx.asMPxPtr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: nodeCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def nodeCreator(cls):
"""
[email protected] Node creator function. Get maya API help for more informations.
"""
return OpenMayaMPx.asMPxPtr(cls())
示例2: cmdCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def cmdCreator():
# Create the command
"""
Return:
pointer to the command
"""
ptr = OpenMayaMPx.asMPxPtr(SamplePyCmd())
return ptr
示例3: contextCmdCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def contextCmdCreator():
"""Wrapper function that created the command"""
return OpenMayaMPx.asMPxPtr(mayaSelctionCtxCmd())
示例4: nodeCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def nodeCreator(cls):
return OpenMayaMPx.asMPxPtr(cls())
示例5: cmdCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def cmdCreator():
return OpenMayaMPx.asMPxPtr( scriptedCommand() )
示例6: moveManipContext
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
return OpenMayaMPx.asMPxPtr( moveManipContext() )
示例7: creator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def creator():
return OpenMayaMPx.asMPxPtr( gear_percentageToU() )
示例8: nodeCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def nodeCreator():
# TODO change this node name
return OpenMayaMPx.asMPxPtr(nodeName)
示例9: nodeCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def nodeCreator():
return OpenMayaMPx.asMPxPtr( sceneMsgCmd() )
示例10: dataCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def dataCreator():
return OpenMayaMPx.asMPxPtr(blindDoubleData())
示例11: cmdCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def cmdCreator():
return OpenMayaMPx.asMPxPtr(blindDoubleDataCmd())
示例12: redoIt
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def redoIt(self):
dependNode = OpenMaya.MObject() # Selected dependency node
# show message and advance iterator
def error(msg):
sys.stderr.write(err)
self.__iter.next()
# Iterate over all selected dependency nodes
#
while not self.__iter.isDone():
# Get the selected dependency node and create
# a function set for it
#
try:
self.__iter.getDependNode(dependNode)
except:
error("Error getting the dependency node")
continue
try:
fnDN = OpenMaya.MFnDependencyNode(dependNode)
except:
error("Error creating MFnDependencyNode")
continue
# Create a new attribute for our blind data
#
fnAttr = OpenMaya.MFnTypedAttribute()
newAttr = fnAttr.create("blindDoubleData", "BDD", kPluginDataId)
# Now add the new attribute to the current dependency node
#
fnDN.addAttribute(newAttr, OpenMaya.MFnDependencyNode.kLocalDynamicAttr)
# Create a plug to set and retrive value off the node.
#
plug = OpenMaya.MPlug(dependNode, newAttr)
# Instantiate blindDoubleData and set its value.
#
newData = OpenMayaMPx.asMPxPtr(blindDoubleData())
newData.setValue(3.2)
# Set the value for the plug.
#
plug.setMPxData(newData)
# Now try to retrieve the value off the plug as an MObject.
#
try:
sData = plug.asMObject()
except:
error("Error getting value off plug")
continue
# Convert the data back to MPxData.
#
pdFn = OpenMaya.MFnPluginData(sData)
data = pdFn.constData()
# Get the value.
#
if not data:
error("Error: failed to retrieve data.")
continue
self.__iter.next()
示例13: cmdCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def cmdCreator():
return OpenMayaMPx.asMPxPtr(BasicObjectSetTest())
示例14: nodeCreator
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def nodeCreator():
return OpenMayaMPx.asMPxPtr(BasicObjectSet())
示例15: create
# 需要导入模块: from maya import OpenMayaMPx [as 别名]
# 或者: from maya.OpenMayaMPx import asMPxPtr [as 别名]
def create( ):
return OpenMayaMPx.asMPxPtr( kgmEngine( ) )