在3D视图中取消选择对象后,在“大纲视图"中保持选中状态 [英] Keeping object selected in the Outliner after deselecting it in 3D View

查看:131
本文介绍了在3D视图中取消选择对象后,在“大纲视图"中保持选中状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了自己的图形编辑器"和大纲视图",我的问题是我希望能够在大纲视图"中保留先前选择的对象,以便它继续显示在图形编辑器"中,但是我仍然能够选择该对象的属性并更新图形编辑器".

I've created my own Graph Editor and Outliner, my problem is that I want to be able to keep the previously selected object selected in my Outliner so that it continues to display on the Graph Editor, but I'm also still able to select the attributes of that object and have the Graph Editor update.

我想要获得的效果是您从Autodesk Maya的Graph Editor中的Auto Load Selected Objects功能获得的效果.

The effect I'm trying to get is what you get from the Auto Load Selected Objects feature in Autodesk Maya's Graph Editor.

我已经尝试过使用selectionConnections进行一些操作,但是我还不太了解.我可以使用lock = 1代码来更改大纲视图"和图形编辑器",但是图形编辑器"不再使用所选对象的属性进行更新.

I've tried a few things with the selectionConnections, but I haven't quite got my head around it. I can keep the Outliner and Graph Editor from changing by using the lock = 1 code, but the Graph Editor no longer updates with the attributes of the selected object.

这是我到目前为止所拥有的:

Here's what I have so far:

import maya.cmds as mc

mc.window( w = 500 )
mc.paneLayout( configuration = 'vertical2', swp = 1, ps = [ 2, 70, 0 ] )
mc.frameLayout( w = 150, h = 100, lv = 0 )

mc.outlinerEditor( mainListConnection = 'modelList', 
                   selectionConnection = 'modelList', 
                   showShapes = 1, 
                   showReferenceNodes = 0, 
                   showReferenceMembers = 0, 
                   showAttributes = 1, 
                   showSelected = 0,         
                   highlightActive = 1, 
                   showAnimCurvesOnly = 0, 
                   autoExpand = 1,
                   showConnected = 1, 
                   showDagOnly = 0, 
                   ignoreDagHierarchy = 1, 
                   expandConnections = 0, 
                   showCompounds = 0,     
                   showNumericAttrsOnly = 0,
                   autoSelectNewObjects = 0, 
                   doNotSelectNewObjects = 1, 
                   transmitFilters = 0, 
                   showSetMembers = 1,     
                   setFilter = 'defaultSetFilter',
                   lck = 1 )

mc.setParent( '..' )
mc.frameLayout( w = 1, h = 100, lv = 0 )
mc.animCurveEditor( mlc = 'modelList', dak = 1, di = 0, dat = 'off' )
mc.setParent( '..' )
mc.showWindow()

问题在于,当我取消选择对象时,Outliner高亮显示将关闭该对象,并且图形编辑器"变为空白.我希望它忽略新的选择并保持当前对象处于选中状态,但仍然能够单独选择属性.

The issue is that when I deselect the object the Outliner highlight turns off the object and the Graph Editor goes blank. I want this to ignore new selections and keep the current object selected, but still able to individually select the attributes.

我希望这是有道理的.

推荐答案

更新

好吧,我想我已经得到了答案:

Update

Ok, I think I've got an answer for this:

import maya.cmds as mc

Xsl = (mc.ls (sl=1, sn=1))[0]

def toastFUNC (arg=0):
    mc.animCurveEditor (curveEditor, e=1, lck=1)

mc.window(w=500)
mc.paneLayout( configuration='vertical2', swp=1, ps=[2, 70, 0] )    
mc.frameLayout(w=150, h=100, lv=0)

mc.outlinerEditor(mlc='modelList', slc='modelList', showReferenceNodes=0, showReferenceMembers=0,    showAttributes=1, showSelected=0, highlightActive=1, showAnimCurvesOnly=0, autoExpand=1,
showConnected=1, showDagOnly=0, ignoreDagHierarchy=1, expandConnections=0, showCompounds=0,   showNumericAttrsOnly=0,
autoSelectNewObjects=0, doNotSelectNewObjects=1, transmitFilters=0, showSetMembers=1,    setFilter='defaultSetFilter', lck=1, sec=toastFUNC)

mc.setParent('..')

mc.frameLayout(w=1, h=100, lv=0)
curveEditor = mc.animCurveEditor(mlc='modelList', slc='modelList', dak=1, di=0, dat='off', lck=1)
mc.setParent('..')
mc.showWindow()

如果有人对使用selectionConnection有任何提示,我还是很想听听:)

If anyone has any tips for using the selectionConnection I'd still love to hear some :)

这篇关于在3D视图中取消选择对象后,在“大纲视图"中保持选中状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