本文整理汇总了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)
示例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")
示例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:
#.........这里部分代码省略.........