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

Python cmds.modelEditor函数代码示例

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

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



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

示例1: playblastStart

def playblastStart(cameraList):
	for x in cameraList:
		i = cmds.listRelatives( x, p=True )
		cmds.select(i)
		start = cmds.findKeyframe( i, which="first" )
		end = cmds.findKeyframe( i, which="last" )
		sceneNameFull = cmds.file(query = True, shortName = True, sceneName = True)
		if '.mb' in sceneNameFull or '.ma' in sceneNameFull:
			sceneName = sceneNameFull[:-3] 
		else:
			sceneName = sceneNameFull
		cmds.select(cl = 1)
		focus = cmds.getPanel( withFocus=True )
		cmds.modelPanel( focus, edit=True, camera = x )
		cmds.modelEditor( focus, edit = True, cameras = False, locators = False)
		print start, end
		if start == end: # this means there's no keyframes
			print 'no keyframes on this one, playblasting timeline duration'
			cmds.playblast (format = "qt", compression = "Sorenson Video 3", filename = desktop + sceneName + '_' + str(i[0]) + '.mov', clearCache = 1 , viewer = 0, showOrnaments = 1, fp = 4, percent = 100, quality = 100, widthHeight = [1280, 720])
		else:
			print 'keyframes found, playblasting their start to end'
			cmds.playblast (startTime = start, endTime = end, format = "qt", compression = "Sorenson Video 3", filename = desktop + sceneName + '_' + str(i[0]) + '.mov', sequenceTime = 0, clearCache = 1 , viewer = 0, showOrnaments = 1, fp = 4, percent = 100, quality = 100, widthHeight = [1280, 720])
		#cmds.playblast( completeFilename = str(i) + '.mov', startTime = start, endTime = end, viewer = True, clearCache = True, percent = 100, quality = 100, format = "qt", framePadding = 20 )
		cmds.modelEditor( focus, edit = True, cameras = True, locators = True)
		print ' moving to the next one '
开发者ID:jricker,项目名称:JR_Maya,代码行数:25,代码来源:JR_skratch.py


示例2: currentCamera

def currentCamera():
	if Sel.getType(0)[1] == 'LIGHT' or Sel.getType(0)[1] == 'CAMERA':
		print 'going through current camera section in camera shuffle'
		i = cmds.ls(selection=True)
		cmds.modelEditor(Cache.modelPanel, edit=True, cam = i[0] )
	else:
		print 'select a camera or light'
开发者ID:jricker,项目名称:JR_Maya,代码行数:7,代码来源:JR_camera_shuffle.py


示例3: apply_view

def apply_view(panel, **options):
    """Apply options to panel"""

    camera = cmds.modelPanel(panel, camera=True, query=True)

    # Display options
    display_options = options.get("display_options", {})
    for key, value in display_options.iteritems():
        if key in _DisplayOptionsRGB:
            cmds.displayRGBColor(key, *value)
        else:
            cmds.displayPref(**{key: value})

    # Camera options
    camera_options = options.get("camera_options", {})
    for key, value in camera_options.iteritems():
        cmds.setAttr("{0}.{1}".format(camera, key), value)

    # Viewport options
    viewport_options = options.get("viewport_options", {})
    for key, value in viewport_options.iteritems():
        cmds.modelEditor(panel, edit=True, **{key: value})

    viewport2_options = options.get("viewport2_options", {})
    for key, value in viewport2_options.iteritems():
        attr = "hardwareRenderingGlobals.{0}".format(key)
        cmds.setAttr(attr, value)
开发者ID:BigRoy,项目名称:pyblish-magenta,代码行数:27,代码来源:capture.py


示例4: __set__

    def __set__(self, instance, value):
        """
        This function set the value on the displayAppearance of the 
        modelpanel
        """
        #usual data check
        if not self.check_data_type(value):
            return

        #get the modelpanel
        model = get_model()
        if not model:
            return

        #check if the value we want to set is actually
        #supported
        if not value in self.SUPPORTED_ATTRS:
            types = ""
            for t in self.SUPPORTED_ATTRS:
                types += "- "
                types += t
                types += " \n"
            OpenMaya.MGlobal.displayWarning("value \"{v}\" ".format(v = value) + \
                    "is not supported \nsupported types : \n" + types)
            return

        #if everything goes well lets sett the value
        cmds.modelEditor(model, displayAppearance=value, e=1)
