当前位置: 首页>>代码示例>>Python>>正文


Python cmds.error方法代码示例

本文整理汇总了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) 
开发者ID:chrisevans3d,项目名称:uExport,代码行数:22,代码来源:uExport.py

示例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) 
开发者ID:justinfx,项目名称:tutorials,代码行数:19,代码来源:assetImporter4.py

示例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)) 
开发者ID:justinfx,项目名称:tutorials,代码行数:23,代码来源:assetImporter4.py

示例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) 
开发者ID:justinfx,项目名称:tutorials,代码行数:19,代码来源:assetImporter2.py

示例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 
开发者ID:justinfx,项目名称:tutorials,代码行数:26,代码来源:shakeNodeCmd.py

示例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()) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:10,代码来源:pyMyPlugin.py

示例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) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:10,代码来源:MyWindow.py

示例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) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:9,代码来源:MyWindow.py


注:本文中的maya.cmds.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。