• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python cmds.pluginInfo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadSceneAssemblyPlugins

def loadSceneAssemblyPlugins(tankError = False):
        ## PLUGIN CHECK
        ## First try to make sure the plugins are loaded in maya
        if not cmds.pluginInfo('AbcExport.mll', query = True, loaded = True):
            try:
                cmds.loadPlugin('AbcExport.mll')
            except RuntimeError:
                if TankError:
                    raise TankError("AbcExport failed to load!!")
        if not cmds.pluginInfo('AbcImport.mll', query = True, loaded = True):
            try:
                cmds.loadPlugin('AbcImport.mll')
            except RuntimeError:
                if TankError:
                    raise TankError("AbcImport plugin failed to load!!")
        if not cmds.pluginInfo('gpuCache.mll', query = True, loaded = True):
            try:
                cmds.loadPlugin('gpuCache.mll')
            except RuntimeError:
                if TankError:
                    raise TankError("gpuCache plugin failed to load!!")            
        if not cmds.pluginInfo('sceneAssembly.mll', query = True, loaded = True):
            try:
                cmds.loadPlugin('sceneAssembly.mll')
            except RuntimeError:
                if TankError:
                    raise TankError("sceneAssembly plugin failed to load!!")   
开发者ID:vipul-rathod,项目名称:lsapipeline,代码行数:27,代码来源:utils.py


示例2: __init__

	def __init__(self):
		'''
		load fbxmaya plugin in initialisation
		'''
		try:
			plugin = cmds.pluginInfo( query=True, listPlugins=True, version=True )
			fbxplugin = 'fbxmaya'
			
			if cmds.pluginInfo(fbxplugin+ ".mll", query=True, loaded=True):
				cmds.pluginInfo(fbxplugin + ".mll", edit=True, autoload=True)
			else:
				cmds.loadPlugin(fbxplugin + ".mll")
		except:
			print "fbxMaya was not found on MAYA_PLUG_IN_PATH:", sys.exc_info()[0]

		self.listGrp = []
		self.children = []
		self.childrenLong = []
#		self.listGrp.append('FG')
#		self.listGrp.append('BG')
#		self.listGrp.append('MG')
		self.listGrp = ['fg','mg','bg']

		self.upperL = r'''[A-Z]'''
		'''
		window variables
		'''
		self.win = "fbxExport"
		self.fbxPath1 = "textfield"
		self.fbxPath2 = "button"
		self.expPath = ""
开发者ID:teddygo,项目名称:codha,代码行数:31,代码来源:+maya_Stereo_Fbx.py


示例3: enableaPlugin

def enableaPlugin(filename):
    extDict = {'win64':'mll','mac':'bundle','linux':'so','linux64':'so'}
    os = cmds.about(os=True)
    ext = extDict[os]
    version = cmds.about(v=True)[:4]
    pluginName = 'deltaMushToSkinCluster_%s' % version
    fileFullName = '%s.%s' % (pluginName,ext)
    rootPath = getParentPath(currentFileDirectory())
    pluginsPath = rootPath+'/plug-ins/'
    pluginFilePath = pluginsPath+fileFullName
    pluginStr = mel.eval('getenv "MAYA_PLUG_IN_PATH";')+';'+pluginsPath
    mel.eval('putenv "MAYA_PLUG_IN_PATH" "%s";' % pluginStr)
    with open(filename,'a+') as f:
        state = True
        for line in f.readlines():
            if re.findall(fileFullName,line):
                state = False
        if state:
            f.write(r'evalDeferred("autoLoadPlugin(\"\", \"%s\", \"%s\")");' % (fileFullName,pluginName))

    if not cmds.pluginInfo( pluginFilePath, query=True, autoload=True):
        cmds.pluginInfo( pluginFilePath, edit=True, autoload=True)

    if not cmds.pluginInfo(pluginFilePath,query=True,loaded=True):
        cmds.loadPlugin(pluginFilePath)
开发者ID:jeanim,项目名称:deltaMushToSkinCluster,代码行数:25,代码来源:dm2scSetup.py


示例4: loadPlugin

def loadPlugin():
    """
    load softSelectionQuery plugin
    """
    
    mayaVers = int(mayaVersion())
    os = cmds.about(os=1)
    
    if os == 'win64':
        pluginName = 'softSelectionQuery_%s-x64.mll' % mayaVers
    elif os == 'mac':
        pluginName = 'softSelectionQuery_%s.bundle' % mayaVers
    elif os == 'linux64':
        pluginName = 'softSelectionQuery_%s.so' % mayaVers
    else:
        cmds.error('Soft Cluster EX is available for 64bit version of Autodesk Maya 2011 '
                  'or above under Windows 64bit, Mac OS X and Linux 64bit!')
    
    if not cmds.pluginInfo(pluginName, q=True, l=True ):
        cmds.loadPlugin(pluginName)
        version = cmds.pluginInfo(pluginName, q=1, v=1)
        log.info('Plug-in: %s v%s loaded success!' % (pluginName, version))
    else:
        version = cmds.pluginInfo(pluginName, q=1, v=1)
        log.info('Plug-in: %s v%s has been loaded!' % (pluginName, version))
开发者ID:griffinanimator,项目名称:ThirdParty,代码行数:25,代码来源:setup.py


示例5: setupScene

def setupScene():
	'''
	Setup some scene attributes we want to be common to all Spinifex car scenes
	TODO:
	make width over height as float
	'''
		
	# Check if we haven't done this before
	if cmds.objExists('vraySettings.setupSceneHasBeenRun'):
		# Check that everything is setup correctly before continuing.
		dialogMessage = 'setupScene has already been run. Do you wish to continue? Some of your render settings will be reset.'
		result = cmds.confirmDialog( title='spckSetupScene', message=dialogMessage, button=['YES','NO'], defaultButton='NO', cancelButton='NO', dismissString='NO' )
		if result == 'NO' :
			print("Aborted. We\'ve done this before...\n")
			return
	else:
		# Check that everything is setup correctly before continuing.
		dialogMessage = 'Have you set up your workspace.mel?'
		result = cmds.confirmDialog( title='spckSetupScene', message=dialogMessage, button=['YES','NO'], defaultButton='YES', cancelButton='NO', dismissString='NO' )
		if result == 'NO' :
			print('Go setup your workspace and run again.\n')
			return
		
	# Units for working in metric and 30fps
	cmds.currentUnit (linear='cm')
	cmds.currentUnit (angle='deg')
	cmds.currentUnit (time='ntsc')

	# Load VRAY if not active
	cmds.loadPlugin ('vrayformaya', quiet=True)
	cmds.pluginInfo ('vrayformaya', edit=True, autoload=True)
	cmds.setAttr  ('defaultRenderGlobals.ren', 'vray', type='string')

	cmds.evalDeferred ( 'createBaseRenderSettings()' , lowestPriority=True )	
	print('Success.\n')
开发者ID:mybikeislost,项目名称:studio_pipeline,代码行数:35,代码来源:setupScene.py


示例6: remove_unknown_nodes

def remove_unknown_nodes():
    removed_count = 0

    unknown_nodes = cmds.ls(type="unknown")
    for node in unknown_nodes:
        if cmds.objExists(node):
            sys.stdout.write("Remove unknown node '{}'.\n".format(node))
            cmds.lockNode(node, lock=False)
            cmds.delete(node)
            removed_count += 1

    if cmds.pluginInfo("Turtle.mll", q=True, loaded=True):
        cmds.pluginInfo("Turtle.mll", e=True, autoload=False)
        cmds.unloadPlugin("Turtle.mll", force=True)
    turtle_nodes = ["TurtleDefaultBakeLayer",
                    "TurtleBakeLayerManager",
                    "TurtleRenderOptions",
                    "TurtleUIOptions"]
    for node in turtle_nodes:
        if cmds.objExists(node):
            sys.stdout.write("Remove Turtle node '{}'.\n".format(node))
            cmds.lockNode(node, lock=False)
            cmds.delete(node)
            removed_count += 1

    sys.stdout.write(str(removed_count) + " unknown nodes removed.\n")
