|
created MaxScript: How to Extrude Along a Spline
on 05-05-2012 03:55 AM
Hello,
I'm using MaxScript for a uni module and my idea to create a scene generator. I'm keeping it simple for now and sticking with just a hilly scene.
What I would like to know is how to create a road using maxscript. Ideally, I would like to be able to select a spline, then create a box at the start and have it extrude along the spline.
Thanks
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
|
Select a path or shape.   Create panel   (Geometry)  Compound Objects  Object Type rollout  Loft Select a path or shape.  Create menu  Compound Objects  Loft
Or search in max reference compound loft.
|
, triangle,
492 Posts,
Join Date Dec 2011,
Location Romania, Bucharest
|
Thanks but I'm looking to do this in maxscript so I need the code to automatically do this process 
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
|
Don't you have to create the scene generator ? As in you ? :p
|
, triangle,
492 Posts,
Join Date Dec 2011,
Location Romania, Bucharest
|
Yes, I'm writing code that automatically creates hills, trees, rocks, etc for the user. What I want is for the user to create a line on the plane that has been created and for them to press a button which will create a road along that line.
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
, triangle,
492 Posts,
Join Date Dec 2011,
Location Romania, Bucharest
|
Thanks but I've managed to do that before but it struggles to work going round corners because it makes multiple boxes, it doesn't look smooth.
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
|
Back when I messed around with the Loft modifier, i ran into a brick wall because it's not exposed to scripting.. :-/
|
, polycounter,
1,286 Posts,
Join Date Aug 2011,
Location Berlin
|
Yeah, you don't loft in MaxScript. That's why I want it to extrude along the spline. That I know you can do, I'm just not sure how.
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
|
So dude i recorded with the max listener and this is what i get.
$.EditablePoly.SetSelection #Face #{2}
macros.run "Editable Polygon Object" "EPoly_Extrude_Along_Spline"
$.extrudeAlongSplineNode = $Line001
$.EditablePoly.ExtrudeAlongSpline ()
Can you make it to get the face that forms the road section and the line that user wants and make the script ?
And yes you are right it uses the extrude along spline.
|
, triangle,
492 Posts,
Join Date Dec 2011,
Location Romania, Bucharest
|
Ah, thanks a lot  I can use that, I just need a way to place the box on the end of the line to start off with...
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
|
getKnotPoint <shape> <spline_index_integer> <knot_index_integer> use this to get
the coord of the first vertex(knot) in the line and move your box to that point ?
|
, triangle,
492 Posts,
Join Date Dec 2011,
Location Romania, Bucharest
|
Thank you!
Last thing to do now is to make my road mold to the plane...
Last edited by Quickwits92; 05-06-2012 at 07:15 AM..
|
, null,
10 Posts,
Join Date May 2012,
Location Portsmouth, England
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|