PDA

View Full Version : customizing marking menus - problem !


lowkey
10-27-2002, 02:50 PM
hi all,

i'm customizing my marking menus to contain more views, but the problem i'm facing is that each command i'd like to execute is always related to a specific viewport-panel :

for example :

viewSet -rs `modelEditor -q -camera modelPanel1`;
editMenuUpdate MayaWindow|mainEditMenu;

switches viewport 1 into right view !

what i'd like to have is executing the command for the active viewport only, something like :

viewSet -rs `modelEditor -q -camera modelPanel*`;
editMenuUpdate MayaWindow|mainEditMenu;

which give me a syntax error ! :eek:

so, does anyone know how to adress the active viewport in mel ?!

thanks

-wT-
10-27-2002, 04:46 PM
Yup, I did this just a while ago, and you can do it this way:


string $theNameOfTheCurrentPanel = `getPanel -wf`; // This assigns the name of the currently selected panel to the variable "$theNameOfTheCurrentPanel"

viewSet -rs `modelEditor -q -camera $theNameOfTheCurrentPanel`; // And example on how to use the variable.


That should do it... oh damn I already miss my Maya days, solving simple problems with MEL was such a joy to me :hmm:

lowkey
10-27-2002, 04:56 PM
typed this :

viewSet -rs `modelEditor -q -camera $theNameOfTheCurrentPanel`;

unfortunately, this is what i got :

// Error: viewSet -rs `modelEditor -q -camera $theNameOfTheCurrentPanel`; //
// Error: "$theNameOfTheCurrentPanel" is an undeclared variable. //
editMenuUpdate MayaWindow|mainEditMenu;

what's wrong ?! did i make a mistake ?
:shrug:

-wT-
10-27-2002, 06:44 PM
Well did you write the

string $theNameOfTheCurrentPanel = `getPanel -wf`;

line before that?
If not, then add that one and it should work.

lowkey
10-27-2002, 07:39 PM
ahhh, now it works ! :thumbsup:

for those who're interested, this is the line to be added (in this case switch to 'right side') :

string $theNameOfTheCurrentPanel = `getPanel -wf`;
viewSet -rs `modelEditor -q -camera $theNameOfTheCurrentPanel`;

thanks a lot, man !

CGTalk Moderation
01-13-2006, 08:01 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.