本文整理汇总了Python中maya.cmds.pluginInfo方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.pluginInfo方法的具体用法?Python cmds.pluginInfo怎么用?Python cmds.pluginInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.cmds
的用法示例。
在下文中一共展示了cmds.pluginInfo方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkLoadedPlugin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def checkLoadedPlugin(pluginName, exceptName=None, message="Not loaded plugin", *args):
""" Check if plugin is loaded and try to load it.
Returns True if ok (loaded)
Returns False if not found or not loaded.
"""
loadedPlugin = True
if not (cmds.pluginInfo(pluginName, query=True, loaded=True)):
loadedPlugin = False
try:
# Maya 2012
cmds.loadPlugin(pluginName+".mll")
loadedPlugin = True
except:
if exceptName:
try:
# Maya 2013 or earlier
cmds.loadPlugin(exceptName+".mll")
loadedPlugin = True
except:
pass
if not loadedPlugin:
print message, pluginName
return loadedPlugin
示例2: close_event
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def close_event(self):
self.remove_callbacks()
# if __name__ == 'manager':
#
# # spore_root = os.path.dirname(__file__)
# # os.environ['SPORE_ROOT_DIR'] = spore_root
#
# # if not spore_root in sys.path:
# # sys.path.append(spore_root)
# #
# #
# # if not cmds.pluginInfo('spore_plugin', q=True, l=True):
# # cmds.loadPlugin(os.path.join(spore_root, 'plugins', 'spore_plugin.py'))
# #
# # global manager
# if not manager:
# manager = SporeManager()
#
# manager.show()
示例3: loadSSDSolverPlugin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def loadSSDSolverPlugin():
""""""
os = cmds.about(os=1)
if os == 'win64':
pluginName = '%s.mll' % (SSD_SOLVER_PLUGIN_BASE_NAME)
elif os == 'mac':
pluginName = '%s.bundle' % (SSD_SOLVER_PLUGIN_BASE_NAME)
elif os == 'linux64':
pluginName = '%s.so' % (SSD_SOLVER_PLUGIN_BASE_NAME)
if not cmds.pluginInfo(pluginName, q=True, l=True ):
try:
cmds.loadPlugin(pluginName)
pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
log.info('Plug-in: %s v%s loaded success!' % (pluginName, pluginVers))
except:
log.info('Plug-in: %s, was not found on MAYA_PLUG_IN_PATH.' % (pluginName))
else:
pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
log.info('Plug-in: %s v%s has been loaded!' % (pluginName, pluginVers))
#----------------------------------------------------------------------
示例4: loadDeltaMushPlugin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def loadDeltaMushPlugin():
""""""
os = cmds.about(os=1)
if os == 'win64':
pluginName = '%s.mll' % (DELTA_MUSH_PLUGIN_BASE_NAME)
elif os == 'mac':
pluginName = '%s.bundle' % (DELTA_MUSH_PLUGIN_BASE_NAME)
elif os == 'linux64':
pluginName = '%s.so' % (DELTA_MUSH_PLUGIN_BASE_NAME)
if not cmds.pluginInfo(pluginName, q=True, l=True ):
try:
cmds.loadPlugin(pluginName)
pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
log.info('Plug-in: %s v%s loaded success!' % (pluginName, pluginVers))
except:
log.info('Plug-in: %s, was not found on MAYA_PLUG_IN_PATH.' % (pluginName))
else:
pluginVers = cmds.pluginInfo(pluginName, q=1, v=1)
log.info('Plug-in: %s v%s has been loaded!' % (pluginName, pluginVers))
#----------------------------------------------------------------------
示例5: loadPlugin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def loadPlugin(plugin):
"""
This decorator can be used on functions that require a certain plugin to
be loaded.
:param str plugin:
"""
def wrapper(func):
@wraps(func)
def inner(*args, **kwargs):
loaded = cmds.pluginInfo(plugin, q=True, loaded=True)
registered = cmds.pluginInfo(plugin, q=True, registered=True)
if not registered or not loaded:
cmds.loadPlugin(plugin)
return func(*args, **kwargs)
return inner
return wrapper
示例6: createShakeNode
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [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
示例7: __init__
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def __init__(self):
Settings.__init__(self)
# variables
self._name = None
self._curve = None
# control variables
self._controls = []
self._rootControl = None
self._tangentControls = None
# slide control variables
self._slideControl = None
self._slideMinControl = None
self._slideMaxControl = None
# joints variables
self._joints = []
self._rootJoint = None
# load matrix nodes plugin
if not cmds.pluginInfo(MATRIX_PLUGIN, query=True, loaded=True):
cmds.loadPlugin(MATRIX_PLUGIN)
# ------------------------------------------------------------------------
示例8: load_plugin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def load_plugin(cls, plugin):
if cmds.pluginInfo(plugin, q=True, l=True):
cmds.unloadPlugin(plugin)
cmds.loadPlugin(plugin, qt=True)
cls.plugins.add(plugin)
示例9: loadModule
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def loadModule(modulePath):
""" Load module
Args:
modulePath (str): Full path to the python module
Return:
mod (module object): command module
None: if path doesn't exist
"""
# Create module names for import, for exapmle ...
#
# "rush/template"
# "animation/animate"
# "common/create"
# "common/display"
normPath = os.path.normpath(modulePath)
if sys.platform == "win32":
name = os.path.splitext(normPath)[0].split("\\")
else:
name = os.path.splitext(normPath)[0].split("/")
name = "/".join(name[-2:])
# If arnold is not loaded or installed, ignore modules for arnold
if name.startswith("Arnold"):
hasArnold = cmds.pluginInfo("mtoa", q=True, loaded=True)
if not hasArnold:
return None
try:
mod = imp.load_source(name, modulePath)
return mod
except Exception:
print("Failed to load module : %s" % modulePath)
return None
示例10: fbxVersion
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import pluginInfo [as 别名]
def fbxVersion(self):
for plugin in cmds.pluginInfo(q=True, listPlugins=True):
if "fbxmaya" in plugin:
return cmds.pluginInfo(plugin, q=True, version=True)