# How Can I Query A Graph Editor?

**URL:** https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047
**Category:** Maya
**Tags:** mel
**Created:** [June 8, 2006, 11:20pm UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047 "2006-06-08T23:20:44Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jarod](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ba9def/32.png) [@jarod](https://forum.highend3d.com/u/jarod)
#### Post date: [June 8, 2006, 11:20pm UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/1 "2006-06-08T23:20:44Z")

</div>

Hi all

Just wondering how I can query what objects and curves are currently being displayed in a graph editor window?

---

<div class="post-metadata">

### Author: ![malacay](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/ce73a5/32.png) [@malacay](https://forum.highend3d.com/u/malacay)
#### Post date: [June 9, 2006, 12:46pm UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/2 "2006-06-09T12:46:36Z")

</div>

hi jarod

all selected objects are shown in the graph editor window. if an object has animCurves connected these are additionally displayed.  
you can querry the name of the different anim curve nodes with the keyframe command.

CODE  
keyframe -q -name nameOfYourControler;

---

<div class="post-metadata">

### Author: ![jarod](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ba9def/32.png) [@jarod](https://forum.highend3d.com/u/jarod)
#### Post date: [June 10, 2006, 5:46am UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/3 "2006-06-10T05:46:31Z")

</div>

hi malacay

thankyou for your reply.

It is true that I can use the "ls -sl;" command to find which objects are selected. But I don't think I've explained myself fully...

I would like to find explicity which objects are in loaded in the graph editor. If the "auto load selected" option is not acitve then objects in the graph editor are not always the currently selected ones.

Furthermore I need to be able to find which curves are highlighted in the grapheditor outliner.

Basically I'm trying to create a smarter "framing" script for the graph editor

does that make sense? ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/smile.gif)

---

<div class="post-metadata">

### Author: ![jarod](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ba9def/32.png) [@jarod](https://forum.highend3d.com/u/jarod)
#### Post date: [June 10, 2006, 8:57am UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/4 "2006-06-10T08:57:00Z")

</div>

hmmm...

just doing some more investigation... it seems that the selectionConnection might be used to do this. however I can't seem to get it to return an array of the highlighted animcurves...

any suggestions?

---

<div class="post-metadata">

### Author: ![malacay](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/ce73a5/32.png) [@malacay](https://forum.highend3d.com/u/malacay)
#### Post date: [June 10, 2006, 11:38am UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/5 "2006-06-10T11:38:48Z")

</div>

hi

now i might understand what you want to do... ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/wink.gif)

so there is a command which i think will help you a lot - the "animCurveEditor".  
find it in the maya help to get all the usefull flags.

so but be carefull when you call the graphEditor window. it must be called like this:

string $shownAnimCurves[] = `animCurveEditor -q -cs [b]graphEditor1GraphEd[/b]`;  
print $shownAnimCurves;

hope this helps

greetz malacay

---

<div class="post-metadata">

### Author: ![jarod](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ba9def/32.png) [@jarod](https://forum.highend3d.com/u/jarod)
#### Post date: [June 12, 2006, 4:13am UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/6 "2006-06-12T04:13:22Z")

</div>

hey

that's exactly what I need!

thanks mate!

sorry I wasn't as precise as I should have been initially.

![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/smile.gif)

yay

---

<div class="post-metadata">

### Author: ![jarod](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ba9def/32.png) [@jarod](https://forum.highend3d.com/u/jarod)
#### Post date: [June 15, 2006, 3:34am UTC](https://forum.highend3d.com/t/how-can-i-query-a-graph-editor/3047/7 "2006-06-15T03:34:47Z")

</div>

Alrighty!

I have got my script working perfectly in maya 7.0! yay.

however the -cs flag doesn't exist in 6.5

In v 7.0 this works...

string $shownAnimCurves[] = `animCurveEditor -q -cs graphEditor1GraphEd`;

Any suggestions?
