How do I get the selected curve name?
I'm trying to get the name of the selected curve in the Graph Editor.
For example: pSphere.scaleX (note the period!)
1) If I try this: string $curves[] = `keyframe -selected -q -name`;
I get this: pSphere_scaleX (note the underscore instead of the period!)
2) If I try this: string $connection = `editor -q -mainListConnection graphEditor1GraphEd`;
string $curves[] = `expandSelectionConnectionAsArray $connection`;
I get this, but it gives me ALL curves in the channel list, not the selected curve: pSphere.scaleX pSphere.scaleY pSphere.scaleZ
keyframe -selected -q -name would work great, if only it didn't replace the period with an underscore...
Also, I can't simply substituteAllString "_" with "." because some object names contain underscores, and it would result in this other problem:
Ctrl_Upper_Head.rotateX //this is the real correct curve name
Ctrl_Upper_Head_rotateX //keyframe -selected -q -name would give me this
Ctrl.Upper.Head.rotateX //substituteAllString($curves[0], "_", ".") would give me this
Thank you for your help in advance!