FORUMS: list search recent posts

Would appreciate some advice for my mel script tool

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeffrey Miller
Would appreciate some advice for my mel script tool
on Jun 7, 2014 at 9:00:32 pm
Last Edited By Jeffrey Miller on Jun 7, 2014 at 9:28:15 pm

Hi guys n' gals,

I'm looking for some advice as to how to approach this issue I have. I'm trying to create a panel that pops up to the left of the docked window when you click a button, it toggles.

The toggle button should be able to change its text from "<-" to "->" when you click on it, so basically, it swaps itself out.

I was referencing some scripts but the issue is that I cannot figure out how to call a procedure and change the button as well.

For reference, this is what I have thus far (I know it's taken out of context but I'll fill you in on the details in a moment)...

[some code above labeled that dock be reinitialized if it's already there with some strings]
$CB = `window
-t "Channel Box / Tool"
-tlb true -wh 260 1000`;

columnLayout -adj true;
rowColumnLayout -nc 1;
button -e -l "<-" -w 260 -h 32 -c "ToggleMergeToolbar;";
columnLayout -adj true;
// create a channel box widget
channelBox -h 600;
[a bunch of buttons under it]
showWindow $CB;


global proc ToggleMergeToolbar(){
global string $TestIt;
global string $MergeWndDisplay;
$TestIt = `paneLayout -q -vis MergeWindow`;
if ($TestIt == 0){
$MergeWndDisplay = "on";
paneLayout -e -vis 1 MergeWindow;
button -e -l "->" -c "ToggleMergeToolBar;";

if ($TestIt == 1){
$MergeWndDisplay = "off";
paneLayout -e -vis 0 MergeWindow;
if (`dockControl -ex CB`){
dockControl -e -w 400 CB;

button -e -l "<-" -c "ToggleMergeToolbar;";

$CB/ CB is for my ChannelBox Widget. I'm having issues because I think what I came up with was correct, but I'm missing something... Can someone help me out with this? Maybe provide a few answers or a script that summarizes what I'm trying to achieve?

Thank you for at least taking the time to look this post! Any comments are appreciated and would probably be helpful!

Return to posts index

Jeffrey Miller
Re: Would appreciate some advice for my mel script tool
on Jun 8, 2014 at 1:14:25 am

Alright, well, due to some hardwork and a little elbow grease... I've managed to get everything working in my script up until it tells me that:

paneLayout: Object 'MergeWindow' not found.

I'm not sure how to go about creating an object named MergeWindow. I had it set up as a procedure at one point, but that proved fruitless. Now everything is condensed into one procedure and it's still providing the same issue.

Anyone have any suggestions?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved