Ignore the graph editor when using the Scriptjob

37 views
Skip to first unread message

Darwin Giordano

unread,
Oct 18, 2022, 3:59:35 PM10/18/22
to Python Programming for Autodesk Maya
This command line does the centering of all panels, I do not want it to be applied in graph editor.

fitPanel -selectedNoChildren;

I want to use it only in perspective and Front Side etc. cameras.

I don't want to use it in graph editor because it updates on each selection the centering. any idea how to override the command in graph editor?

global proc framesel1() 
    { 
fitPanel -selectedNoChildren; 
    } 
 global proc framesel2()
   {
select -cl; 
Undo;
         } 
int $jobId1 = `scriptJob -ct "SomethingSelected" framesel1`;
int $jobId2 = `scriptJob -e "SelectionChanged" framesel2`;

Snap.gif

Tim Fowler

unread,
Oct 20, 2022, 6:16:11 AM10/20/22
to python_in...@googlegroups.com
fitPanel is actually a mel script, not a c++ command, so you can go look at what exactly it's doing.  You'll see the code to get the current panel at the top, check what type of panel it is, and then call different commands to do the framing depending on what panel is active.  You could probably copy/paste the bits you want into your own script pretty easily if you know what you're doing.

-Tim

--
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/13cc3cec-fe32-455a-a588-dec205e69033n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages