Notifications
Clear all

[Closed] Maxscript NURBS

Hi All,

I am having a ton of trouble finding information on creating/manipulating NURBS using maxscript. I want to create a ruled surface between 2 splines i have using maxscript

I need to convert my splines to CV curves, create a ruled surface between them and then change the surface to parametric… thats it!

any help would be greatly appreciated. this issue has to be resolved quickly as i’ll have to do this a lot!

17 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

The problem is that MAX and NURBS hate each other. So you have to play their game.
If you want to make NURBS don’t use MAX. If you want to use MAX don’t make NURBS.

While I can appreciate your comments I Need to fined a way to do this and I know it’s completely possible. There just isnt a lot of information available in the documentation. So I need a better resource.

Well besides the Help file, CgTalk is probably your best bet imo unfortunately.

I wish I could help, but I don’t know anything about nurbs creation.

 lo1

There’s actually quite a lot of information in the help file, including commands for all the things you’ve specified.

Agreed! i just cant make sense of it. I have read and re read the documentation in the max script help file and its not soaking In. If anybody has the time, energy to take a swing at it I would be most grateful. Creating a ruled surface with any 2 splines i can tear the code apart and create what i need!

I really hope somebody out there has some experience with maxscript NURBS creation/manipulation.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i have experience. and it’s very negative. several times i started different tools based on NURBS creation and every time couldn’t complete them because of a insuperable obstacle.
your case is pretty simple and LO showed the solution, but as i said for more complicated tasks the process of writing the tool becomes the continual looking for a workaround.

Here is the max file with the splines already generated just incase somebody is up to the challenge… i have included the splines them selves as well as a copy of the splines with the desired end result…

http://www.cicanimation.com/temp_download/Example_Splines.rar

Well lookin at the Nurbs documentation, the commands that are listed don’t even want to work.

Trying these on a NURBS Surface, they come up “Unknown Property”

Properties                                                       There are several properties on                    <node>                    objects that give access to sub-object selections in NURBS objects:              

                          <node>.selectedCurveCVs 	 
                          	

                          <node>.selectedCurves   
                          	

                          <node>.selectedImports 
                          	

                          <node>.selectedPoints 

 lo1

This is the simplest way I’ve found of converting two splines to nurbs curves and creating a ruled surface between them:

a = convertToNurbsCurve $Line01
b = convertToNurbsCurve $Line02

curveA = ((getNurbsSet a)[1])
curveB = ((getNurbsSet b)[1])

nS = nurbsSet()
appendObject nS curveA
appendObject nS curveB

nRS = nurbsRuledSurface parent1:1 parent2:2
appendObject nS nRS

nN = nurbsNode nS

transform nN curveA.nurbsID a.transform
transform nN curveB.nurbsID b.transform
1 Reply
(@zbuffer)
Joined: 11 months ago

Posts: 0

Hi,
i’m lurking this thread and in max2012 x64 win7 i get errors for the last ‘transform’…
is it me ?

$NURBS_Surface:Line01 @ [-64.683838,-13.255269,0.000000]
$NURBS_Surface:Line02 @ [-64.683838,-13.255269,0.000000]
<NURBSCVCurve:0x00004300>
<NURBSCVCurve:0x00004378>
<NURBSSet:0x00005cd0>
OK
OK
<NURBSRuledSurface:0x000043f0>
OK
$NURBS_Surface:Surface002 @ [0.000000,0.000000,0.000000]
-- Error occurred in anonymous codeblock; filename: D:\3D\3ds Max 2012\Scripts\Nurbs Stuff.ms; position: 319; line: 17
-- Argument count error: transform wanted 3, got 4
-- Error occurred in anonymous codeblock; filename: D:\3D\3ds Max 2012\Scripts\Nurbs Stuff.ms; position: 361; line: 18
-- Argument count error: transform wanted 3, got 4

 lo1

are you using the exact same code? it says it’s getting 4 arguments instead of 3.

1 Reply
(@zbuffer)
Joined: 11 months ago

Posts: 0

Yes, using the exact same code, works in 2011 not in 2012…

 lo1

No idea then. I wrote it on 2009. Haven’t tried working with nurbs in 2012. Maybe they broke something… wouldn’t be the first time.

Page 1 / 2