Logo

Go Back   CGCars > CG Cars Support Forums > NURBS modeling Feedback > NURBS - General discussion
Register FAQ Members List Awards Calendar Search Today's Posts Mark Forums Read
Reply
 
Thread Tools Display Modes
Old 10-04-08, 02:38 AM   #1
didus
Junior Member

Maya



 
Join Date: Apr 2008
Posts: 1
nurbs cars shape generator (maya)

any problems to get your shape right? no matter to worry with the ncsg is your mesh done in seconds

this version is in a very early stage... but it will come up soon.

for users which have problems with nurbs or for designer which wanna just set the focus on design

its working on maya 6 i hope there will be no problems with newer version but if yes let me know.

copy paste this code bellow into your script editor in maya and say save to shelf, or mark the code and press ctrl+return

//carshape creator v.002
//hieronimus seelenbrand
//[email protected]
//if you like it,please buy the full version witch coming out soon (with lot of configuration possibilties and a smart workflow)
//(c)2008 dirk hochegger

string $carshapeWINDOW = "carcreator";
if ( `window -q -exists $carshapeWINDOW` == 1 )
deleteUI $carshapeWINDOW ;
window -sizeable true -tlb on -wh 100 60 -title "carshape" $carshapeWINDOW ;
columnLayout;

text -label "carCreator-lenov tools" -align "center";

setParent ..;
button -label "create shape" -w 105 -h 20 -c "createshape";
button -label "create car" -w 105 -h 20 -c "create";
button -label "create side" -w 105 -h 20 -c "side";

global proc createshape()
{
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1; objectMoveCommand;
select -addFirst makeNurbCircle1 ;
setAttr "makeNurbCircle1.sections" 16;
select -r nurbsCircle1.cv[11:15] ;
move -x 0.8 ;
select -r nurbsCircle1.cv[3:7] ;
move -x -0.8 ;
select -r nurbsCircle1.cv[6:12] ;
move -r 0 0 0.8;
select -r nurbsCircle1 ;
duplicate -rr;
scale -r 0.8 0.6 0.3;
setAttr "nurbsCircle2.scaleZ" .3;
move -rpr -y 0.4 ;
select -r nurbsCircle1 ;
duplicate -rr;
move -rpr -y -0.4 ;
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1; objectMoveCommand;
rotate -r -os 90 0 0 ;
select -r nurbsCircle4.ep[0] ;
select -tgl nurbsCircle4.ep[2] ;
detachCurve -ch 1 -cos on -rpo 1 nurbsCircle4.ep[0] nurbsCircle4.ep[2];
select -r detachedCurve1 ;
delete;
select -r nurbsCircle4 ;
setAttr "nurbsCircle4.scaleX" .1;
setAttr "nurbsCircle4.scaleY" .1;
setAttr "nurbsCircle4.scaleZ" .1;
move 0 0.1 0 nurbsCircle4.scalePivot nurbsCircle4.rotatePivot ;
makeIdentity -apply true -t 1 -r 1 -s 1 -n 2;
select -r nurbsCircle4 ;
rotate -r -os 0 90 0 ;
makeIdentity -apply true -t 1 -r 1 -s 1 -n 2;
curve -d 2 -p 0.8 0 0.923073 -p 0 0 1.2 -p -0.8 0 0.923073 -k 0 -k 0 -k 1 -k 1 ;
curve -d 2 -p 0.8 0 -0.058869 -p 0 0 -0.4 -p -0.8 0 -0.058869 -k 0 -k 0 -k 1 -k 1 ;
move -0.8 0 -0.058869 curve2.scalePivot curve2.rotatePivot ;

}