开发者ID:Kapukw,项目名称:vfxutils,代码行数:26,代码来源:SceneTweaks.py


示例7: loadMentalRayPlugin

def loadMentalRayPlugin():
    name = 'Mayatomr'
    if not cmds.pluginInfo(name, q=True, loaded=True):
        cmds.loadPlugin(name)
        cmds.pluginInfo(name, edit=True, autoload=True)
    cmds.setAttr('defaultRenderGlobals.currentRenderer', 'mentalRay', type='string')
    print ('# Result: mental ray Plugin loaded #')
开发者ID:wenlongx,项目名称:Maya-Cloth-Simulation,代码行数:7,代码来源:ao.py


示例8: initializePlugin

def initializePlugin(obj):
    plugin = OpenMayaMPx.MFnPlugin(obj)

    try:
        plugin.registerNode(ms_environment_nodeTypeName, ms_environment_nodeTypeId, ms_environment_nodeCreator, ms_environment_nodeInitializer, OpenMayaMPx.MPxNode.kLocatorNode)
    except:
        sys.stderr.write("Failed to register node: %s" % ms_environment_nodeTypeName)

    try:
        plugin.registerNode(ms_renderSettings_nodeTypeName, ms_renderSettings_nodeTypeId, ms_renderSettings_nodeCreator, ms_renderSettings_nodeInitializer)
    except:
        sys.stderr.write("Failed to register node: %s\n" % ms_renderSettings_nodeTypeName)

    # load objExport plugin if its not loaded yet
    try:
        if not cmds.pluginInfo('objExport', query=True, loaded=True):
            cmds.loadPlugin('objExport')
        if not cmds.pluginInfo('ms_appleseed_material.py', query=True, loaded=True):
            cmds.loadPlugin('ms_appleseed_material.py')
        if not cmds.pluginInfo('ms_appleseed_shading_node.py', query=True, loaded=True):
            cmds.loadPlugin('ms_appleseed_shading_node.py')
    except: 
        print 'objExport plugin could not be loaded, cannot load mayaseed'

    ms_menu.createMenu()
    ms_menu.buildMenu()
开发者ID:dictoon,项目名称:mayaseed,代码行数:26,代码来源:mayaseed.py


示例9: loadDecomposeMatDll

	def loadDecomposeMatDll(self):
		mversion = (maya.mel.eval("float $mayaVersion = `getApplicationVersionAsFloat` ;"))
		if(mversion >2012):
			if not cmds.pluginInfo(("matrixNodes.mll"),q=True,loaded=True):
				cmds.loadPlugin("matrixNodes.mll")
				#set autoloaded
				cmds.pluginInfo("matrixNodes.mll",e=True,autoload=True)
开发者ID:kangchihlun,项目名称:RealTimeSpringMaya,代码行数:7,代码来源:dllCopier.py


示例10: isPluginNode

 def isPluginNode(nodeName):
     import maya.cmds as cmds
     for plugin in cmds.pluginInfo(q=1, listPlugins=True):
         plugNodes = cmds.pluginInfo(plugin, q=1, dependNode=True)
         # plugNodes may be None...
         if plugNodes and nodeName in plugNodes:
             return True
     return False
开发者ID:SarielD,项目名称:pymel,代码行数:8,代码来源:apicache.py


示例11: load_plugin

 def load_plugin(self, pluginName):
     if self.is_plugin_loaded(pluginName):
         return True
     try:
         cmds.loadPlugin(pluginName, quiet=True)
         cmds.pluginInfo(pluginName, edit=True, autoload=True)
         return True
     except:
         return False
