Maya - scriptjob change of tab in attribute editor


#1

Hey there,

[ I rewrote this post to make it a bit clearer… ]

I am setting up a live list of presets for whatever node is visible in the Attribute Editor. Its actually,
set up fine now except for having to click a button for script to read the name on the focussed
Attribute editor tab.

We can get this as $gAECurrentTab variable, Maya’s own global variable.

I have been going through mel files to see if there is anything that is triggered on switching
tabs, so that I can hook to it, and my presets would update automatically. Can’'t see anything
that I can hook to yet, any ideas ?

I suppose I could do a scriptjob for “selectionChanged”, wouldn’t be too bad.

Thanks !
Alan.


#2

What is working for now…

I have made a local copy of “showEditor.mel” and have inserted a call to my code in
AEBuildControls();

That proc is being called each time a tab is switched, so my presets are updating accordingly.

Nice!


#3

Ah found it, you can edit the -preSelectCommand on the tabs in the Attribute Editor, this is the
existing taken from Maya’s native scripts, so I can query the command and change it in custom
scripts without modifying Maya’s native scripts.

// tabLayout
// -borderStyle “none”
// -preSelectCommand “AEbuildControls”
// $gAETabLayoutName;
// setParent …;


#4

Yeah, this is the generically right way to do it in AE scripts.

But AE scripts will always be evil :frowning: