本文整理匯總了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)