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


Python core.sceneName函数代码示例

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


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

示例1: refresh_engine

def refresh_engine(engine_name, prev_context, menu_name):
    """
    refresh the current engine
    """    
    current_engine = tank.platform.current_engine()
    
    # first make sure that the disabled menu is reset, if it exists...
    if pm.menu("ShotgunMenuDisabled", exists=True):
        pm.deleteUI("ShotgunMenuDisabled")
    
    # if the scene opened is actually a file->new, then maintain the current
    # context/engine.
    if pm.sceneName() == "":
        return current_engine

    new_path = pm.sceneName().abspath()
    
    # this file could be in another project altogether, so create a new Tank
    # API instance.
    try:
        tk = tank.tank_from_path(new_path)
    except tank.TankError, e:
        OpenMaya.MGlobal.displayInfo("Shotgun: Engine cannot be started: %s" % e)
        # render menu
        create_tank_disabled_menu(menu_name)
        
        # (AD) - this leaves the engine running - is this correct?        
        return current_engine
开发者ID:framestore,项目名称:tk-maya,代码行数:28,代码来源:engine.py

示例2: refresh_engine

def refresh_engine(engine_name, prev_context, menu_name):
    """
    refresh the current engine
    """    
    current_engine = tank.platform.current_engine()
    
    # first make sure that the disabled menu is removed, if it exists...
    menu_was_disabled = remove_sgtk_disabled_menu()
    
    # determine the tk instance and ctx to use:
    tk = current_engine.sgtk
    ctx = prev_context
    if pm.sceneName() == "":
        # if the scene opened is actually a file->new, then maintain the current
        # context/engine.
        if not menu_was_disabled:
            # just return the current engine - no need to restart it!
            return current_engine
    else:
        # loading a scene file
        new_path = pm.sceneName().abspath()
    
        # this file could be in another project altogether, so create a new
        # API instance.
        try:
            tk = tank.tank_from_path(new_path)
        except tank.TankError, e:
            OpenMaya.MGlobal.displayInfo("Shotgun: Engine cannot be started: %s" % e)
            # build disabled menu
            create_sgtk_disabled_menu(menu_name)
            return current_engine

        # and construct the new context for this path:
        ctx = tk.context_from_path(new_path, prev_context)
开发者ID:thirstydevil,项目名称:tk-maya,代码行数:34,代码来源:engine.py

示例3: _Load_ChairMAsset_Simple

def _Load_ChairMAsset_Simple(force=True):
    _file = "\\\\SERVER9\\Maya-Tools\\testFiles\\eMetaData\\ChairMAsset_Simple.mb"
    if pCore.sceneName() == _file:
        if force:
            pCore.openFile(_file, f=True)
    else:
        pCore.openFile(_file, f=True)
开发者ID:thirstydevil,项目名称:mayaMetaData,代码行数:7,代码来源:test_mAsset.py

示例4: __init__

 def __init__(self):
     self.name = "MusterSubmitClass"
     self.widgets = {}
     self.pools = []
     self.userPass = {}
     self.renderers = []
     self.cameras = pm.ls(ca = True)
     self.scene = pm.sceneName()
     self.priority = self.__class__.defaults['priority']
     self.childrenTabs = []
     
     self.startFrame = pm.SCENE.defaultRenderGlobals.startFrame.get()
     self.endFrame = pm.SCENE.defaultRenderGlobals.endFrame.get()
     
     self.mustertool = None
     
     self._saveUser = None
     self._saveRenderer = None
     self._savePool = None
     
     self.fileInfo = PT.PRAFileInfo(self.scene)
     try:
         self.output = os.path.join(self.__class__.renderDrive, self.fileInfo.getProject(), self.fileInfo.getEpShotName()).replace("\\","/")
     except TypeError: #file info returned None
         self.output = ''
     
     try:
         self._getData() #this bit is slow. use threadding maybe?
     except:
         pm.confirmDialog(title = "Confirm", Message = "Error connecting to muster database / executable. Speak to your IT helpdesk. \nContinuing using Demo mode", buttonm = ['OK'] )
开发者ID:jessedenton,项目名称:musterSubmit,代码行数:30,代码来源:musterUI.py

示例5: updateFileNamePrefix

    def updateFileNamePrefix(self, *args):
        if self.rendererTabUiDict.has_key("common"):
            uiDict = self.rendererTabUiDict["common"]
        prefix = uiDict["fileNamePrefixField"].getText()

        sceneName = ".".join(pm.sceneName().basename().split(".")[:-1])
        if len(prefix) == 0:
            prefix = sceneName
            uiDict["imgname"].setLabel("File Name: " + sceneName)

        settings = pm.api.MCommonRenderSettingsData()
        pm.api.MRenderUtil.getCommonRenderSettings(settings)

        cams = [cam for cam in pm.ls(type="camera") if cam.renderable.get()]
        if len(cams) < 1:
            log.error("No renderable camera. please make at least one camera renderable.")
            prefix = ""
            for c in pm.ls(type="camera"):
                if "perspShape" in c:
                    cams.append(c)
                    break
        prefix = prefix.replace("<Camera>", cams[0].name())

        prefix = prefix.replace("<Scene>", sceneName)

        ext = self.renderNode.imageFormat.getEnums().keys()[self.renderNode.imageFormat.get()].lower()
        numberFormat = ""
        paddedFrameString = "{0:0" + str(settings.framePadding) + "d}."
        if settings.isAnimated():
            numberFormat = paddedFrameString.format(int(pm.SCENE.defaultRenderGlobals.startFrame.get()))
        completeFileName = "{prefix}.{numbering}{ext}".format(prefix=prefix, numbering=numberFormat, ext=ext)
        uiDict["imgname"].setLabel("File Name: " + completeFileName)
        """
开发者ID:dictoon,项目名称:appleseed-maya,代码行数:33,代码来源:commonglobals.py

示例6: scan_scene

    def scan_scene(self):
    
        # first let's look at maya references
        for x in pm.listReferences():
            node_name = x.refNode.longName()
        
            # get the path and make it platform dependent
            # (maya uses C:/style/paths)
            maya_path = x.path.replace("/", os.path.sep)
            self.refs.append( {"node": node_name, "type": "reference", "path": maya_path})
        
        # now look at file texture nodes
        for file_node in cmds.ls(l=True, type="file"):
            # ensure this is actually part of this scene and not referenced
            if cmds.referenceQuery(file_node, isNodeReferenced=True):
                # this is embedded in another reference, so don't include it in the breakdown
                continue
        
            # get path and make it platform dependent (maya uses C:/style/paths)
            path = cmds.getAttr("%s.fileTextureName" % file_node).replace("/", os.path.sep)
        
            self.refs.append( {"node": file_node, "type": "file", "path": path})

        # Append scene file
        self.refs.append( {"node": None, "type": "scene", "path": pm.sceneName()})
        
        return self.refs
开发者ID:Kif11,项目名称:aau_sg_launchers,代码行数:27,代码来源:app.py

示例7: saveSceneForVersion

def saveSceneForVersion():
    filePath = _pmCore.sceneName()
    fileID = _Database.getIDByFilePath(filePath)[0]
    _pmCore.saveFile()
    versionNum, _, thumbnailPath = _Database.addVersion(filePath, _os.environ.get('AM_USERNAME'))
    _makeThumbnail(128, 128, thumbnailPath)
    return fileID, versionNum, thumbnailPath
开发者ID:juewang,项目名称:AssetManager2,代码行数:7,代码来源:MayaFunctions.py

示例8: SNV

def SNV(*args):
	sceneNameFull = pm.sceneName() # full scene name with path, version, ext
	scenePath = os.path.dirname(sceneNameFull) # scene path
	sceneNameVerExt = sceneNameFull.split('/')[-1] # scene name with version an ext
	sceneNameVer, ext = sceneNameVerExt.split('.') # get EXT
	ver = sceneNameVer.split('_')[-1] # get VERSION
	verNext = int(ver) + 1
	partQnt = len(sceneNameVer.split('_')) - 1 # get quantity of scene name parts, separated with '_'
	sceneNameParts = sceneNameVer.split('_')[0 : partQnt]
	sceneName = '' # recreate scene name from parts
	for i in range (0 , partQnt):
		sceneName += sceneNameParts[i] + '_'

	sceneNameFullNew = '{0}/{1}{2:0>3}.{3}'.format(scenePath, sceneName, verNext, ext)
	if os.path.exists(sceneNameFullNew):
		confirm = pm.confirmDialog ( title = 'File exists!', message=  'Overwrite file?' + '\r\n\r\n' + str('{0}{1:0>3}.{2}'.format( sceneName, verNext, ext)), button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )
		if confirm == 'Yes':
			pm.saveAs(sceneNameFullNew)
			pm.mel.addRecentFile (sceneNameFullNew, 'mayaBinary')
			print 'File overrited: ' + str(sceneNameFullNew)
		else:
			sys.exit()
	else:
		pm.saveAs(sceneNameFullNew)
		pm.mel.addRecentFile (sceneNameFullNew, 'mayaBinary')
		print 'File saved: ' + str(sceneNameFullNew)
开发者ID:kiryha,项目名称:AnimationDNA,代码行数:26,代码来源:dnaCore.py

示例9: fileTokenScene

def fileTokenScene(path, tokens, **kwargs):
    import pymel.core as pm
    if '<Scene>' in path and 'Scene' not in tokens:
        sceneName = pm.sceneName().namebase
        if sceneName == '':
            sceneName = 'untitled'
        tokens['Scene'] = sceneName
开发者ID:Quazo,项目名称:breakingpoint,代码行数:7,代码来源:hooks.py

示例10: openSelectedFile

	def openSelectedFile(self):
		try:
			item = self.previewAnimTable.selectedItems()[0]
			if item.column() == 0:
				self.openMayaFile(item.text(),'preview')
			elif item.column() == 2:
				if item.text() == 'Yes':
					filename = self.previewAnimTable.item(item.row(),0).text()
					self.openMovFile(filename,'preview')
		except:
			pass
		
		try:
			item = self.wipAnimTable.selectedItems()[0]
			if item.column() ==0:
				self.openMayaFile(item.text(),'wip')
			elif item.column() == 2:
				if item.text() == 'Yes':
					filename = self.wipAnimTable.item(item.row(),0).text()
					self.openMovFile(filename)
		except:
			pass
		currentFile = pm.sceneName()
		pm.optionVar(stringValueAppend=('RecentFilesList', currentFile))
		pm.optionVar(stringValueAppend=('RecentFilesTypeList', 'mayaAscii'))
		
		self.bdPopulateFiles()
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:27,代码来源:bdAnimationTool.py

示例11: anilizeCurrent

def anilizeCurrent(assetField,textPublisher,fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA):
    print '<<  ANALIZING CURRENT ASSET  >>'  
    fileNameFull = pm.sceneName()
    dataFileName = dna.fileActs(fileNameFull) # Get filename details (name, ver, ext etc) 
    phase = dataFileName['filePhase'] # Get PHASE (MODELLING, RENDER, LOOKDEV etc)
    key = dataFileName['filePrefix']
    # Get asset DATA from FTRACK
    assetName = dataFileName['assetName']
    assetType = dataFileName['assetType']
    assetCat = dataFileName['assetCat']    
    # RUN SETUP
    if phase == 'ASSETS': # SETUP ASSETS
        if key == 'ENV': # SETUP <<  ENVIRONMENT  >>
            print 'assetType: <<  ENVIRONMENT  >>'
            value = dataFileName['fileNameFull'] 
            textPublisher(assetName, 'GEO', value, type, assetField, fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA)                
        elif key == 'FUR' or key == 'GEO' or key == 'RIG': # SETUP <<  CHARACTERS + DYNAMIC PROPS + EDA  >>
            if assetType == 'characters':
                print 'assetType: <<  CHARACTERS  >>'
                value = dataFileName['fileNameFull'] 
                textPublisher(assetName,key,value,type,assetField,fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA)
            elif assetType == 'props':
                print 'assetType: <<  DYNAMIC PROPS  >>'
                value = '{0}/{1}/{2}'.format(assetCat, key, dataFileName['fileNameFull'])
                textPublisher(assetName,key,value,type,assetField,fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA)
            elif assetType == 'eda':
                print 'assetType: <<  ENVIRONMENT DYNAMIC ASSET  >>'
                value = fileNameFull.split('{0}{1}'.format(rootScene, envPath))[-1]
                textPublisher(assetName,key,value,type,assetField,fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA)
                        
    elif phase == 'LOOKDEV': # SETUP MATERIALS
        print 'assetType: <<  MTERIAL LIBRARY  >>'  
        value = dataFileName['fileNameFull'] 
        textPublisher(assetName,key,value,type,assetField,fieldGEO, fieldRIG, fieldFUR, fieldMAT, fieldEDA)
开发者ID:kiryha,项目名称:AnimationDNA,代码行数:34,代码来源:dataPublisher.py

示例12: _collect_info

def _collect_info():
    lines = []
    lines.append('Scene Info')
    lines.append('  Maya Scene: ' + pmc.sceneName())

    lines.append('Maya/Python Info')
    lines.append('  Maya Version: ' + pmc.about(version=True))
    lines.append('  Qt Version: ' + pmc.about(qtVersion=True))
    lines.append('  Maya64: ' + str(pmc.about(is64=True)))
    lines.append('  PyVersion: ' + sys.version)
    lines.append('  PyExe: ' + sys.executable)

    lines.append('Machine Info')
    lines.append('  OS: ' + pmc.about(os=True))
    lines.append('  Node: ' + platform.node())
    lines.append('  OSRelease: ' + platform.release())
    lines.append('  OSVersion: ' + platform.version())
    lines.append('  Machine: ' + platform.machine())
    lines.append('  Processor: ' + platform.processor())

    lines.append('Environment Info')
    lines.append('  EnvVars')
    for k in sorted(os.environ.keys()):
        lines.append('    %s: %s' % (k, os.environ[k]))
    lines.append('  SysPath')
    for p in sys.path:
        lines.append('    ' + p)
    return lines
开发者ID:AdricEpic,项目名称:practicalmayapython,代码行数:28,代码来源:excepthandling.py

示例13: setWipFolder

	def setWipFolder(self):
		currentScene = pm.sceneName()
		if currentScene:
			projectPath,fileName = os.path.split(currentScene)
			wipFolder = ''
			try:
				wipFolder = pm.fileDialog2(dir=projectPath,ds=2,fm=3,okc='Select Folder')[0]
			except:
				pm.warning('No folder was selected')

			if wipFolder:
				self.wipFolderEdit.setText(wipFolder)
				self.wipFolderPath = wipFolder
				self.bdPopulateFiles()
		else:
			projectPath = pm.workspace.path
			charactersFolder = os.path.abspath(os.path.join(projectPath,'scenes','characters'))
			path = ''
			try:
				path = pm.fileDialog2(dir=charactersFolder,ds=2,fm=3,okc='Select Folder')[0]
			except:
				pm.warning('No folder was selected')
			if path:
				self.wipFolderEdit.setText(path)
				self.wipFolderPath = path
				self.bdPopulateFiles()
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:26,代码来源:animToolUI.py

示例14: setImageName

    def setImageName(self):
        self.renderGlobalsNode.basePath.set(pm.workspace.path)
        try:
            self.renderGlobalsNode.imagePath.set(pm.workspace.path + pm.workspace.fileRules['images'])
        except:
            self.renderGlobalsNode.imagePath.set(pm.workspace.path + 'images')
        sceneName = ".".join(pm.sceneName().basename().split(".")[:-1])

        # get rid of the number extension which is created by maya if we start a batchrendering from the UI
        numberPart = sceneName.split("__")[-1]
        try:
            number = int(numberPart)
            if number > 999:
                sceneName = sceneName.replace("__" + numberPart, "")
        except:
            pass
        imageName = sceneName
        prefix = pm.SCENE.defaultRenderGlobals.imageFilePrefix.get()
        if prefix:
            if len(prefix) > 0:
                settings = pm.api.MCommonRenderSettingsData()
                pm.api.MRenderUtil.getCommonRenderSettings(settings)

                cams = [cam for cam in pm.ls(type='camera') if cam.renderable.get()]
                if len(cams) < 1:
                    log.error("No renderable camera.")
                    prefix = ""
                prefix = prefix.replace("<Camera>", cams[0].name())
                prefix = prefix.replace("<Scene>", sceneName)
                imageName = prefix

        self.renderGlobalsNode.imageName.set(imageName)
开发者ID:dictoon,项目名称:appleseed-maya,代码行数:32,代码来源:renderer.py

示例15: playblastCurrent

	def playblastCurrent(self):
		playblastFormat = self.animFormatComboBox.currentText()
		print playblastFormat 
		qtPlayblastMelCmd = 'playblast  -format qt -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "H.264" -quality 100 -widthHeight 1280 720;';
		xvidPlayblastMelCmd  = 'playblast  -format avi -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "XVID" -quality 100 -widthHeight 1280 720;';
		uncommpresedPlayblastMelCmd = 'playblast  -format avi -sequenceTime 0 -clearCache 1 -viewer 1 -showOrnaments 1 -fp 4 -percent 100 -compression "none" -quality 100 -widthHeight 1280 720;';
		tempFile = ''
		if playblastFormat == 'mov':
			tempFile = pm.mel.eval(qtPlayblastMelCmd)
		elif playblastFormat == 'avi':
			tempFile = pm.mel.eval(xvidPlayblastMelCmd)
		elif playblastFormat == 'uncompressed':
			tempFile = pm.mel.eval(uncommpresedPlayblastMelCmd)
		
		if os.path.isfile(tempFile):
			path,fileName = os.path.split(pm.sceneName())
			extension = '.mov'
			if playblastFormat == 'avi' or playblastFormat == 'uncompressed':
				extension  = '.avi'

			movFile = fileName.split('.')[0] + extension
			try:
				shutil.copy2(tempFile, os.path.join(path,movFile))
			except:
				pm.error("Coulnd't copy the temp blast")
			self.updatePlayblastStatus(fileName)
开发者ID:Mortaciunea,项目名称:bdScripts,代码行数:26,代码来源:animToolUI.py


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