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


Python MGlobal.displayInfo方法代码示例

本文整理汇总了Python中maya.OpenMaya.MGlobal.displayInfo方法的典型用法代码示例。如果您正苦于以下问题:Python MGlobal.displayInfo方法的具体用法?Python MGlobal.displayInfo怎么用?Python MGlobal.displayInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maya.OpenMaya.MGlobal的用法示例。


在下文中一共展示了MGlobal.displayInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: info

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayInfo [as 别名]
def info(msg):
	return MGlobal.displayInfo(msg)
开发者ID:jedmao,项目名称:maya-scripts,代码行数:4,代码来源:general.py

示例2: checkAndLoadPlugin

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayInfo [as 别名]
def checkAndLoadPlugin(pluginName=""):
    if not cmds.pluginInfo(pluginName, query=True, loaded=True):
        cmds.loadPlugin(pluginName)
        MGlobal.displayInfo("plugin " + pluginName + " loaded success")
开发者ID:yes7rose,项目名称:maya_utils,代码行数:6,代码来源:maya_utils.py

示例3: convert

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayInfo [as 别名]
    def convert(self, *args):
        
        # 0: 'Only not existing'
        # 1: 'Overwrite older'
        # 2: 'Overwrite all'
        
        # 0: from scene
        # 1: from folder
        
        flagString = ''
        lErrors = []
        
        # SIMPLE
        for myCheckBox in self.simpleCheckBoxes:
            if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                flagString += '%s ' % mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True)
        # INT
        for myCheckBox in self.intCheckBoxes:
            if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                flagString += '%s %i ' % (mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True), mc.intField('%sIntField' % myCheckBox, q=True, v=True))
                
         # DOUBLE INT
        for myCheckBox in self.doubleIntCheckBoxes:
            if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                flagString += '%s %i %i ' % (mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True), mc.intField('%sIntFieldX' % myCheckBox, q=True, v=True), mc.intField('%sIntFieldY' % myCheckBox, q=True, v=True))
                
        # FLOAT
        for myCheckBox in self.floatCheckBoxes:
            if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                flagString += '%s %f ' % (mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True), mc.floatField('%sFloatField' % myCheckBox, q=True, v=True))
                
        # ENUM
        # for myCheckBox in self.enumCheckBoxes:
            # if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                # flagString += '%s %s ' % (mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True), mc.attrEnumOptionMenu('%sOptionMenu' % myCheckBox, q=True))
         
        # OPTION MENU
        for myCheckBox in self.enumCheckBoxes:
            if mc.checkBox('%sCheckBox' % myCheckBox, q=True, v=True):
                flagString += '%s %s ' % (mc.checkBox('%sCheckBox' % myCheckBox, q=True, ann=True), mc.optionMenu('%sOptionMenu' % myCheckBox, q=True, v=True))

        makeTxPath = mc.textFieldButtonGrp(self.pathTextField, q=True, fileName=True)
        convertType = mc.radioButtonGrp(self.convertBehaviorRadioButton, q=True, sl=True) - 1
        sourceType = mc.radioButtonGrp(self.textureFrom, q=True, sl=True) - 1
        showTerminal = mc.checkBox('verboseCheckBox', q=True, v=True)
        
        if not os.path.isfile('%s/maketx.exe' % makeTxPath):
            MGlobal.displayInfo('[ERROR] Unable to find makeTx.exe. Exit!')
            return
            
        if not len(mc.ls(type='file')) and not sourceType:
            MGlobal.displayInfo('[WARNING] No textures in current scene. Nothing to convert.')
            return
        
        myFileList = []
        if sourceType:
            myTextureFolder = mc.textFieldButtonGrp(self.texturePathTextField, q=True, fileName=True)
            imageFormats = [  '.bmp', '.cin', '.dds', '.dpx', '.f3d', '.fits', '.hdr', '.hdri', '.ico', '.iff', '.jpg', '.jpeg',
                                        '.jif', '.jfif', '.jfi', '.jp2', '.j2k', '.exr', '.png', '.pbm', '.pgm', '.ppm', '.ptex', '.rla',
                                        '.sgi', '.rgb', '.rgba', '.pic', '.tga', '.tif', '.tiff'  ]
                            
            for (fileFolder, folders, files) in os.walk(myTextureFolder):
                for file in files:
                    if os.path.splitext(file)[-1] in imageFormats:
                        myFileList.append(os.path.join(fileFolder, file))

        else:
            for fileNode in mc.ls(type='file'):
                myFileList.append(mc.getAttr('%s.fileTextureName' % fileNode))

        #Setting up the progress bar.
        x = len(myFileList)
        counter = 0
        mc.progressBar(self.progressControl, e=True, maxValue=x)

        mc.columnLayout(self.progressLayout, e=True, manage=True)
        mc.refresh(f=True)
        
        for i, texFileIn in enumerate(myFileList):

            myPath, myFile = os.path.split(texFileIn)
            myFile, myExt = os.path.splitext(myFile)
            texFileOut = '%s/%s.tx' % (myPath, myFile)

            progressInc = mc.progressBar(self.progressControl, edit=True, pr=counter)
            mc.text(self.currentNumberText, e=True, l='Processing file %i / %i' % (i+1, x))
            mc.text(self.currentFileText, e=True, l='%s%s' % (myFile, myExt))
            mc.refresh(f=True)
            
            if not os.path.isfile(texFileOut) or convertType == 2:
                MGlobal.displayInfo('[INFO] %s --> %s' % (texFileIn, texFileOut))
                call('%s/maketx.exe %s "%s"' % (makeTxPath, flagString, texFileIn), shell=1 - showTerminal)
                # Check if the texture has been converted and add the errors to a list
                if not os.path.isfile(texFileOut):
                        lErrors.append(texFileOut)
                
            elif convertType == 1:
                sourceFileDate = datetime.datetime.fromtimestamp(os.path.getmtime(texFileIn))
                
                try:
#.........这里部分代码省略.........
开发者ID:mkolar,项目名称:Tapp,代码行数:103,代码来源:nMakeTx.py


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