开发者ID:ahmidou,项目名称:aphid,代码行数:9,代码来源:RenderOps.py


示例12: setUpAll

	def setUpAll(cls):
		if cls.env_var_plugin_path not in os.environ:
			raise AssertionError("Missing configuration variable: %s" % cls.env_var_plugin_path)
		#END handle conf
		cls.test_plugin_path = os.environ[cls.env_var_plugin_path]
		if not cmds.pluginInfo(cls.test_plugin_path, q=1, loaded=1):
			cmds.loadPlugin(cls.test_plugin_path)
			# even though loadPlugin may fail, it doesn't throw a runtime error
			if not cmds.pluginInfo(cls.test_plugin_path, q=1, loaded=1):
				raise AssertionError("Failed to load plugin at %s" % cls.test_plugin_path)
开发者ID:Byron,项目名称:bsuite,代码行数:10,代码来源:util.py


示例13: test

	def test(self):
		"""
		Run an internal consistency test on the pattern creator to verify its
		functions are operating correctly.
		"""
		factoryIsLoaded = cmds.pluginInfo('pyJsonAttrPatternFactory.py', query=True, loaded=True)
		if not factoryIsLoaded:
			try:
				cmds.loadPlugin('pyJsonAttrPatternFactory.py', quiet=True)
			except:
				# Repotest environment won't find it so skip it then
				return False
		factoryIsLoaded = cmds.pluginInfo('pyJsonAttrPatternFactory.py', query=True, loaded=True)
		# If the environment isn't set up to find the plugin there's
		# nothing we can do about it. It's not a failure of the test so
		# don't report anything other than a warning that the test could
		# not be run.
		if not factoryIsLoaded:
			print 'Warning: JSON attribute pattern factory could not be loaded, test aborted'
			return False

		patterns = """
		[
			{
				"name": "testPattern",
				"attributes": [
					{
						"name"			: "floatWithRanges",
						"shortName"		: "fwr",
						"defaultValue"	: 0.5,
						"min"			: -10.0,
						"max"			: 20.0,
						"softMin"		: 1.0,
						"softMax"		: 10.0,
						"attributeType"	: "float"
					} ,
					{
						"name"			: "float3WithRanges",
						"shortName"		: "ftwr",
						"defaultValue"	: [7.5, 7.6, 7.7],
						"min"			: [-17.0, -17.1, -17.2],
						"max"			: [27.0, 27.1, 27.2],
						"attributeType"	: "float3"
					} 
				]
			}
		]
		"""
		cmds.createAttrPatterns( patternType='json', patternDefinition=patterns )
		cmds.file( force=True, new=True )
		node = cmds.createNode( 'addMatrix' )
		cmds.applyAttrPattern( node, patternName='testPattern' )

		jsonString = self.nodeAsJSON( node )
		print json.dumps(jsonString, indent=4)
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:55,代码来源:JSONPatternCreator.py


示例14: _cmdsFunctionFormat

    def _cmdsFunctionFormat(self):
        '''set up maya.cmds functions'''
        # mayaBinDir = os.path.dirname(sys.executable)
        # cmdsList = os.path.join(mayaBinDir, 'commandList')

        functions = '\\b('
        # with open(cmdsList) as phile:
        #     for line in phile:
        #         functions += line.split(' ')[0] + '|'

        maya_ver=utils.get_maya_version()
        maya_commands = utils.get_commands(version=maya_ver)
        for c in maya_commands:
            functions += c + '|'




        # global MEL procedures
        try:
            melProcedures = cmds.melInfo()
            maxlen = 1400
            stop = len(melProcedures) / maxlen
            melProc = []
            melProc.append('\\b(' + '|'.join(melProcedures[:maxlen]) + ')\\b')
            for i in range(1, stop - 1):
                start = maxlen * i
                end = maxlen * (i + 1)
                melProc.append('\\b(' + '|'.join(melProcedures[start:end]) + ')\\b')
            melProc.append('\\b(' + '|'.join(melProcedures[maxlen*stop:]) + ')\\b')
        except:
            pass

        # TODO: should update it when a plug-in was load.
        try:
            # function from plug-ins
            plugins = cmds.pluginInfo(q=1, listPlugins=1)
            for plugin in plugins:
                funcFromPlugin = cmds.pluginInfo(plugin, q=1, command=1)
                if funcFromPlugin:
                    functions += '|'.join(funcFromPlugin)
        except:
            pass

        functions = functions[:-1] + ')\\b'

        # function format
        funcFormat = QtGui.QTextCharFormat()
        funcFormat.setForeground(self._keywordColor)
        self.__rules.append((re.compile(functions), funcFormat))
        try:
            for mp in melProc:
                self.__rules.append((re.compile(mp), funcFormat))
        except:
            pass
