[Closed] Max 2 script not running in Max 4.2. Why? Why? Why?
I’ve downloaded a script I need for my model developing (IOUV). Apparently this script works fine with 3DS Max 2 (according to this tutorial), but when I’m trying it in 3DS Max 4, the program says ’ “numfaces” is undefined’. The problem occurs in the the “Set Project Path” button is clicked. Can anyone tell me what’s wrong please?
There was a major change in the way variables were handled between R2 and R3.
Most probably numfaces has been declared implicitly and was implicitly global in R2 but implicitly local in R3-R8. Many MAX 2 scripts would break because of that…
Is there anything I can do about this? I guess (hope) there is an automatic a converter avalible to convert R2 to R3/R4/R5?
No, there is no need for conversion. Someone who knows MAXScript would have to take a look at the source code and add some LOCAL and GLOBAL declarations where needed to avoid the problem (assuming my suspicion is right). The language syntax has not changed, so there cannot be a converter. What has changed is how MAXScript handles variables that have not been declared explicitly…
Try changing the line
utility IOUV “IOUV v0.7”
(
to
utility IOUV “IOUV v0.7”
(
local c_obj, f_array, findex, cindex, newfindex, newcindex, numb
and see if it works…
Cheers,
Bobo
Well, the word “numfaces” is commonly used as a variable. If you post the script, I might be able to see what’s going wrong. It’s very possible that a parameter or function has changed from one release to the next. It may be as simple as changing the parameter name.
Again, post the script, or the part where “numfaces” is used.
-Dave
I took a quick look at the script you are talking about, and I think your best bet would be to contact the author. It doesn’t work because of what bobo said, and to fix this will probably require some rewriting. Unless ofcourse you declare every variable in there as a global on the top of the script.
- Martijn