本文整理汇总了Python中ui_tools.ui.infoWindow函数的典型用法代码示例。如果您正苦于以下问题:Python infoWindow函数的具体用法?Python infoWindow怎么用?Python infoWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了infoWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: checkoutLightingFile
def checkoutLightingFile():
print("checkoutLightingFile")
shotPaths = glob.glob(os.path.join(os.environ["SHOTS_DIR"], "*"))
selections = []
for sp in shotPaths:
selections.append(os.path.basename(sp))
selections.sort()
print("Im calling ui")
answer = ui.listWindow(selections, wmessage="Select shot file to checkout:")
print("Im done calling ui")
if answer:
answer = answer[0]
toCheckout = os.path.join(os.environ["SHOTS_DIR"], selections[answer], "lighting")
try:
destpath = amu.checkout(toCheckout, True)
except Exception as e:
if not amu.checkedOutByMe(toCheckout):
ui.infoWindow("Can Not Checkout: " + str(e))
return
else:
destpath = amu.getCheckoutDest(toCheckout)
toOpen = os.path.join(destpath, get_filename(toCheckout) + ".hipnc")
if os.path.exists(toOpen):
hou.hipFile.load(toOpen)
else:
hou.hipFile.clear()
hou.hipFile.save(toOpen)
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:30,代码来源:hou_asset_mgr.py
示例2: checkFiles
def checkFiles(files):
'''
Checks the list of output files against which files were actually created
@param: files - a list of strings representing full paths
@return: a list of paths to files that do not exist
'''
missingFiles = []
for filename in files:
print "CHECKING********** " + filename
if not os.path.exists(filename):
missingFiles.append(filename)
if not len(missingFiles) == 0:
errorMessage = ""
for f in missingFiles:
errorMessage += "MISSING FILE: " + f + "\n"
print(errorMessage)
errorMessage = str(len(missingFiles)) + " Files Missing:\n\n" + errorMessage
#mc.confirmDialog(title="Error exporting files", message=errorMessage)
ui.infoWindow(errorMessage, wtitle="Error exporting files", msev=messageSeverity.Error)
return missingFiles
开发者ID:byu-animation,项目名称:ramshorn-tools,代码行数:26,代码来源:maya_geo_export.py
示例3: checkin
def checkin():
"""Checks in the selected node. EXACTLY ONE node may be selected, and it MUST be a digital asset.
The node must already exist in the database, and USERNAME must have the lock."""
updateDB()
node = getSelectedNode()
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
info = getFileInfo(filename)
if info == None:
ui.infoWindow("Add the OTL first")
elif info[2]:
if not node.isLocked() and info[3] == USERNAME:
saveOTL(node) # This save is not strictly necessary since we save again two lines down
lockAsset(node, False)
saveOTL(node)
moveToOtlDir(node, filename)
unlockOTL(filename)
ui.infoWindow("Checkin Successful!")
else:
ui.infoWindow(lockedBy(info[3].encode('utf-8')))
else:
ui.infoWindow("Already checked in.")
else:
#ui.infoWindow("Select EXACTLY one node.")
checkinLightingFile()
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:29,代码来源:hou_asset_mgr.py
示例4: checkout
def checkout(node):
"""Checks out the selected node. EXACTLY ONE node may be selected, and it MUST be a digital asset.
The node must already exist in the database."""
updateDB()
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
if node.type().name() == "geometryTemplate":
ui.infoWindow("Cannot checkout geometry template node.")
return False
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
info = getFileInfo(filename)
if info == None:
ui.infoWindow("Add OTL First.")
elif not info[2] or (info[2] and info[3].encode("utf-8") == USERNAME):
copyToUsrDir(node, filename)
lockAsset(node, True)
saveOTL(node)
node.allowEditingOfContents()
lockOTL(filename)
ui.infoWindow("Checkout Successful!", wtitle="Success!")
else:
logname, realname = amu.lockedBy(info[3].encode("utf-8"))
whoLocked = "User Name: " + logname + "\nReal Name: " + realname + "\n"
errstr = "Cannot checkout asset. Locked by: \n\n" + whoLocked
ui.infoWindow(errstr, wtitle="Asset Locked", msev=messageSeverity.Error)
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:27,代码来源:hou_asset_mgr.py
示例5: checkout
def checkout():
"""Checks out the selected node. EXACTLY ONE node may be selected, and it MUST be a digital asset.
The node must already exist in the database."""
updateDB()
node = getSelectedNode()
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
if node.type().name() == "geometryTemplate":
ui.infoWindow("Cannot checkout geometry template node.")
return False
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
info = getFileInfo(filename)
if info == None:
ui.infoWindow("Add OTL First.")
elif not info[2]: #or (info[2] and info[3] == USERNAME):
copyToUsrDir(node, filename)
lockAsset(node, True)
saveOTL(node)
node.allowEditingOfContents()
lockOTL(filename)
ui.infoWindow("Checkout Successful!", wtitle='Success!')
else:
ui.infoWindow(lockedBy(info[3].encode('utf-8')))
else:
#ui.infoWindow("Select EXACTLY one node.")
checkoutLightingFile()
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:29,代码来源:hou_asset_mgr.py
示例6: checkoutLightingFile
def checkoutLightingFile():
shotPaths = glob.glob(os.path.join(os.environ['SHOTS_DIR'], '*'))
selections = []
for sp in shotPaths:
selections.append(os.path.basename(sp))
selections.sort()
answer = ui.listWindow(selections, wmessage='Select shot file to checkout:')
if answer:
answer = answer[0]
toCheckout = os.path.join(os.environ['SHOTS_DIR'], selections[answer], 'lighting')
try:
destpath = amu.checkout(toCheckout, True)
except Exception as e:
if not amu.checkedOutByMe(toCheckout):
ui.infoWindow('Can Not Checkout: '+str(e))
return
else:
destpath = amu.getCheckoutDest(toCheckout)
toOpen = os.path.join(destpath, get_filename(toCheckout)+'.hipnc')
if os.path.exists(toOpen):
hou.hipFile.load(toOpen)
else:
hou.hipFile.clear()
hou.hipFile.save(toOpen)
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:27,代码来源:hou_asset_mgr.py
示例7: checkin
def checkin(node = None):
"""Checks in the selected node. EXACTLY ONE node may be selected, and it MUST be a digital asset.
The node must already exist in the database, and USERNAME must have the lock."""
updateDB()
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
info = getFileInfo(filename)
if info == None:
ui.infoWindow("Add the OTL first")
elif info[2]:
if not node.isLocked() and info[3] == USERNAME:
saveOTL(node) # This save is not strictly necessary since we save again two lines down
lockAsset(node, False)
saveOTL(node)
moveToOtlDir(node, filename)
unlockOTL(filename)
ui.infoWindow("Checkin Successful!")
else:
logname, realname = amu.lockedBy(info[3].encode('utf-8'))
whoLocked = 'User Name: ' + logname + '\nReal Name: ' + realname + '\n'
errstr = 'Cannot checkin asset. Locked by: \n\n' + whoLocked
ui.infoWindow(errstr, wtitle='Asset Locked', msev=messageSeverity.Error)
else:
ui.infoWindow("Already checked in.")
else:
#ui.infoWindow("Select EXACTLY one node.")
checkinLightingFile()
开发者ID:garretthoyos,项目名称:byu-animation-tools,代码行数:31,代码来源:hou_asset_mgr.py
示例8: newGeo
def newGeo(hpath):
templateNode = hou.node(hpath).createNode("geometryTemplate")
alist = listContainers()
resp = ui.inputWindow("Enter the New Operator Label", wtitle="OTL Label")
filename = str()
if resp != None and resp.strip() != "":
name = formatName(resp)
filename = name.replace(" ", "_")
templateNode.setName(filename, unique_name=True)
answer = ui.listWindow(alist, wmessage="Select Container Asset this belongs to:")
if not answer:
ui.infoWindow(
"Geometry must be associated with a container asset! Geometry asset not created.",
msev=messageSeverity.Error,
)
templateNode.destroy()
return
answer = answer[0]
sdir = "$JOB/PRODUCTION/assets/"
gfile = ui.fileChooser(
start_dir=sdir + alist[answer] + "/geo",
wtitle="Choose Geometry",
mode=fileMode.Read,
extensions="*.bjson, *.obj",
)
if len(gfile) > 4 and gfile[:4] != "$JOB":
ui.infoWindow(
"Path must start with '$JOB'. Default geometry used instead.",
wtitle="Path Name",
msev=messageSeverity.Error,
)
templateNode.destroy()
elif gfile != "":
hou.parm(templateNode.path() + "/read_file/file").set(gfile)
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:34,代码来源:hou_asset_mgr.py
示例9: newTexture
def newTexture():
# Get a list of assets
assetList = glob.glob(os.path.join(os.environ['ASSETS_DIR'], '*'))
selections = []
for aL in assetList:
# basename takes last folder in path.
selections.append(os.path.basename(aL))
# sort alphabetically
selections.sort()
answer = ui.listWindow(selections, wmessage='Choose an asset to add/update textures for')
if answer:
answer = answer[0]
assetName = selections[answer]
assetImageDir = os.path.join(os.environ['ASSETS_DIR'], assetName, 'images')
# Direct user to geometry file path and have them choose the correct one
sdir = '$JOB/PRODUCTION/assets/'+assetName+'/geo/bjsonFiles'
geoPath = ui.fileChooser(start_dir=sdir, wtitle='Choose Asset Geometry for Texture', mode=fileMode.Read, extensions='*.bjson, *.obj')
geoName, ext = os.path.splitext(os.path.basename(geoPath))
# Show a list of shading passes
shadingPassList = ['diffuse','specular','bump','scalar_displacement','vector_displacement', 'opacity', 'single_SSS', 'multi_SSS', 'other']
answer = ui.listWindow(shadingPassList, wmessage='Which texture will you be creating/updating?')
if answer:
answer = answer[0]
shadingPass = shadingPassList[answer]
# Allow user to choose texture map in user local directory
userDirectory = os.environ['USER_DIR']
userTextureMap = ui.fileChooser(start_dir=userDirectory, wtitle='Browse to the Texture Map in your User Directory', image=True, extensions='*.jpg,*.jpeg,*.tiff,*.tif,*.png,*.exr')
#Allow user to search for texture in any directory
userTextureMap = os.path.expandvars(userTextureMap)
# Set Variables for texture paths
newTexture = '/tmp/newTexture.png'
convertedTexture = '/tmp/convertedTexture.png'
finalTexture = '/tmp/finalTexture.exr'
# Change to 16 bits and convert to png
os.system('iconvert -d 16 ' +userTextureMap+ newTexture)
# Gamma correct for linear workflow
if shadingPass == 'diffuse' or shadingPass == 'specular' or shadingPass == 'single_SSS' or shadingPass == 'multi_SSS' or shadingPass == 'other':
os.system('icomposite' +convertedTexture +'= gamma 0.4545454545' +newTexture)
# Convert to .exr with otimized settings
os.system('iconvert -d half '+convertedTexture+finalTexture+' storage tile 64 tiley 65 compression zip')
# Seperate extension from filename and rename texture to production pipeline name
finalTextureName, ext = os.path.splitext(os.path.basename(finalTexture))
newTextureName = assetName+'_'+geoName+'_'+shadingPass+ext
newfilepath = os.path.join(assetImageDir,newTextureName)
shutil.copy(finalTexture,newfilepath)
# Output final success message
ui.infoWindow('Your texture was saved to: '+newfilepath+' as a .exr image file')
开发者ID:garretthoyos,项目名称:byu-animation-tools,代码行数:59,代码来源:hou_asset_mgr.py
示例10: convert_texture
def convert_texture(userTextureMap, assetImageDir, folder_name=''):
print userTextureMap
if os.path.isdir(userTextureMap):
return
extensions = ['.jpg','.jpeg','.tiff','.tif','.png','.exr']
userFileName, userExt = os.path.splitext(os.path.basename(userTextureMap))
if userExt not in extensions:
return
# Set Variables for texture paths
convertedTexture = os.path.join('/tmp','intermediate'+userFileName+'.exr')
print "convertedTexture:: "+convertedTexture
finalTexture = os.path.join('/tmp','finished'+userFileName+'.exr')
print "finalTexture:: "+finalTexture
# Gamma correct for linear workflow
if 'DIFF' in userTextureMap or 'diffuse' in userTextureMap:
args = ['icomposite',convertedTexture,'=','gamma',str(1/2.2),userTextureMap]
subprocess.check_call(args)
didgamma = '\nIt has been gamma corrected.'
else:
convertedTexture = userTextureMap
didgamma = ''
# Convert to .exr with otimized settings. Also, setting compatible with RenderMan (in case we need to render there)
args = ['txmake','-mode','periodic','-compression','zip']
args += ['-format','openexr','-half',convertedTexture,finalTexture]
# Uncomment the following and comment out the previous call if PRMan is not present
"""
args = 'iconvert -d half ' + convertedTexture + ' '
args += finalTexture + ' storage tile tilex 32 tiley 32 compression zip'
subprocess.check_call( args.split() )
"""
try:
subprocess.check_call(args)
except subprocess.CalledProcessError as e:
ui.infoWindow('Failed to convert texture. The following error occured:\n' + str(e))
else:
# Rename texture and move into production pipeline
newTextureName = userFileName + '.exr'
newfilepath = os.path.join(assetImageDir, folder_name, newTextureName)
print "new file path:: "+newfilepath
try:
fileutil.move(finalTexture, newfilepath)
except Exception as e:
os.remove(finalTexture)
ui.infoWindow('Failed to move texture. The following error occured:\n' + str(e), msev=messageSeverity.Error)
finally:
if convertedTexture != userTextureMap:
os.remove(convertedTexture)
开发者ID:mybikeislost,项目名称:byu-animation-tools,代码行数:57,代码来源:hou_asset_mgr.py
示例11: rollbackOTL
def rollbackOTL(node = None):
"""Pulls a rollback window for the user to select a version to rollback to. EXACTLY ONE node may be selected, and it MUST be a digital asset.
The node must already exist in the database.
"""
print 'RollbackOTL'
#Need to check if a particular node is a digital asset first. Rollback is will only work as a DA, with model, rigs and animation.
if node != None:
if not ham.isDigitalAsset(node):
ui.infoWindow('Wait! You can only rollback Digital Assets!')
print "NOT A DIGITAL ASSET."
else:
# First, we need to see if this is checked out or not. If it is checked out, then we can proceed. If not, state so.
# For the productions path
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
asset_name, ext = os.path.splitext(filename)
#print "asset_name " + asset_name
toCheckout = os.path.join(ASSETSDIR, asset_name, 'otl')
#print "toCheckout " + toCheckout
myCheckout = False
myCheckout = amu.isCheckedOut(toCheckout)
if myCheckout: #If it has been checked out
myCheckout = amu.checkedOutByMe(toCheckout)
if myCheckout: #If user was the last to checkout
#Here we rollback.
versionedFolders = os.path.join(toCheckout, "src")
#print "versionedFolders ", versionedFolders
versions = glob.glob(os.path.join(versionedFolders, '*'))
#print "selections ", versions
#Wooohoooo!!!
selections = []
selectionInfo = []
nodeInfoDest = toCheckout
for vr in versions:
selections.append(os.path.basename(vr))
comment = amu.getVersionComment(nodeInfoDest,os.path.basename(vr))
selectionInfo.append(comment)
selections.sort()
dialog = VersionDialog()
dialog.addItems(selections,selectionInfo)
dialog.show()
dialog.setParams(versionedFolders,asset_name,toCheckout,True)
pyqt_houdini.exec_(dialog)
else:
hou.ui.displayMessage('Already checked out.')
return
else:
hou.ui.displayMessage('Please checkout asset first.')
else:
print "Node does not exist"
开发者ID:byu-animation,项目名称:ramshorn-tools,代码行数:56,代码来源:houdini_rollback.py
示例12: checkinLightingFile
def checkinLightingFile():
print 'checkin lighting file'
filepath = hou.hipFile.path()
toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
if amu.canCheckin(toCheckin):
hou.hipFile.save()
hou.hipFile.clear()
dest = amu.checkin(toCheckin)
else:
ui.infoWindow('Checkin Failed')
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:10,代码来源:hou_asset_mgr.py
示例13: unlockOTL1
def unlockOTL1():
"""Calls unlockOTL with the selected node"""
node = getSelectedNode()
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
#TODO save this somewhere
unlockOTL(filename)
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:11,代码来源:hou_asset_mgr.py
示例14: checkinLightingFile
def checkinLightingFile():
print("checkin lighting file")
filepath = hou.hipFile.path()
toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
if amu.canCheckin(toCheckin):
hou.hipFile.save()
hou.hipFile.clear()
dest = amu.checkin(toCheckin, False)
srcFile = amu.getAvailableInstallFiles(dest)[0]
amu.install(dest, srcFile)
else:
ui.infoWindow("Checkin Failed")
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:12,代码来源:hou_asset_mgr.py
示例15: getNodeInfo
def getNodeInfo(node):
if node != None and isDigitalAsset(node):
updateDB()
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
nodeInfo = getFileInfo(filename)
message = ""
if nodeInfo[2]:
logname, realname = amu.lockedBy(nodeInfo[3].encode("utf-8"))
message = "Checked out by " + realname + " (" + logname + ")"
else:
message = "Not checked out."
ui.infoWindow(message, wtitle="Node Info")
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:13,代码来源:hou_asset_mgr.py
示例16: getNodeInfo
def getNodeInfo(node):
if isDigitalAsset(node):
updateDB()
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
nodeInfo = getFileInfo(filename)
message = ''
logname, realname = amu.lockedBy(nodeInfo[3].encode('utf-8'))
if nodeInfo[2]:
message = 'Checked out by '+realname+' ('+logname+')'
else:
message = 'Not checked out. Last checked in by '+realname+' ('+logname+')'
ui.infoWindow(message, wtitle='Node Info')
开发者ID:melissaEdge,项目名称:byu-animation-tools,代码行数:13,代码来源:hou_asset_mgr.py
示例17: unlockOTLbyNode
def unlockOTLbyNode(node = None):
"""Calls unlockOTL with the selected node"""
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
reply = ui.warningWindow('WARNING! You are unlocking the Database! \n If you are being dumb, please click \n CANCEL!')
if reply == 0:
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
#TODO save this somewhere
unlockOTL(filename)
else:
ui.infoWindow('Thank you for being safe. \n If you have question please talk to someone in charge.')
开发者ID:mybikeislost,项目名称:byu-animation-tools,代码行数:14,代码来源:hou_asset_mgr.py
示例18: revertChanges
def revertChanges():
updateDB()
node= getSelectedNode()
if node != None:
if not isDigitalAsset(node):
ui.infoWindow("Not a Digital Asset.")
else:
libraryPath = node.type().definition().libraryFilePath()
filename = os.path.basename(libraryPath)
info = getFileInfo(filename)
if info == None:
ui.infoWindow("OTL not in globals folder. Can not revert.")
elif info[2]:
if not node.isLocked() and info[3] == USERNAME:
newfilepath = os.path.join(OTLDIR, filename)
oldfilepath = os.path.join(USERDIR, filename)
switchOPLibraries(oldfilepath, newfilepath)
os.remove(oldfilepath)
createMe = node.type().name()
node.destroy()
hou.node('/obj').createNode(createMe)
unlockOTL(filename)
ui.infoWindow("Revert Successful!")
else:
ui.infoWindow("Select EXACTLY one node.")
开发者ID:splodingsocks,项目名称:byu-animation-tools,代码行数:25,代码来源:hou_asset_mgr.py
示例19: checkinLightingFile
def checkinLightingFile():
print('checkin lighting file')
filepath = hou.hipFile.path()
toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
backups = os.path.join(toCheckin, 'backup')
print 'backup = ' + backups
if os.path.isdir(backups):
os.system('rm -rf '+backups)
if amu.canCheckin(toCheckin):
hou.hipFile.save()
hou.hipFile.clear()
dest = amu.checkin(toCheckin, False)
srcFile = amu.getAvailableInstallFiles(dest)[0]
amu.install(dest, srcFile)
else:
ui.infoWindow('Checkin Failed')
开发者ID:mybikeislost,项目名称:byu-animation-tools,代码行数:16,代码来源:hou_asset_mgr.py
示例20: new
def new():
updateDB()
otb = ("Container", "Geometry", "Cancel")
optype = ui.infoWindow("Choose operator type.", wbuttons=otb, wtitle="Asset Type")
hpath = determineHPATH()
if optype == 0:
newContainer(hpath)
elif optype == 1:
newGeo(hpath)
开发者ID:kgoulding,项目名称:byu-animation-tools,代码行数:9,代码来源:hou_asset_mgr.py
注:本文中的ui_tools.ui.infoWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论