本文整理汇总了Python中maya.cmds.showHelp函数的典型用法代码示例。如果您正苦于以下问题:Python showHelp函数的具体用法?Python showHelp怎么用?Python showHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showHelp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SundayInstallPipelineCheckForUpdate
def SundayInstallPipelineCheckForUpdate(mode):
import SundaySetupPublicPy as SundaySetupPublicPy
reload(SundaySetupPublicPy)
import SundayDialogPy as SundayDialogPy
reload(SundayDialogPy)
fetchFile = tempfile.gettempdir() + os.sep + 'SundayInstallPipelinePublicPy.py'
try:
open(fetchFile, 'wb').write(urllib2.urlopen('http://3dg.dk/sundaypipeline/mayapublic/SundayInstallPipelinePublicPy.temp').read())
except:
if mode == 'active':
SundayDialogPy.SundayDialogConfirm('Error Fetching Pipeline From Online Repository ', 'Check Net Connection or Firewall Settings', 'OK')
else:
print 'Error Fetching Pipeline From Online Repository - Check Net Connection or Firewall Settings'
return None
onlineVersion = imp.load_source('module.name', fetchFile).SundayInstallPipelineVersion()
if onlineVersion > SundayInstallPipelineVersion():
updateResult = SundayDialogPy.SundayDialogPromptYesNoCancel('New Sunday Pipeline Version: ' + str(onlineVersion) + ' ', 'Update now?', ' CHANGE LOG ', 'YES', 'NO')
if updateResult == 'YES':
try:
SundaySetupPublicPy.SundaySetupSettingssUIClose()
except:
pass
imp.load_source('module.name', fetchFile).SundayInstallPipeline()
if updateResult == ' CHANGE LOG ':
cmds.showHelp('http://www.3dg.dk/2011/08/12/sunday-pipeline-maya-public/#changelog', absolute = True)
elif mode == 'active':
SundayDialogPy.SundayDialogConfirm('Sunday Pipeline Is Up To Date ', 'Current Version: ' + str(SundayInstallPipelineVersion()), 'OK')
else:
print 'Sunday Pipeline Is Up To Date. Current Version: ' + str(SundayInstallPipelineVersion())
示例2: mayaDocsLocation
def mayaDocsLocation(version=None):
docLocation = None
if (version == None or version == versions.installName() ) and mayaIsRunning():
# Return the doc location for the running version of maya
from maya.cmds import showHelp
docLocation = showHelp("", q=True, docs=True)
# Older implementations had no trailing slash, but the result returned by
# showHelp has a trailing slash... so eliminate any trailing slashes for
# consistency
while docLocation != "" and os.path.basename(docLocation) == "":
docLocation = os.path.dirname(docLocation)
# Want the docs for a different version, or maya isn't initialized yet
if not docLocation or not os.path.isdir(docLocation):
docLocation = getMayaLocation(version) # use original version
if docLocation is None and version is not None:
docLocation = getMayaLocation(None)
_logger.warning("Could not find an installed Maya for exact version %s, using first installed Maya location found in %s" % (version, docLocation) )
if version:
short_version = versions.parseVersionStr(version, extension=False)
else:
short_version = versions.shortName()
if platform.system() == 'Darwin':
docLocation = os.path.dirname(os.path.dirname(docLocation))
docLocation = os.path.join(docLocation , 'docs/Maya%s/en_US' % short_version)
return os.path.realpath(docLocation)
示例3: upToDateCheck
def upToDateCheck(revision, prompt=True):
'''
This is a check that can be run by scripts that import ml_utilities to make sure they
have the correct version.
'''
if not '__revision__' in locals():
return
if revision > __revision__:
if prompt and mc.optionVar(query='ml_utilities_revision') < revision:
result = mc.confirmDialog( title='Module Out of Date',
message='Your version of ml_utilities may be out of date for this tool. Without the latest file you may encounter errors.',
button=['Download Latest Revision','Ignore', "Don't Ask Again"],
defaultButton='Download Latest Revision', cancelButton='Ignore', dismissString='Ignore' )
if result == 'Download Latest Revision':
mc.showHelp('http://morganloomis.com/download/ml_utilities.py', absolute=True)
elif result == "Don't Ask Again":
mc.optionVar(intValue=('ml_utilities_revision', revision))
return False
return True
示例4: context_menu
def context_menu():
"""
Create context menu for output window.
"""
# context menu
output_win = cmds.cmdScrollFieldReporter(SCRIPT_OUTPUT_SCROLLFIELD, fst="")
cmds.popupMenu(parent=output_win)
cmds.menuItem(
label="Clear Output", command=lambda c: cmds.cmdScrollFieldReporter(output_win, e=True, clear=True)
)
# Echo all commands toggle
cmds.menuItem(
label="Toggle Echo Commands",
command=lambda c: cmds.commandEcho(state=not (cmds.commandEcho(q=True, state=True))),
)
# Go to python reference
cmds.menuItem(label="Python Command Reference", command=lambda c: cmds.showHelp("DocsPythonCommands"))
示例5: script_output
def script_output(direction):
"""
Script output dock for layouts.
"""
dock_control = config['WINDOW_SCRIPT_OUTPUT_DOCK']
dock_window = config['WINDOW_SCRIPT_OUTPUT']
if cmds.dockControl(dock_control, ex=True):
return cmds.dockControl(dock_control, e=True, vis=True, fl=False)
if cmds.window(dock_window, ex=True):
main_win = dock_window
else:
main_win = cmds.window(dock_window, title='Output Window')
cmds.paneLayout(parent=main_win)
# context menu
output_win = cmds.cmdScrollFieldReporter(fst="")
cmds.popupMenu(parent=output_win)
cmds.menuItem(
label='Clear Output',
command=lambda c: cmds.cmdScrollFieldReporter(
output_win, e=True, clear=True),
)
# Echo all commands toggle
cmds.menuItem(
label='Toggle Echo Commands',
command=lambda c: cmds.commandEcho(
state=not(cmds.commandEcho(q=True, state=True))),
)
# Go to python reference
cmds.menuItem(
label='Python Command Reference',
command=lambda c: cmds.showHelp('DocsPythonCommands'),
)
cmds.dockControl(
dock_control,
content=main_win,
label='Output Window',
area=direction,
height=500,
floating=False,
allowedArea=['left', 'right']
)
示例6: myHelp
def myHelp():
cmds.showHelp("Commands/showHelp.html", docs=True)
示例7: main
__category__ = 'animationScripts'
__revision__ = 1
import maya.cmds as mc
try:
import ml_utilities as utl
utl.upToDateCheck(22)
except ImportError:
result = mc.confirmDialog( title='Module Not Found',
message='This tool requires the ml_utilities module. Once downloaded you will need to restart Maya.',
button=['Download Module','Cancel'],
defaultButton='Cancel', cancelButton='Cancel', dismissString='Cancel' )
if result == 'Download Module':
mc.showHelp('http://morganloomis.com/download/animationScripts/ml_utilities.py',absolute=True)
def main():
sel = mc.ls(sl=True)
if not sel:
raise RuntimeError('Please select an object.')
if [x for x in sel if not mc.attributeQuery('translate', exists=True, node=x)]:
raise RuntimeError('Only works on transform nodes, please adjust your selection.')
frameRate = utl.getFrameRate()
timeFactor = 1.0/frameRate
示例8: main
__revision__ = 6
import maya.cmds as mc
import maya.mel as mm
try:
import ml_utilities as utl
utl.upToDateCheck(8)
except ImportError:
result = mc.confirmDialog( title='Module Not Found',
message='This tool requires the ml_utilities module. Once downloaded you will need to restart Maya.',
button=['Download Module','Cancel'],
defaultButton='Cancel', cancelButton='Cancel', dismissString='Cancel' )
if result == 'Download Module':
mc.showHelp('http://morganloomis.com/download/ml_utilities.py',absolute=True)
def main(selectedChannels=True, transformsOnly=False):
'''
Resets selected channels in the channel box to default, or if nothing's
selected, resets all keyable channels to default.
'''
gChannelBoxName = mm.eval('$temp=$gChannelBoxName')
sel = mc.ls(sl=True)
if not sel:
return
chans = None
if selectedChannels:
chans = mc.channelBox(gChannelBoxName, query=True, sma=True)
示例9: main
def main():
'''
This just launches the online help and serves as a placeholder for the default function for this script.
'''
mc.showHelp(wikiURL+'#ml_utilities', absolute=True)
示例10: ui
from functools import partial
import maya.cmds as mc
from maya import OpenMaya
try:
import ml_utilities as utl
utl.upToDateCheck(32)
except ImportError:
result = mc.confirmDialog( title='Module Not Found',
message='This tool requires the ml_utilities module. Once downloaded you will need to restart Maya.',
button=['Download Module','Cancel'],
defaultButton='Cancel', cancelButton='Cancel', dismissString='Cancel' )
if result == 'Download Module':
mc.showHelp('http://morganloomis.com/tool/ml_utilities/',absolute=True)
def ui():
'''
User interface for world bake
'''
with utl.MlUi('ml_worldBake', 'World Bake', width=400, height=175, info='''Select objects, bake to locators in world, camera, or custom space.
When you're ready to bake back, select locators
and bake "from locators" to re-apply your animation.''') as win:
mc.checkBoxGrp('ml_worldBake_bakeOnOnes_checkBox',label='Bake on Ones',
annotation='Bake every frame. If deselected, the tool will preserve keytimes.')
tabs = mc.tabLayout()
tab1 = mc.columnLayout(adj=True)
示例11: ui
__revision__ = 4
import maya.cmds as mc
import maya.mel as mm
from maya import OpenMaya
import random
try:
import euclid
except ImportError:
result = mc.confirmDialog( title='Module Not Found',
message='This tool requires the euclid module, which can be downloaded for free from the internet. Once downloaded you will need to restart Maya.',
button=['Go To Website','Cancel'],
defaultButton='Cancel', cancelButton='Cancel', dismissString='Cancel' )
if result != 'Cancel':
mc.showHelp('http://partiallydisassembled.net/euclid.html',absolute=True)
try:
import ml_utilities as utl
utl.upToDateCheck(9)
except ImportError:
result = mc.confirmDialog( title='Module Not Found',
message='This tool requires the ml_utilities module. Once downloaded you will need to restart Maya.',
button=['Download Module','Cancel'],
defaultButton='Cancel', cancelButton='Cancel', dismissString='Cancel' )
if result == 'Download Module':
mc.showHelp('http://morganloomis.com/download/animationScripts/ml_utilities.py',absolute=True)
def ui():
示例12: SundayPlusSaveWrongFileConvention
def SundayPlusSaveWrongFileConvention():
plusSaveHelpDialog = SundayDialogPy.SundayDialogPromptYesNo('Error ', 'Scene is not the right file convention: Name_###_Author.mb', 'OK', 'HELP')
if plusSaveHelpDialog == 'HELP':
cmds.showHelp('http://www.3dg.dk/2011/12/07/sunday-pipeline-plus-save/', absolute = True)
示例13: googleSearch
def googleSearch( item ):
google = r'http://www.google.com/search?sourceid=chrome&ie=UTF-8&q='
cmds.showHelp( google + item, absolute=True )
示例14: myHelp
def myHelp():
cmds.showHelp( 'Commands/showHelp.html', docs=True )
示例15: SundayGeometryCacheShowHelp
def SundayGeometryCacheShowHelp():
cmds.showHelp('http://www.3dg.dk/2011/12/07/sunday-pipeline-maya-geometry-cache/', absolute = True)