global proc create()
{
select -r nurbsCircle4 ;
select -tgl nurbsCircle1 ;
pathAnimation -fractionMode true -follow true -followAxis x -upAxis y -worldUpType "vector" -worldUpVector 0 1 0 -inverseUp false -inverseFront false -bank false -startTimeU 1 -endTimeU 20;
select -r nurbsCircle4 ;
snapshot -increment 1 -constructionHistory 1 -startTime 1 -endTime 20 -update animCurve;
select -r snapshot1Group ;
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "transform1_1" "transform1_2" "transform1_3" "transform1_4" "transform1_5" "transform1_6" "transform1_7" "transform1_8" "transform1_9" "transform1_10" "transform1_11" "transform1_12" "transform1_13" "transform1_14" "transform1_15" "transform1_16" "transform1_17" "transform1_18" "transform1_19" "transform1_20";
select -r nurbsCircle4 ;
duplicate -rr;
rotate -r -os 180 0 0 ;
makeIdentity -apply true -t 1 -r 1 -s 1 -n 2;
select -r nurbsCircle5 ;
select -tgl nurbsCircle3 ;
pathAnimation -fractionMode true -follow true -followAxis x -upAxis y -worldUpType "vector" -worldUpVector 0 1 0 -inverseUp false -inverseFront false -bank false -startTimeU 1 -endTimeU 20;
snapshot -increment 1 -constructionHistory 1 -startTime 1 -endTime 20 -update animCurve;
select -r snapshot2Group ;
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "transform2_1" "transform2_2" "transform2_3" "transform2_4" "transform2_5" "transform2_6" "transform2_7" "transform2_8" "transform2_9" "transform2_10" "transform2_11" "transform2_12" "transform2_13" "transform2_14" "transform2_15" "transform2_16" "transform2_17" "transform2_18" "transform2_19" "transform2_20";
detachSurface -ch 1 -rpo 1 loftedSurface1.v[5] loftedSurface1.v[14];
detachSurface -ch 1 -rpo 1 detachedSurface1.v[8] detachedSurface1.v[11];


//
//snape curve1 to surface
snap2to2 { "curve1.cv[0]", "curve1.cv[2]",

"detachedSurface4.cv[0][5]", "detachedSurface1.cv[0][0]" };
//


doubleProfileBirailSurface -bl 0.5 -tp2 0 -ch 1 -po 0 -tm 1 -tp1 0 detachedSurface4.u[0] detachedSurface1.u[0] detachedSurface3.u[0] curve1 ;
detachSurface -ch 1 -rpo 1 detachedSurface2.v[16];
detachSurface -ch 1 -rpo 1 loftedSurface1.v[3];
attachSurface -ch 1 -rpo 1 -kmk 1 -m 0 -bb 0.5 -bki 0 -p 0.1 "loftedSurface1" "detachedSurface5" ;
setAttr |detachedSurface5|detachedSurfaceShape5.io true;

detachSurface -ch 1 -rpo 1 loftedSurface1.v[5] loftedSurface1.v[1];
//
//snape curve2 to surface
snap2to2 { "curve2.cv[0]", "curve2.cv[2]",

"detachedSurface8.cv[0][3]", "loftedSurface1.cv[0][0]" };
//
doubleProfileBirailSurface -bl 0.5 -tp2 0 -ch 1 -po 0 -tm 1 -tp1 0 detachedSurface8.u[0] loftedSurface1.u[0] curve2 detachedSurface7.u[0] ;
detachCurve -ch 1 -cos on -rpo 1 nurbsCircle2.ep[2] nurbsCircle2.ep[6] nurbsCircle2.ep[10] nurbsCircle2.ep[14];

loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "dpsBirailSurface1.v[1]" "nurbsCircle2detachedCurve2";
select -r nurbsCircle2.cv[0:3] nurbsCircle2detachedCurve3.cv[3:6] nurbsCircle2detachedCurve4.cv[0:6] ;
move -r 0 0 0.3 ;
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface2.u[0]" "nurbsCircle2detachedCurve3";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface6.u[0]" "nurbsCircle2";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "dpsBirailSurface2.v[0]" "nurbsCircle2detachedCurve4";
doubleProfileBirailSurface -bl 0.5 -tp2 0 -ch 1 -po 0 -tm 1 -tp1 0 loftedSurface5.v[1] loftedSurface4.v[1] loftedSurface6.v[1] loftedSurface3.v[1] ;
detachSurface -ch 1 -rpo 1 loftedSurface2.v[11] loftedSurface2.v[14] loftedSurface2.v[16] loftedSurface2.v[17] loftedSurface2.v[2] loftedSurface2.v[3] loftedSurface2.v[4.9879031000004] loftedSurface2.v[8];

//
select -r nurbsCircle2 nurbsCircle2detachedCurve2 nurbsCircle2detachedCurve3 nurbsCircle2detachedCurve4 ;

move -r 0 0 -0.336338 ;
move -r 0 -0.137451 0 ;
rotate -r -os -12.988156 0 0 ;
scale -r 0.857485 1 1 ;
//

attachSurface -ch 1 -rpo 1 -kmk 1 -m 0 -bb 0.5 -bki 0 -p 0.1 "detachedSurface16" "loftedSurface2" ;
setAttr |loftedSurface2|loftedSurfaceShape2.io true;
}

global proc side()
{
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface4.u[2]" "detachedSurface13.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface12.u[2]" "detachedSurface3.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface11.u[2]" "detachedSurface1.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface10.u[2]" "detachedSurface6.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface9.u[2]" "loftedSurface1.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface16.u[2]" "detachedSurface7.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface15.u[2]" "detachedSurface8.u[2]";
loft -ch 1 -u 1 -c 0 -ar 1 -d 3 -ss 1 -rn 0 -po 0 -rsn true "detachedSurface14.u[2]" "detachedSurface2.u[2]";
}

showWindow $carshapeWINDOW ;

here are some screenshot how it works...







thats it have fun
didus is offline   Reply With Quote
Old 10-04-08, 02:40 AM   #2
rodderworld
CGCars Moderator
 
rodderworld's Avatar

3D Studio Max


My System

 
Join Date: Apr 2006
Posts: 4,180
Send a message via MSN to rodderworld
thanks for the donation. i haven't used maya in ages so i cant' say much but i'm sure it will be appreciated.

regards,
rodder
__________________
Lamborghini Murcielago LP640
rodderworld is offline   Reply With Quote
Old 10-04-08, 08:08 AM   #3
et_fone_home
CGCars Member
 
et_fone_home's Avatar

Maya


My System

 
Join Date: Nov 2005
Location: Australia, Vic
Posts: 532
Send a message via MSN to et_fone_home
Very nice, i might have to give it a go! Thanks!

Is there a tutorial on this?
et_fone_home is offline   Reply With Quote
Old 10-04-08, 09:30 PM   #4
younglion
CGCars Member
 
younglion's Avatar

Maya



 
Join Date: Jan 2006
Location: Toronto
Posts: 1,560
sweet donation to the maya community, thanks
__________________
current project(s)
[cl65]

upcoming projects
new lynx concept
s2k
c30

old/completed projects
[lynx concept]
[gmc savana]
[wildcat]
younglion is offline   Reply With Quote
Additional Information
Reply


Thread Tools
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
Forum Jump