Simple MEL-script for extrude-settings

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 01 January 2013   #1
Simple MEL-script for extrude-settings

Dear CGTalk,

I would like to have a MEL-script which does the following:
When I have a face selected and hit the script, I want that face to extrude with these settings:
-Divisions: 1
-Smoothing angle: 30.0000
-Thickness: 0.0050
-Offset: 0.0050

I have no idea how to make that script, but I think it should be easy. If someone could give me some pointers, I would be very grateful!

Thanks!
__________________
Ferry Passchier [2D/3D Visualizer + Fan Photographer]
Facebook - Twitter - Instagram
^
Most updates here

Last edited by FerryP : 01 January 2013 at 01:13 PM.
 
Old 01 January 2013   #2
Wouldn`t it be better to just do it once, select the new face and then hit "g" on your keyboard for "repeat last command"

Or do you want to apply the extrude to all object faces? That would be


   string $selection[] = `ls -sl`;
   int $faces[] = `polyEvaluate -f  $selection[0]`;
   for($i = 0;$i<$faces[0];$i++)
   {   
   polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 0.5 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0.005 -thickness 0.005 -smoothingAngle 30 ($selection[0] + ".f["+$i+"]");	
   }
   


Cheers, Gidsche
 
Old 01 January 2013   #3
Originally Posted by Gidsche: Wouldn`t it be better to just do it once, select the new face and then hit "g" on your keyboard for "repeat last command"

Or do you want to apply the extrude to all object faces? That would be


      string $selection[] = `ls -sl`;
      int $faces[] = `polyEvaluate -f  $selection[0]`;
      for($i = 0;$i<$faces[0];$i++)
      {   
      polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 0.5 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0.005 -thickness 0.005 -smoothingAngle 30 ($selection[0] + ".f["+$i+"]");	
      }
      


Cheers, Gidsche


I know that I can set it once and press G to repeat it. That's how I do it now.
But that's not what I really want. I want to have it seperate, so I can use it when needed.
I don't want every extrude I make to have that settings

I tried the code, and it works when I have the object selected, not when I have just one face selected :(
__________________
Ferry Passchier [2D/3D Visualizer + Fan Photographer]
Facebook - Twitter - Instagram
^
Most updates here

Last edited by FerryP : 01 January 2013 at 02:06 PM.
 
Old 01 January 2013   #4
could make a window with a input for number you can set what ever number hit go
and extrude any number not jus a set amount set in the code, jus a thought
 
Old 01 January 2013   #5
Originally Posted by thehive: could make a window with a input for number you can set what ever number hit go
and extrude any number not jus a set amount set in the code, jus a thought


Sorry, I don't really understand what you mean :(
__________________
Ferry Passchier [2D/3D Visualizer + Fan Photographer]
Facebook - Twitter - Instagram
^
Most updates here
 
Old 01 January 2013   #6
i think what you want is as simple as that:

 
{  string $selection[] = `ls -fl -sl`;
	 
	 
	  polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 0.5 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0.005 -thickness 0.005 -smoothingAngle 30 $selection; 
  
}


cheers
 
Old 01 January 2013   #7
All you need to do is open the extrude options box, set the options like you, apply, then ctrl-shift click the extrude command. It will send the extrude command to the shelf with the options selected. Unless I'm totally missing something here.

Yep, I was wrong. But I've seen this somewhere. I'll look around.
 
Old 01 January 2013   #8
Originally Posted by thematt: i think what you want is as simple as that:

 
 {  string $selection[] = `ls -fl -sl`;
 	 
 	 
 	  polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0 -pvy 0.5 -pvz 0 -divisions 1 -twist 0 -taper 1 -off 0.005 -thickness 0.005 -smoothingAngle 30 $selection; 
   
 }
 


cheers


Awesome! Thanks!!
__________________
Ferry Passchier [2D/3D Visualizer + Fan Photographer]
Facebook - Twitter - Instagram
^
Most updates here
 
Old 01 January 2013   #9
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed 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 09:00 PM.


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