As the
documentation says, you can defined a function
in a struct like
struct foo
(
a, b, c,
fn baz n = sqrt (n + 1),
fn bar x y = print (x ^ 2 + y ^ 2)
)
but is it possible, to overload this function later? So that you tell the function to do different things later in the code? This means, the script could always execute the same function, but the result would be different depending on the code content.
Is this possivble=
Replies
And at this moment the foo.baz() function shall not calculate sqrt(n+1) anymore but just write "hello new world".
Not sure if this would be legal way to do it though :P
This works aswell:
You can assign any object to a struct member, Maxscript doesn't care if it is a variable, function or a struct.