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


Python cmds.loadPlugin方法代码示例

本文整理汇总了Python中maya.cmds.loadPlugin方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.loadPlugin方法的具体用法?Python cmds.loadPlugin怎么用?Python cmds.loadPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maya.cmds的用法示例。


在下文中一共展示了cmds.loadPlugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loadPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例2: checkLoadedPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例3: close_event

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例4: loadSSDSolverPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例5: loadDeltaMushPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例6: launch

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def launch():
    '''
    Main entry point
    '''
    log.info('Deformation Learning v%s : Author: %s' % (getVersion(), getAuthor()))
    log.info('Deformation Learning Setup Calls :: Booting from >> %s' % getModulePath())  

    # Add module to environment
    os.environ[__ENVIRONMENT_NAME__] = getModulePath()    
    # addScriptsPath(os.environ[__ENVIRONMENT_NAME__])

    # Load Plug-in
    loadPlugin()    

    # launch UI
    show()

    log.info('Deformation Learning initialize Complete!') 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:20,代码来源:setup.py

示例7: doit

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def doit(cage_tgt=None):
    if not cage_tgt:
        cage_tgt = cmds.ls(sl=True, o=True)
    cage = cage_tgt[0]
    tgt = cage_tgt[1:]

    cmds.loadPlugin('greenCageDeformer.py', qt=True)
    deformer = cmds.deformer(tgt, type='greenCageDeformer')[0]

    freezer = cmds.createNode('transformGeometry')
    cmds.connectAttr(cage + '.o', freezer + '.ig')
    cmds.connectAttr(cage + '.wm', freezer + '.txf')
    cmds.connectAttr(freezer + '.og', deformer + '.bc')
    cmds.disconnectAttr(freezer + '.og', deformer + '.bc')
    cmds.delete(freezer)

    cmds.connectAttr(cage + '.w', deformer + '.ic')
    cmds.dgeval(cmds.listConnections(deformer + '.og', s=False, d=True, sh=True, p=True))


#doit([cmds.polyCube(w=2.5, d=2.5, h=2.5)[0], cmds.polySphere()[0]]) 
开发者ID:ryusas,项目名称:maya_greenCageDeformer,代码行数:23,代码来源:createGreenCageDeformer.py

示例8: doit

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def doit(radius=5., num=36):
    cmds.loadPlugin('rotationDriver', qt=True)
    node = cmds.createNode('composeRotate')
    node_or = node + '.outRotate'
    node_h = node + '.bendH'
    node_v = node + '.bendV'

    shiftX = radius * 1.25

    top0 = _plotBendHV(node_or, node_h, node_v, 'plotStereoProj', radius, num)
    cmds.setAttr(top0 + '.tx', -shiftX)

    cmds.setAttr(node + '.method', 1)
    top1 = _plotBendHV(node_or, node_h, node_v, 'plotExpmap', radius, num)
    cmds.setAttr(top1 + '.tx', shiftX)

    cmds.delete(node)

    cmds.select([top0, top1]) 
开发者ID:ryusas,项目名称:maya_rotationDriver,代码行数:21,代码来源:plotBendHV.py

示例9: __init__

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例10: load_plugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [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

示例11: loadPlugin

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def loadPlugin():
    """"""
    loadSSDSolverPlugin()
    loadDeltaMushPlugin()

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

示例12: btnCallCppPlugin_clicked

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def btnCallCppPlugin_clicked(self):
        print('btnCallCppPlugin_clicked')
        try:
            cmds.loadPlugin('HelloMaya')
            cmds.myCmd1()
            cmds.hello()
        except Exception as ex:
            cmds.error(ex.message) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:10,代码来源:MyWindow.py

示例13: btnCallCSPlugin_clicked

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def btnCallCSPlugin_clicked(self):
        print('btnCallCSPlugin_clicked')
        try:
            cmds.loadPlugin('HiMaya2017')
            cmds.csHi()
        except Exception as ex:
            cmds.error(ex.message) 
开发者ID:WendyAndAndy,项目名称:MayaDev,代码行数:9,代码来源:MyWindow.py

示例14: reloadRush

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def reloadRush():
    try:
        cmds.unloadPlugin("Rush.py")
        cmds.loadPlugin("Rush.py")
    except Exception:
        print("Failed to reload plugin") 
开发者ID:minoue,项目名称:rush,代码行数:8,代码来源:utils.py

示例15: install

# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import loadPlugin [as 别名]
def install():
    """Load this shared as a plug-in

    Call this prior to using the shared

    """

    if ENABLE_UNDO:
        cmds.loadPlugin(__file__, quiet=True)

    self.installed = True 
开发者ID:mottosso,项目名称:cmdx,代码行数:13,代码来源:cmdx.py


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