开发者ID:Leopardob,项目名称:animShader,代码行数:28,代码来源:generic_viewport.py


示例5: cameraViewMode

def cameraViewMode(panelName=None):
    if not panelName: panelName   = cmds.getPanel(withFocus=True)
    onlyShowObj(["polymeshes"], panelName)
    
    if (len(cmds.ls(type="light")) > 0): lights =  "all"
    else : lights = "default"
    cmds.modelEditor(panelName, edit=True, displayLights=lights, selectionHiliteDisplay=False)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:7,代码来源:utilMod.py


示例6: update_editor_view

	def update_editor_view(self):
		cmds.viewFit()

		panels = cmds.getPanel(type='modelPanel')
		for panel in panels:
			modelEditor = cmds.modelPanel(panel, query=True, modelEditor=True)
			cmds.modelEditor(modelEditor, edit=True, displayAppearance='smoothShaded', displayTextures=True, textures=True, joints=False)
开发者ID:ChyrosNX,项目名称:NephX7,代码行数:7,代码来源:cnx_rigathon_util.py


示例7: display_textures

def display_textures():
    current_panel = cmds.getPanel(withFocus=True)
    if not is_model_panel(current_panel):
        cmds.warning("Panel must be modelpanel.")

    is_texture = cmds.modelEditor(current_panel, q=True, displayTextures=True)
    cmds.modelEditor(current_panel, e=True, displayTextures=not (is_texture))
开发者ID:arubertoson,项目名称:maya-mamtools,代码行数:7,代码来源:display.py


示例8: create

    def create(self):
        
        if cmds.window( self.winName, ex=1 ):
            cmds.deleteUI( self.winName, wnd=1 )
        cmds.window( self.winName, title=self.title )
        
        form = cmds.formLayout()
        modelEditorForm = self.uiModelEditor1.create()
        modelPanelForm  = self.uiModelEditor2.create()
        button = cmds.button( l='S E L E C T    P L A N E', h=22, p=form, c= partial( WinA_Cmd.selectController, self.uiModelEditor1.modelEditor ),
                              bgc=[0.7, 0.9, 0.5] )
        cmds.setParent( '..' )
        
        cmds.modelEditor( self.uiModelEditor2.modelPanel, edit=1, displayAppearance='smoothShaded',
                          textures = False, hud=False, grid=False,
                          activeOnly = False )

        cmds.formLayout( form, e=1,
                         af=[ ( modelEditorForm, 'top', 15 ), ( modelEditorForm, 'left', 15 ), ( modelEditorForm, 'right', 15 ),
                              ( modelPanelForm, 'left', 15 ), ( modelPanelForm, 'right', 15 ), ( modelPanelForm, 'bottom', 15 ),
                              ( button, 'left', 15 ), ( button, 'right', 15 ) ],
                         ac=[ ( button, 'top', 5, modelEditorForm ), 
                              ( modelPanelForm, 'top', 5, button ) ] )
        
        cmds.window( self.winName, e=1, wh=[ self.width, self.height ], rtf=1 )
        cmds.showWindow( self.winName )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:26,代码来源:sgPWindow_projCoc_translateCam.py


