MEL Problem - Integrate int field into column

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
  08 August 2017
MEL Problem - Integrate int field into column

Hello all!

I have a pretty simple problem (I hope). I am a MEL novice, so I am still getting my head around how to properly type up commands in MEL.
I wasn't sure which search terms to use to find out how to solve my issue, so I've come here to ask for help from more experienced hands .

I present to you my 'hobo' script. It was born out of an urge to want to select/insert/delete every other edge on an object, instead of manually having to select them.

  {
    window -wh 250 70 -title "Inseldel Loops";
    columnLayout;
$command = ("polySelectEdgesEveryN edgeRing 2; polySelectEdgesEveryN edgeLoop 1;");
    button -w 250 -label "SelNthEdge" -command $command;

$command = ("polySelectEdgesEveryN edgeRing 2; polySelectEdgesEveryN edgeLoop 1; polyDelEdge -cv true -ch 1");
    button -w 250 -label "DelNthEdge" -command $command;

$command = ("polySelectSp -loop; polySelectSp -ring; PolySelectConvert 1; polySubdivideFacet -duv 2 -dvv 1 -sbm 1 -ch 1");
button -w 250 -label "InsNthEdge" -command $command;
    showWindow;
  }


• Here is what the the above command looks like today. The buttons are hardwired to the above script and offer no variability:




• Here is what I want to do with it:



I would like to be able to input a custom number into the added integer fields, which the button next to it takes into account when it is pressed/run.

I don't know how to set this up. With some help I can learn something new! 

Thank you!

With best regards,

HVER
 
  4 Weeks Ago
Does anyone know how to do this? I have been stumbling around a bit trying to solve this problem. 
I imagine I need  to set up some strings, but I am not entirely sure on how I should approach this problem...

Thanks for your time.
 
  4 Weeks Ago
Does anyone know how to do this? I have been stumbling around a bit trying to solve this problem. 
I imagine I need  to set up some strings, but I am not entirely sure on how I should approach this problem...

Thanks for your time.
 
  3 Weeks Ago
Something like this?

Just copy/paste it into the Scirpt Editor and run it.

// check if window already exist - delete if does
if ( `window -exists InseldelLoops` ) {
 deleteUI InseldelLoops; }
// START UI
window -tlb 1 -title "Inseldel Loops" InseldelLoops; 
columnLayout -adj true;
      rowColumnLayout -numberOfRows 1;  
        intField -w 50 selNthEdgeField;
        separator -w 2 -style "none";
        button -w 150 -label "SelNthEdge" -command "selNthEdge";
      setParent ..;
    
      rowColumnLayout -numberOfRows 1;  
        intField -w 50 delNthEdgeField;
        separator -w 2 -style "none";
        button -w 150 -label "DelNthEdge" -command "delNthEdge";
      setParent ..;
    
      rowColumnLayout -numberOfRows 1;  
        intField -w 50 insNthEdgeField;
        separator -w 2 -style "none";
        button -w 150 -label "InsNthEdge" -command "insNthEdge";
      setParent ..;  
     
showWindow InseldelLoops;
// END UI
// proc for each button
proc selNthEdge()
{
    int $i = `intField -q -v selNthEdgeField`;  // get the number for SelNthEdge
    
    polySelectEdgesEveryN edgeRing $i; 
    polySelectEdgesEveryN edgeLoop 1;
}
proc delNthEdge()
{
    int $x = `intField -q -v delNthEdgeField`;  // get the number for DelNthEdge
    
    polySelectEdgesEveryN edgeRing $x; 
    polySelectEdgesEveryN edgeLoop 1; 
    polyDelEdge -cv true -ch 1;
}
proc insNthEdge()
{
    int $y = `intField -q -v insNthEdgeField`;  // get the number for InsNthEdge
    
    polySelectSp -loop; 
    polySelectSp -ring; 
    PolySelectConvert 1; 
    polySubdivideFacet -duv $y -dvv 1 -sbm 1 -ch 1;
}
__________________
ArtStation -- Facebook -- Gumroad (Maya scripts)
 
  3 Weeks Ago
Big thanks to you Klaudio. Thank you for teaching me the proper syntax, and for laying out the code in such an elegant manner. :
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:05 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.