FrameALL in GraphEditor

152 views
Skip to first unread message

Lidia Martinez

unread,
Nov 10, 2015, 1:47:39 AM11/10/15
to python_in...@googlegroups.com
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....



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

Lidia Martinez

unread,
Nov 10, 2015, 1:50:50 AM11/10/15
to python_in...@googlegroups.com
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

Chris Lesage

unread,
Nov 10, 2015, 8:45:34 AM11/10/15
to python_in...@googlegroups.com
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


--
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 python_inside_m...@googlegroups.com.
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.

For more options, visit https://groups.google.com/d/optout.

darkgaze

unread,
Nov 10, 2015, 4:49:12 PM11/10/15
to Python Programming for Autodesk Maya
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!
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

Chris Lesage

unread,
Nov 10, 2015, 10:53:49 PM11/10/15
to python_in...@googlegroups.com
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.

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c5473ce8-5560-4bfe-80bc-79a6dad40b58%40googlegroups.com.

Lidia Martinez

unread,
Nov 10, 2015, 11:39:31 PM11/10/15
to python_in...@googlegroups.com
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

--
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 python_inside_m...@googlegroups.com.
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.

Nicolas Combecave

unread,
Nov 11, 2015, 2:48:48 AM11/11/15
to python_in...@googlegroups.com

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


Reply all
Reply to author
Forward
0 new messages