示例9: __init__

	def __init__(self, project, pose = None, parent  = uiH.getMayaWindow() ):
		if uiH.USEPYQT:
			super(base, self).__init__(parent)
		else:
			super(PoseThumbnailCreatorUi, self).__init__(parent)
		self.setupUi(self)
		self.project = project
		self.pose = pose
		layout = mui.MQtUtil.fullName(long(shiboken.getCppPointer(self.viewport_lay)[0]))
		self.cam = mn.Node( 'Capture_Pose' )
		if not self.cam.exists:
			self.camShape = mn.createNode( 'camera', ss = True )
			self.camShape.parent.name = 'Capture_Pose'
			mc.viewSet( self.cam.name, p = True )
			self.cam.shape.a.focalLength.v = 100
			self.cam.a.v.v = 0
		self.executer = mc.modelPanel( mbv = False, camera = self.cam.name, p = layout )
		mc.modelEditor(self.executer, e = True, grid = 0, da = "smoothShaded", allObjects = 0, nurbsSurfaces = 1, polymeshes = 1, subdivSurfaces = 1 )
		#self.viewport_lay.addWidget( uiH.toQtObject( self.executer ) )
		self.setObjectName( 'PoseThumbnailCreatorUi' )
		self._makeConnections()
		self.saveCameraPreset = 0 #READ, 1.. WRITE
		self.settings = sti.Settings()
		gen = self.settings.General
		skin = gen[ "skin" ]
		if skin:
			uiH.loadSkin( self, skin )
		if pose:
			self.poseName_le.setText( pose.name )
		self.fillSections()
开发者ID:skarone,项目名称:PipeL,代码行数:30,代码来源:poseManUi.py


示例10: addCharacter

    def addCharacter(self, close, *args):
        project = cmds.optionMenu(self.widgets["project"], q=True, value=True)
        selectedCharacter = cmds.textScrollList(self.widgets["characterList"], q=True, si=True)[0]
        rigPath = os.path.join(
            self.mayaToolsDir, "General", "ART", "Projects", project, "AnimRigs", selectedCharacter + ".mb"
        )
        # find existing namespaces in scene
        namespaces = cmds.namespaceInfo(listOnlyNamespaces=True)
        # reference the rig file
        cmds.file(
            rigPath, r=True, type="mayaBinary", loadReferenceDepth="all", namespace=selectedCharacter, options="v=0"
        )
        # clear selection and fit view
        cmds.select(clear=True)
        cmds.viewFit()
        panels = cmds.getPanel(type="modelPanel")
        # turn on smooth shading
        for panel in panels:
            editor = cmds.modelPanel(panel, q=True, modelEditor=True)
            cmds.modelEditor(editor, edit=True, displayAppearance="smoothShaded", displayTextures=True, textures=True)
        # find new namespaces in scene (this is here in case I need to do something later and I need the new name that was created)
        newCharacterName = selectedCharacter
        newNamespaces = cmds.namespaceInfo(listOnlyNamespaces=True)
        for name in newNamespaces:
            if name not in namespaces:
                newCharacterName = name
        # launch UI
        import ART_animationUI

        reload(ART_animationUI)
        ART_animationUI.AnimationUI()
        if close:
            cmds.deleteUI(self.widgets["window"])
开发者ID:Slugnifacent,项目名称:UnrealEngine,代码行数:33,代码来源:ART_addCharacter_UI.py


