CGTalk > Software > Autodesk Maya
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-28-2013, 01:06 PM   #1
FerryP
Parttime lurker
 
FerryP's Avatar
portfolio
Ferry Passchier
2D/3D artist
The Hague, Netherlands
 
Join Date: Jul 2009
Posts: 217
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-28-2013 at 01:13 PM.
 
Old 01-28-2013, 01:53 PM   #2
Gidsche
New Member
Michael Gidzinski
Animator | Rigger | Scripter
RTT AG
Munich, Germany
 
Join Date: Jun 2006
Posts: 7
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

Code:
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-28-2013, 02:02 PM   #3
FerryP
Parttime lurker
 
FerryP's Avatar
portfolio
Ferry Passchier
2D/3D artist
The Hague, Netherlands
 
Join Date: Jul 2009
Posts: 217
Quote:
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

Code:
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-28-2013 at 02:06 PM.
 
Old 01-28-2013, 02:21 PM   #4
thehive
Expert
portfolio
Eric Robert
animator/ illustrator
work/\holic Studios.com
Orlando, United States
 
Join Date: Feb 2005
Posts: 1,687
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-28-2013, 02:26 PM   #5
FerryP
Parttime lurker
 
FerryP's Avatar
portfolio
Ferry Passchier
2D/3D artist
The Hague, Netherlands
 
Join Date: Jul 2009
Posts: 217
Quote:
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-28-2013, 04:10 PM   #6
thematt
brain filler
 
thematt's Avatar
matt
EMCA
France
 
Join Date: Mar 2003
Posts: 1,515
i think what you want is as simple as that:

Code:
{ 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-29-2013, 03:42 AM   #7
fleabay
Attribute Editor
portfolio
Puddin' Tane
USA
 
Join Date: Jan 2013
Posts: 331
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-29-2013, 02:53 PM   #8
FerryP
Parttime lurker
 
FerryP's Avatar
portfolio
Ferry Passchier
2D/3D artist
The Hague, Netherlands
 
Join Date: Jul 2009
Posts: 217
Quote:
Originally Posted by thematt
i think what you want is as simple as that:

Code:
{ 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-29-2013, 02:53 PM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:54 PM.


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