Jump to content

Applyoffset() - max5 / viz4


nisus
 Share

Recommended Posts

Hi all,

 

I want to be able to offset any spline a fixed amount with a single click, but I can't get the 'applyoffset()' to work properly. Can anyone help me pls?

 

tnx

 

nisus

 

ps: I'm using the max5 demo, so you are not bound to max3.1 restrcitions anymore ;)

Link to comment
Share on other sites

Hi Marc,

 

For now there is no full code yet, as I can't get the command to work properly. It is exactly this what I'm trying to achieve. Once I know how the applyoffset-command works, I can proceed.

 

I'll try to explain what I've done so far:

- I draw a spline

- make this object a variable called 'obj' (code: obj = $)

- I switch to subobject mode spline (code: subobjectlevel = 3)

- using the Maxscript Listener (& the Maxscript help) I try to find a way to offset the spline (a fixed amount of 10 for now) by typing in a command line. Unfortunately none of these work so far...

 

codes:

applyOffset obj 10 --> -- Type error: Call needs function or class, got: undefined

 

obj.applyoffset 10 --> -- Unknown property: "applyoffset" in $Line:Line01 @ [36.826347,-0.239522,0.000000]

 

This is what the help file says about applyOffset:

applyOffset

For each spline in the shape, makes a copy of the spline, offset on all sides to the distance in units specified by offset_float. If a spline is open, the resulting spline and its outline will make a single closed spline. Negative offset_float values create an offset spline to the left of the spline (as the spline is drawn from its start to its finish). The spline_shape_node is converted to a SplineShape (Editable Spline) if it is not already a SplineShape.

 

I don't really know what to do with that ...

 

Another way to accomplish the same goal was by using the 'startoutline'-command, but that only activate a button in sub-objectmode

code: splineOps.startoutline obj (make sure you are in subobjectlevel 3 (spline))

 

Any help would be most welcome ;)

 

rgds

 

nisus

Link to comment
Share on other sites

I know... but why the hell does a max5 help file contains info of viz4 only?

On the other hand, as the same info was available in the max4 helpfile (imho) discreet might have changed it in the main time... unfortunately they haven't...

 

This is horrible imho... imagine you bought a car and it's manual tells you all kind of etherical things about the open roof, but you didn't buy a cabrio... damn hell... :p

 

[ December 28, 2002, 12:33 PM: Message edited by: nisus ]

Link to comment
Share on other sites

probably you can.

if this function is an extension you should be able to transfer it to max5 (not 3.1, different SDK) by copying the responsible dll/dl? file.

but you'd have to find the right file, and it's not sure (but very possible) that it's really an extension...

 

better look if you can find an open source offset algorithm on the net or something, it would be easy to make a script then.

(i'm not good at vector geometry math stuff, i don't think i can do it from the scratch)

Link to comment
Share on other sites

Hi Marc,

 

I've tried the path of analytical math about 1.75years ago. I've sketched out graphically what to do, set up most equatations but... I'm not a programmer!

So where can we find these allready programmed sources?

 

About the dll and stuff: I've posted the same question on the discreet boards recently too, but I wonder if anyone will answer my call since the great bobo himself told me (a while ago) that it would be hard to script (and rather useless if the applyoffset was available in viz4)

 

 

rgds

 

nisus

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...