custom function

need help for scripting of a custom function. although it worked last time now i get "undefined"-messages in the maxscript listener.

the little script is attached. in this script i first try to define a custum function for initilizing of a custom coordinate systeme / the elements of a custom transformation matrix.

then i try to call this function. in the end i try to assign the called parameters to variables for later calculations. all i need for calculation is the assignment of an scene object called "start.dreieck" - this is the first parameter. all other parameters callculated in the function body i want to read out.

i don't know if it is in generall possible to use parameters of a function for both directions: sending and reading. but like i earlier said - last time, with many stuff in memory after a long scripting session, it worked. what do i have to change for working after closing an restarting max?

the script:

fn koordSysInit thename nullpunkt y_achse z_achse x_achse =
(
dreieck = thename
nullpunkt = polyop.getFaceCenter dreieck 1
y_achse = normalize(polyop.getVert dreieck 1 - nullpunkt)
z_achse = polyop.getFaceNormal dreieck 1
x_achse = cross y_achse z_achse
)

koordSysInit $'start.dreieck' start_nullpunkt start_y_achse start_z_achse start_x_achse

thenullpunkt = start_nullpunkt
the_start_y_achse = start_y_achse
the_start_z_achse = start_z_achse
the_start_x_achse = start_x_achse

AttachmentSize
custom_function.ms650 bytes
custom_function.max88 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sunman's picture

solution found

i've found the answer two threads under mine. the magic key is to use a "&" before parameters to read out ("by-reference"-variables)

examples in this thread:
http://www.scriptspot.com/forums/3ds-max/general-scripting/variable-chan...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.