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.
The effect I'm trying to get is what you get from the Auto Load Selected Objects
feature in Autodesk Maya's Graph Editor.
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()
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.
I hope this makes sense.
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()
If anyone has any tips for using the selectionConnection I'd still love to hear some :)