本文整理汇总了Python中maya.cmds.error方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.error方法的具体用法?Python cmds.error怎么用?Python cmds.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.cmds
的用法示例。
在下文中一共展示了cmds.error方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connectRenderMeshes
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def connectRenderMeshes(self, renderMeshes, LOD=0):
try:
cmds.undoInfo(openChunk=True)
lodAttr = None
if LOD >=0 or LOD <=4:
lodAttr = self.node + '.rendermeshes_LOD' + str(LOD)
conns = cmds.listConnections(lodAttr, plugs=1, destination=1)
if conns:
for conn in cmds.listConnections(lodAttr, plugs=1, destination=1):
cmds.disconnectAttr(lodAttr, conn)
if lodAttr:
for mesh in renderMeshes:
msgConnect(lodAttr, mesh + '.uExport')
else:
cmds.error('connectRenderMeshes>>> please specify a LOD integer (0-4) for your meshes')
except Exception as e:
print e
finally:
cmds.undoInfo(closeChunk=True)
示例2: setAssetRoot
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def setAssetRoot(self, root):
"""
setAssetRoot(string root)
Set the root level directory for the Asset manager.
Show directories will live under this root, and
Assets will live under shows.
Creates the directory if it does not exist.
"""
if not os.path.exists(root):
try:
os.mkdir(root)
except OSError, e:
cmds.error("Could not create asset root directory. %s" % e)
示例3: _getShowDir
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def _getShowDir(self, show=''):
"""
_getShowDir(string show='') -> string path
Get the full path to a show directory, and create it if it
doesn't exist. If no show name is given, return the
current set show
"""
if show:
d = os.path.join(self._rootDir, show)
else:
d = self.showDir
if not os.path.exists(d):
try:
os.mkdir(d)
except OSError, e:
cmds.error("Failed to create show directory '%s'. %s" % (d, e))
示例4: setAssetRoot
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def setAssetRoot(self, root):
"""
setAssetRoot(string root)
Set the root level directory for the Asset manager.
Show directories will live under this root, and
Assets will live under shows.
Creates the directory if it does not exist.
"""
if not os.path.exists(root):
try:
os.makedirs(root)
except OSError, e:
cmds.error("Could not create asset root directory. %s" % e)
示例5: createShakeNode
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def createShakeNode(transform=None):
"""
createShakeNode (string transform=None) -> string node
A helper command for creating a new shakeNode
Optionally, a transform node path may be given
to automatically connect the shakeNode output
into the transform input.
"""
if not cmds.pluginInfo("shakeNode", query=True, loaded=True):
cmds.error("shakeNode plugin is not loaded!")
shake = cmds.createNode("shakeNode")
cmds.connectAttr("time1.outTime", "%s.time" % shake)
if transform:
if not cmds.objExists(transform):
cmds.error("transform does not exist: %s" % transform)
cmds.connectAttr("%s.output" % shake, "%s.translate" % transform, f=True)
return shake
示例6: doIt
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def doIt(self, args):
print('starting %s'%kPluginCmdName)
try:
import MyWindow
reload(MyWindow)
MyWindow.main()
except Exception as ex:
cmds.error(ex.message())
示例7: btnCallCppPlugin_clicked
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def btnCallCppPlugin_clicked(self):
print('btnCallCppPlugin_clicked')
try:
cmds.loadPlugin('HelloMaya')
cmds.myCmd1()
cmds.hello()
except Exception as ex:
cmds.error(ex.message)
示例8: btnCallCSPlugin_clicked
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import error [as 别名]
def btnCallCSPlugin_clicked(self):
print('btnCallCSPlugin_clicked')
try:
cmds.loadPlugin('HiMaya2017')
cmds.csHi()
except Exception as ex:
cmds.error(ex.message)