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


Python cmds.pluginInfo方法代码示例

本文整理汇总了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 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:25,代码来源:dpUtils.py

示例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() 
开发者ID:wiremas,项目名称:spore,代码行数:24,代码来源:manager.py

示例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))

#---------------------------------------------------------------------- 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:25,代码来源:setup.py

示例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))

#---------------------------------------------------------------------- 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:25,代码来源:setup.py

示例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 
开发者ID:robertjoosten,项目名称:maya-skinning-tools,代码行数:21,代码来源:decorator.py

示例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 
开发者ID:justinfx,项目名称:tutorials,代码行数:26,代码来源:shakeNodeCmd.py

示例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)
        
    # ------------------------------------------------------------------------ 
开发者ID:robertjoosten,项目名称:maya-spline-ik,代码行数:28,代码来源:create.py

示例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) 
开发者ID:wiremas,项目名称:spore,代码行数:7,代码来源:test_util.py

示例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 
开发者ID:minoue,项目名称:rush,代码行数:41,代码来源:__init__.py

示例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) 
开发者ID:chrisevans3d,项目名称:uExport,代码行数:6,代码来源:uExport.py


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