开发者ID:oglops,项目名称:logcatMaya,代码行数:55,代码来源:syntax.py


示例15: restoreShelves

def restoreShelves():
    #restore unloaded plugins
    plugins = prefs.unnecessaryPluginsForAnim
    for plugin in plugins:
        if not (cmds.pluginInfo(plugin, loaded=True, q=True)):
            try:
                cmds.loadPlugin(plugin)
                cmds.pluginInfo(plugin, autoload=True, e=True)
            except:
                print "{0} plugin doesn't exist in this version of Maya".format(plugin)
    #restoren shelves marked as *.deleted
    lib.restoreShelves()
开发者ID:studiocoop,项目名称:maya-coop,代码行数:12,代码来源:animEnvironment.py


示例16: _fetchHengine

 def _fetchHengine(self):
     
     v = cmds.about(version=True)
     hengineInfo = ""
     mayaType = HComMayaUtils.CLIENT_TYPE.MAYA_NO_HENGINE
     plugins = cmds.pluginInfo( query=True, listPlugins=True )
     if plugins:
         if "houdiniEngine" in cmds.pluginInfo( query=True, listPlugins=True ):
             hengineInfo = " (Houdini Engine Loaded)"
             mayaType = HComMayaUtils.CLIENT_TYPE.MAYA_HENGINE
         
     return [mayaType, "Maya " + str(v) + hengineInfo]
开发者ID:GJpy,项目名称:HCom,代码行数:12,代码来源:HComMayaUi.py


示例17: flush

def flush():

	pluginPaths = map( Path, api.mel.eval( 'getenv MAYA_PLUG_IN_PATH' ).split( ';' ) )  #NOTE: os.environ is different from the getenv call, and getenv isn't available via python...  yay!

	#before we do anything we need to see if there are any plugins in use that are python scripts - if there are, we need to ask the user to close the scene
	#now as you might expect maya is a bit broken here - querying the plugins in use doesn't return reliable information - instead we ask for all loaded
	#plugins, to which maya returns a list of extension-less plugin names.  We then have to map those names back to disk by searching the plugin path and
	#determining whether the plugins are binary or scripted plugins, THEN we need to see which the scripted ones are unloadable.
	loadedPluginNames = cmd.pluginInfo( q=True, ls=True ) or []
	loadedScriptedPlugins = []
	for pluginName in loadedPluginNames:
		for p in pluginPaths:
			possiblePluginPath = (p / pluginName).setExtension( 'py' )
			if possiblePluginPath.exists():
				loadedScriptedPlugins.append( possiblePluginPath[-1] )

	initialScene = None
	for plugin in loadedScriptedPlugins:
		if not cmd.pluginInfo( plugin, q=True, uo=True ):
			BUTTONS = YES, NO = 'Yes', 'NO'
			ret = cmd.confirmDialog( t='Plugins in Use!', m="Your scene has python plugins in use - these need to be unloaded to properly flush.\n\nIs it cool if I close the current scene?  I'll prompt to save your scene...\n\nNOTE: No flushing has happened yet!", b=BUTTONS, db=NO )
			if ret == NO:
				print "!! FLUSH ABORTED !!"
				return

			initialScene = cmd.file( q=True, sn=True )

			#prompt to make new scene if there are unsaved changes...
			api.mel.saveChanges( 'file -f -new' )

			break

	#now unload all scripted plugins
	for plugin in loadedScriptedPlugins:
		cmd.unloadPlugin( plugin )  #we need to unload the plugin so that it gets reloaded (it was flushed) - it *may* be nessecary to handle the plugin reload here, but we'll see how things go for now

	#lastly, close all windows managed by baseMelUI - otherwise callbacks may fail...
	for melUI in baseMelUI.BaseMelWindow.IterInstances():
		melUI.delete()

	#determine the location of maya lib files - we don't want to flush them either
	mayaLibPath = Path( maya.__file__ ).up( 2 )

	#flush all modules
	dependencies.flush( [ mayaLibPath ] )

	if initialScene and not cmd.file( q=True, sn=True ):
		if Path( initialScene ).exists():
			cmd.file( initialScene, o=True )

	print "WARNING: You'll need to close and re-open any python based tools that are currently open..."
