PDA

View Full Version : bug in mel?


MasonDoran
05-26-2003, 05:29 PM
i am trying to do multiple hotkeys base on the selected components. The listed script works....but for whatever reason the

" // Polygon Faces 34 //

else if ( size(`filterExpand -sm 34`) > 0 )
source "menu_Polygon_Merge"; "

is not working??? this is my first experience with mel....so i dont know what i am doing wrong. but this problem seems to reflect the order of the scripts?




-------------------------------

if (`popupMenu -exists tempMM`) { deleteUI tempMM; }
popupMenu -button 1 -ctl false -alt false -sh false -allowOptionBoxes true -parent viewPanes -mm 1 tempMM;



// Polygon Edges 32 //

if ( size(`filterExpand -sm 32`) > 0 )
source "menu_Edges_Merge";

// Polygon Faces 34 //

else if ( size(`filterExpand -sm 34`) > 0 )
source "menu_Polygon_Merge";



// Polygon Vertices 31 //

else if ( size(`filterExpand -sm 31`) > 0 )
polyMergeVertex -d 10 -ch 0;

// Polygon 12 //

else if ( size(`filterExpand -sm 12`) > 0 )
source "menu_Polygon_Merge";

larryvm
05-26-2003, 07:33 PM
probably you must do a source to the file with the .mel extension, i donīt sure but try to write the name of the file complete because you are doing a source to a file, not to a procedure

alexx
05-26-2003, 09:07 PM
larryvm sounds very right to me..
always full filenames in mel

cheers

alexx

ktpr
05-26-2003, 09:32 PM
// source script
source test1;
test1;

where test1 is the name of your script. I put mine the startup dir.

cheers
ktpr

bigfatMELon
05-27-2003, 12:32 AM
Rather than sourcing multiple scripts that trample on one another, write ONE script that looks at the situation and does the right thing.

-jl

MasonDoran
05-27-2003, 11:21 AM
it is sourced to a marking menu...so it doesnt use a .mel extension. I actually found the problem. When 2 different "else if" are sourced to the same marking menu it goes buggy....so i just learned how to use an || which fixes the problem


the point of what i am doing is having one hotkey that is context sensitive to what is selected and then bring up the proper marking menu and or command.

bigfatMELon
05-28-2003, 05:28 AM
ok, so why can't the code that specifies the marking menu make the decision to draw the right one instead? Or the same one with different items?

dagMenuProc.mel does precisely that. Check it out.

-jl

MasonDoran
05-28-2003, 11:37 AM
Melon, i dont know any more about mel then what i can copy and paste. Its all new to me, so i dont know how to apply your advice.


This is what i have now...and it seems to work without any problems....all though if i have multiple components selected then it doesn know what to do. What the script does is if a Polygonal object is selected....a marking menu for seperate/combine and merge edges/verts comes up. If edges or faces are selected....they are automatically collapsed. If verts are selected...they are welded (kinda like a collapse i thought)

If it is nurbs object a marking menu comes up for attach or detaching nurbs....and the relavent marking menu will come up if it is a Curve selected.

I have similar hotkeys for bevel and extrude....which i found saves a lot of time! Even the cut polygon tools has a place now because it is context sensitive...so if no poly face or object is selected....the Maya default tool is used instead.

----------------------------------



if (`popupMenu -exists tempMM`) { deleteUI tempMM; }
popupMenu -button 1 -ctl false -alt false -sh false -allowOptionBoxes true -parent viewPanes -mm 1 tempMM;



// Polygon Edges 32 //

if ( size(`filterExpand -sm 32`) > 0 )
polyCollapseEdge;

// Polygon Vertices 31 //

else if ( size(`filterExpand -sm 31`) > 0 )
polyMergeVertex -d 10 -ch 0;

// Polygon 12 //

else if ( size(`filterExpand -sm 12`) > 0 )
source "menu_Polygon_Merge";

// Polygon Faces 34 //

else if ( size(`filterExpand -sm 34`) > 0 )
polyCollapseFacet;

// Nurbs 45 10 28 //

if (( size(`filterExpand -sm 45`) > 0 )
|| ( size(`filterExpand -sm 10`) > 0 )
|| ( size(`filterExpand -sm 28`) > 0 )
)
source "menu_Nurbs_Attach";

// Curves 9 30 39 40 //
else if (( size(`filterExpand -sm 9`) > 0 )
|| ( size(`filterExpand -sm 30`) > 0 )
|| ( size(`filterExpand -sm 39`) > 0 )
|| ( size(`filterExpand -sm 40`) > 0 )
)
source "menu_Curve_attach";

CGTalk Moderation
01-15-2006, 06:00 AM
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.