示例11: doPlayblast

    def doPlayblast(self, camera):
        
        G.TU_movie              = None
        G.TU_audioFile          = None
        G.TU_audioOffsetSec     = None        
        winName                 = 'playblastWindow'
        overscan                = cmds.getAttr("%s.overscan"%camera)   
        audioTrack              = cmds.timeControl(G.playBackSliderPython, query=True, sound=True)
        rangeVisible            = cmds.timeControl(G.playBackSliderPython, query=True, rangeVisible=True )  
        widthHeight             = utilMod.getRenderResolution()  
        
        if cmds.window(winName, query=True, exists=True): cmds.deleteUI(winName)
        
        window                  = cmds.window(winName, widthHeight=widthHeight)
        form                    = cmds.formLayout()
        editor                  = cmds.modelEditor()
        column                  = cmds.columnLayout('true')
        
        cmds.formLayout( form, edit=True, attachForm=[(column, 'top', 0), (column, 'left', 0), (editor, 'top', 0), (editor, 'bottom', 0), (editor, 'right', 0)], attachNone=[(column, 'bottom'), (column, 'right')], attachControl=(editor, 'left', 0, column))
        cmds.modelEditor(editor, edit=True, camera=camera, activeView=True)
        cmds.showWindow( window )
        cmds.window( winName, edit=True, topLeftCorner=(0, 0), widthHeight=[200,200])        
        utilMod.cameraViewMode(editor)        
        cmds.setAttr("%s.overscan"%camera, 1)
        
        
        if rangeVisible:
            range = animMod.getTimelineRange(float=False)
            rFrom   = range[0]
            rTo     = range[1]-1
        else:
            rFrom = cmds.playbackOptions(query=True, minTime=True)
            rTo   = cmds.playbackOptions(query=True, maxTime=True)
        

        if G.currentStudio == None:
            G.TU_movie = cmds.playblast(format="qt", sound=audioTrack, startTime=rFrom ,endTime=rTo , viewer=1, showOrnaments=0, offScreen=True, fp=4, percent=50, compression="png", quality=70, widthHeight=widthHeight, clearCache=True)
            
        else:
            
            fps             = mel.eval("currentTimeUnitToFPS") 
            if audioTrack:
                G.TU_audioFile      = cmds.sound(audioTrack, query=True, file=True)
                audioOffset         = cmds.sound(audioTrack, query=True, offset=True)
                G.TU_audioOffsetSec = str((rFrom - audioOffset)/-fps)
                
            movieName       = cmds.playblast(format="image", startTime=rFrom ,endTime=rTo , viewer=0, showOrnaments=0, offScreen=True, fp=4, percent=50, compression="jpg", quality=70, widthHeight=widthHeight, clearCache=True)
            if movieName: 
                G.TU_movie           = "%s.%s-%s#.jpg"%(movieName.split(".")[0], int(rFrom), int(rTo))
                if audioTrack:  G.TU_audioOffsetSec = audioOffset
                self.playMovie(G.TU_movie, G.TU_audioFile, G.TU_audioOffsetSec)
            
        if cmds.window(winName, query=True, exists=True): cmds.deleteUI(winName)
        
        cmds.setAttr("%s.overscan"%camera, overscan)
        
        if not G.TU_movie: return
        save = aToolsMod.getUserPref("saveAfterPlayblasting", default=True)
        if save and not rangeVisible: cmds.file(save=True)
开发者ID:Italic-,项目名称:maya-prefs,代码行数:59,代码来源:tUtilities.py


示例12: addCreatedToIsolateView

def addCreatedToIsolateView():
    '''
    if the current model editor panels isolate view is
    enabled add the just created object to the view
    '''
    for p in getActiveModelPanel():
        if mc.modelEditor(p, q=1, viewSelected=1):
            mc.modelEditor(p, edit=1, addSelected=1)
开发者ID:ewerybody,项目名称:melDrop,代码行数:8,代码来源:view.py


示例13: toggle_lights

def toggle_lights(lights=None):
    current_panel = cmds.getPanel(withFocus=True)
    if lights:
        cmds.modelEditor(current_panel, e=True, displayLights=lights)
    else:
        state = cmds.modelEditor(current_panel, q=True, displayLights=True)
        result = "all" if not state == "all" else "default"
        cmds.modelEditor(current_panel, e=True, displayLights=result)
开发者ID:arubertoson,项目名称:maya-mamtools,代码行数:8,代码来源:display.py


示例14: bufMoveRelease

def bufMoveRelease():
    """release the Buf move vertex mode"""
    activePanel = cmds.getPanel(withFocus=True)
    cmds.modelEditor(activePanel, e=True, manipulators=True)
    cmds.setToolTo('moveSuperContext')
    cmds.selectPref(clickDrag=False)
    cmds.selectMode(component=True)
    cmds.selectMode(object=True)
开发者ID:manymax21,项目名称:dmptools,代码行数:8,代码来源:mayaCommands.py


示例15: toggleGeo

def toggleGeo():
    pnl = cmds.getPanel(withFocus=True)
    if cmds.getPanel(to=pnl) == 'modelPanel':
        state = cmds.modelEditor(pnl, q=True, polymeshes=True)
        if state:
            cmds.modelEditor(pnl, e=True, polymeshes=0)
            # cmds.modelEditor(pnl, e=True, nurbsSurfaces=0)
        else:
            cmds.modelEditor(pnl, e=True, polymeshes=1)
开发者ID:boochos,项目名称:work,代码行数:9,代码来源:display_lib.py


示例16: deleteIShatterCtx

 def deleteIShatterCtx(self):
     '''
     Delete IShatter Context Tool
     '''
     cmds.deleteUI(self._mContext)
     cmds.modelEditor('modelPanel4', edit = True, grid = True)       
     
     cmds.scriptEditorInfo (clearHistory = True)
     cmds.flushUndo()   
开发者ID:jeffhong21,项目名称:scripts,代码行数:9,代码来源:IShatterCTX.py


示例17: parse_view

def parse_view(panel):
    """Parse the scene, panel and camera for their current settings

    Example:
        >>> parse_view("modelPanel1")

    Arguments:
        panel (str): Name of modelPanel

    """

    camera = cmds.modelPanel(panel, query=True, camera=True)

    # Display options
    display_options = {}
    for key in DisplayOptions:
        if key in _DisplayOptionsRGB:
            display_options[key] = cmds.displayRGBColor(key, query=True)
        else:
            display_options[key] = cmds.displayPref(query=True, **{key: True})

    # Camera options
    camera_options = {}
    for key in CameraOptions:
        camera_options[key] = cmds.getAttr("{0}.{1}".format(camera, key))

    # Viewport options
    viewport_options = {}

    # capture plugin display filters first to ensure we never override
    # built-in arguments if ever possible a plugin has similarly named
    # plugin display filters (which it shouldn't!)
    plugins = cmds.pluginDisplayFilter(query=True, listFilters=True)
    for plugin in plugins:
        plugin = str(plugin)  # unicode->str for simplicity of the dict
        state = cmds.modelEditor(panel, query=True, queryPluginObjects=plugin)
        viewport_options[plugin] = state

    for key in ViewportOptions:
        viewport_options[key] = cmds.modelEditor(
            panel, query=True, **{key: True})

    viewport2_options = {}
    for key in Viewport2Options.keys():
        attr = "hardwareRenderingGlobals.{0}".format(key)
        try:
            viewport2_options[key] = cmds.getAttr(attr)
        except ValueError:
            continue

    return {
        "camera": camera,
        "display_options": display_options,
        "camera_options": camera_options,
        "viewport_options": viewport_options,
        "viewport2_options": viewport2_options
    }
开发者ID:Bumpybox,项目名称:pyblish-bumpybox,代码行数:57,代码来源:capture.py


示例18: toggleSelectionHighlight

def toggleSelectionHighlight():
	"""
	This definition toggles active modeling panel selection highlight.
	"""

	panel = cmds.getPanel(withFocus=True)
	try:
		cmds.modelEditor(panel, e=True, sel=not cmds.modelEditor(panel, q=True, sel=True))
	except:
		pass
开发者ID:elanifegnirf,项目名称:Snippets,代码行数:10,代码来源:others.py


示例19: takePicture

 def takePicture(self,*args):
     global screenShotPanelVar
     cmds.formLayout()
     cmas=cmds.columnLayout(adj=True)
     cmds.paneLayout(w=150,h=150)
     screenShotPanelVar=cmds.modelPanel(cam='persp',mbv=False)
     cmds.modelEditor(screenShotPanelVar,e=True,da='smoothShaded',hud=False,jx=False,dtx=True,grid=False)
     cmds.separator(p=cmas)
     cmds.button(l='SET AS PREVIEW',p=cmas, c=self.takePictureProcess)
     return
开发者ID:andrewwillish,项目名称:veRegistrarFileManager,代码行数:10,代码来源:veRegAssetManager.py


示例20: wireframe_on_bg_objects

def wireframe_on_bg_objects():
    """
    Toggles wireframe/shaded on background objects.
    """
    current_panel = cmds.getPanel(withFocus=True)
    if not is_model_panel(current_panel):
        return cmds.warning("Panel must be modelPanel")

    state = cmds.modelEditor(current_panel, q=True, activeOnly=True)
    cmds.modelEditor(current_panel, e=True, activeOnly=not (state))
开发者ID:arubertoson,项目名称:maya-mamtools,代码行数:10,代码来源:display.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python cmds.modelPanel函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.menuItem函数代码示例发布时间: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