开发者ID:BGCX261,项目名称:zootoolbox-git,代码行数:51,代码来源:mayaDependencies.py


示例18: loadMentalRay

def loadMentalRay(currentEngine=True):
    """ Load Mental Ray plugin
        @param currentEngine: (bool) : Set MentalRay as current render engine """
    name = "Mayatomr"
    #-- Load MentalRay PlugIn --#
    if not mc.pluginInfo(name, q=True, loaded=True):
        print "Load MentalRayPlugin ..."
        mc.loadPlugin(name)
        mc.pluginInfo(name, edit=True, autoload=True)
    #-- Use MentalRay As Current Renderer --#
    if currentEngine:
        print "Set MentalRay as current render engine ..."
        mc.setAttr('defaultRenderGlobals.currentRenderer', 'mentalRay', type='string')
    print "# Result: mental ray Plugin loaded #"
开发者ID:snaress,项目名称:bank,代码行数:14,代码来源:procRender.py


示例19: animPlugin

 def animPlugin( self ):
     state = pluginInfo( 'animImportExport', q=True, loaded=True )
     if state == 0:
         platform = os.name
         print platform
         if platform == 'Linux':
             cmds.pluginInfo( '/software/apps/maya/2012.sp1/cent5.x86_64/bin/plug-ins/' + 'animImportExport', e=True, a=True )
             cmds.loadPlugin( 'animImportExport' )
         elif platform == 'nt':
             path = "C:\Program Files\Autodesk\Maya2013" + "\\" + "bin\plug-ins" + "\\" + "animImportExport.mll"
             print path
             cmds.pluginInfo( 'C:\Program Files\Autodesk\Maya2013\\bin\plug-ins\\' + 'animImportExport.mll', e=True, a=True )
             cmds.loadPlugin( 'animImportExport' )
         else:
             pass
开发者ID:boochos,项目名称:work,代码行数:15,代码来源:animation_library_manager.py


示例20: verifyPlugin

def verifyPlugin(pluginName, requiredBy):
	"""
	Verify that a particular plug-in is loaded and attempt to load it if it
	cannot be found.
	@param pluginName Name of the plugin without extension
	@param requiredBy __file__ member of the caller
	"""
	try: tcpy.indexOf(pluginName, __allPlugins__)
	except:
		try:
			MC.loadPlugin('%s.py'%pluginName)
			MC.pluginInfo('%s.py'%pluginName, e=True, autoload=True)
		except:
			sys.stderr.write('Error: Could not locate the %s plug-in. It is required for the %s module.\nPlease ensure that %s.py is located somewhere in your plug-in path.\n' 
				%(pluginName, os.path.basename(requiredBy), pluginName))
开发者ID:tccoleman,项目名称:tcTools,代码行数:15,代码来源:plugins.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmds.pointConstraint函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.playblast函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap