Maybe this put you on the right track: import maya.cmds as cmds ge_panel = cmds.getPanel(scriptType='graphEditor')[0] ge_editor = '%sGraphEd'%ge_panel
cmds.animCurveEditor(ge_editor, e=True, lookAt='selected') If you want to display a specific animCurve, you’ll have to play with selectionConnections of this editor. But to get the animCurve displayed in both the graphEditor AND the little associated outlinerEditor, though, you will have to get a path to it, and play with it’s selectionConnection too. But I could not figure a straightforward way to get this associated outlinerEditor. I had to find the graphEditor1 layout children, and trial and error to get to the outlinerEd… I had to do things like ge_layout = cmds.layout(ge_panel, q=True, ca=True) cmds.layout(ge_layout, q=True, ca=True) etc… which is ugly. But I found a way to this little outlinerEditor, and played with its selectionConnection, and it worked... Nicolas 2015-11-11 5:39 GMT+01:00 Lidia Martinez <[email protected]>: > Ok. > I tried your way because this is not working. > > I did this in maya: > > maya.cmds.getPanel(scriptType=´graphEditor´) > > and I get ´graphEditor1´ in the list. > > I get the first item and do: > > maya.cmds.animView(a + ´graphEd´, st=0, se=100, min=10, max=1000) > > And it tells me that > > Object ´graphEditor1graphEd´ does not exist... > > > ??? > > -- > Lidia > > 2015-11-11 16:53 GMT+13:00 Chris Lesage <[email protected]>: > >> Oh sorry no not necessarily. I just thought you were having trouble >> accessing the graphEditor and that is how I do it. Not sure if it is the >> best way, but like I said, it allows me to control things like padding >> around the edges. >> >> On Tue, Nov 10, 2015 at 4:49 PM, darkgaze <[email protected]> wrote: >> >>> So you suggest to directly put the start time and values... >>> Instead of frame all. Well. I prefer to do it using FrameAll... >>> I´ll use that, but... does anybody know what´s wrong with my code? >>> >>> Thanks Chris! >>> >>> >>> El miércoles, 11 de noviembre de 2015, 2:45:34 (UTC+13), Chris Lesage >>> escribió: >>>> >>>> Hi Lidia, >>>> >>>> I am using the following and it seems to work reliably for me for the >>>> main graph editor view. (In fact I am using pm.animView(), but my quick >>>> test works with cmds as well.) >>>> >>>> mc.animView( >>>> 'graphEditor1GraphEd', >>>> startTime = 10, >>>> endTime = 100, >>>> minValue = -20, >>>> maxValue = 2000, >>>> ) >>>> >>>> And then to fill in those 4 numbers, I am querying the animation values >>>> and frame numbers of the animCurves I'm interested in. Is that enough to go >>>> on? I have a simple framing tool I can post where I frame selected curves >>>> or keyframes and then add an addition padding buffer around the 4 edges. >>>> >>>> Chris >>>> >>>> >>>> On Tue, Nov 10, 2015 at 1:50 AM, Lidia Martinez <[email protected]> >>>> wrote: >>>> >>>>> I must add, I had a little more success creating a window with no >>>>> border and no title, parenting the graphEditor on it, and then using the >>>>> window to focus on it. >>>>> Using the windowName + graphEd string would give me the right item to >>>>> focus on... but anyway, not really the way I want to do it... >>>>> >>>>> -- >>>>> Lidia >>>>> >>>>> 2015-11-10 19:47 GMT+13:00 Lidia Martinez <[email protected]>: >>>>> >>>>>> I want to show the the contents of a curve node on the main >>>>>> graphEditor , like when we use F hotkey. >>>>>> >>>>>> I found a FAQ article about executing the FrameAll; command on the >>>>>> script editor. Just what I needed...except that it was for Maya 2.5.... >>>>>> >>>>>> http://ewertb.soundlinker.com/mel/mel.041.php >>>>>> >>>>>> >>>>>> But that code doesn´t work for me. The final step, doesn´t. Focusing >>>>>> on the +graphEd item, works... but not always. >>>>>> At the end what I did makes sense though... >>>>>> >>>>>> sceds = mc.getPanel(scriptType="graphEditor") >>>>>> >>>>>> for sce in sceds: >>>>>> lbl = mc.scriptedPanel(sce, q=True, label=True) >>>>>> if lbl == "Graph Editor": # The main graph editor not the >>>>>> tear off >>>>>> mc.select("curveName") >>>>>> mc.setFocus(sce+"graphEd") # Necessary? >>>>>> mc.animCurveEditor(sce+"graphEd",e=1, lookAt="select") >>>>>> >>>>>> >>>>>> The last line is basically what fitPanel script does for Graph >>>>>> Editor, if you show all commands when pressing F on it, you see fitPanel >>>>>> and then FrameAll executed. >>>>>> >>>>>> But FrameAll ... i can´t find any .mel file over there to see the >>>>>> contents. I think that´s the piece left... >>>>>> >>>>>> >>>>>> Anybody, ideas? Graph editor is tricky. I just want to press F there >>>>>> programatically. >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Lidia >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Python Programming for Autodesk Maya" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to [email protected]. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8ykp%2B-o%2B2-02CmRhWEkMt8DZpnAtxRwBOyFb7%3Dn2Y62%2BQ%40mail.gmail.com >>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8ykp%2B-o%2B2-02CmRhWEkMt8DZpnAtxRwBOyFb7%3Dn2Y62%2BQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Python Programming for Autodesk Maya" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/python_inside_maya/c5473ce8-5560-4bfe-80bc-79a6dad40b58%40googlegroups.com >>> <https://groups.google.com/d/msgid/python_inside_maya/c5473ce8-5560-4bfe-80bc-79a6dad40b58%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Python Programming for Autodesk Maya" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/python_inside_maya/brkbups9XYk/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/CAHUba0%2BhwAe41cDJpW0PPT9p%3D%2BZKx2Y-c_%2B9y%2BrU7qC_xiNSnA%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CAHUba0%2BhwAe41cDJpW0PPT9p%3D%2BZKx2Y-c_%2B9y%2BrU7qC_xiNSnA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8w6LxNzcF7s_zD5Dw18KxOOZyCh1eNYqjkguuoXHodXNQ%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAAB1%3D8w6LxNzcF7s_zD5Dw18KxOOZyCh1eNYqjkguuoXHodXNQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD65uq%3DXDkOK3BdiKyTs_zSzPJ-HdqGwG_pg-d73zPgMm%3DJWeA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
