Notifications
Clear all

[Closed] Simple and noob Maxscript question

Why when I run this simple script:
Having a line selected

es = edit_spline
addModifier $ es 

I get this error

-- Unable to convert: Edit_Spline to type: Modifier

:shrug:

3 Replies

You just need to add () after edit_spline. Whenever you are calling a function that you are not passing any parameters to, you need to end it with an open/close parentheses. For example, just putting “box” in the maxscript editor does nothing, but putting “box()” in will create a box.

The open/close parentheses is basically telling MAXscript “that’s all, there’s no more I’m asking you to do”. Otherwise, it will look for additional parameters for the function. i.e.

box pos:[10,10,10] name:“ThisIsMyBox”

hum… nice… So if I just put box name:“myname” after the function than I can omit the () right?

Thanks!

 JHN

That’s right, loads of possibilities during creation time:

box name:(uniqueName #myBox) material:(standard diffusemap:(checker()) transform:(transmatrix [10,5,0]

etc.

Create a instance of any object without initial properties use “()” else don’t.

-Johan