Introduction to Maya - Modeling Fundamentals Vol 1
This course will look at the fundamentals of modeling in Maya with an emphasis on creating good topology. We'll look at what makes a good model in Maya and why objects are modeled in the way they are.
# 1 15-12-2013 , 12:14 AM
Skalman's Avatar
Registered User
Join Date: Apr 2012
Posts: 293

Repeat MEL command

OK so this is the very first time i'm trying to create a MEL script so to let you know I'm very bad at this.


however, i've got around 30 objects and 30 curves that i'm gonna extrude together to create a rope-looking effect ... i've attached some screenshots to let you know what i'm talking about ...


user added image



and the codes i get in the MEL script editor :



select -add curve61 ;
hilite polySurface60 curve61 ;
selectMode -component ;
select -r polySurface60.f[0:119] ;
polyExtrudeFacet -constructionHistory 1 -keepFacesTogether 1 -pvx 0.1323718265 -pvy -2.852035065 -pvz -0.14593462 -divisions 1 -twist 0 -taper 1 -off 0 -thickness 0 -smoothingAngle 30 -inputCurve curve61 polySurface60.f[0:119];
// Result: polyExtrudeFace1 //
setAttr "polyExtrudeFace1.divisions" 75;
setAttr "polyExtrudeFace1.twist" 1500;




basicly I want to repeat this command so that it automaticly does everything for me, and after selecting curve 61 and polySurface 60 I want it to continue but instead selecting the next curve/mesh (curve 62 + polysurface 59)...

i could ofcourse do this manually but since i've come across situations like this before i'd love to learn how to work more effectivly like this ....





OFFTOPIC:

if anyone knows why my rope starts to twist alot more in the beginning than the end i would be very thankful for an answer to that also ... :S

^
edit:
ok i figured one part out ... the bigger space between the divisions = less twist, when the curve is bending more , the amount of divisions increase = twist also increase ... next problem is trying to get an even spacing between the divisions ... user added image user added image

ok i figured out the uneven divisions problem... by going in to edit curves - rebuild curve and increasing the number of spans that made the spans even = the divisions even also .. user added image


Thanks

skalman


20 year old guy from Sweden



Big Bob Marley fan
Love skateboarding
Maya, Mudbox and Photoshop user

Full name: Marcus Ralman


https://www.facebook.com/MarcusRalman3D

^ My facebook page ^

Last edited by Skalman; 15-12-2013 at 06:28 PM.
# 2 15-12-2013 , 09:39 PM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
You'll need a basic understanding of of a few ideas

- declaring and accessing variables, especially arrays so you can make lists of your objects that you want to work with.
- commands and flags
- loops, in order to cycle through the list(S)

This would create a very basic script and not one that checks for certain conditions in order to minimize errors or unexpected results.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads