PDA

View Full Version : Max 2 script not running in Max 4.2. Why? Why? Why?


The2Saint
11-22-2005, 01:18 PM
I've downloaded a script I need for my model developing (IOUV (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohlimages/iouv.zip)). Apparently this script works fine with 3DS Max 2 (according to this tutorial (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohl3.html)), 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?

Dave Black
11-22-2005, 07:08 PM
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

Bobo
11-22-2005, 07:22 PM
I've downloaded a script I need for my model developing (IOUV (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohlimages/iouv.zip)). Apparently this script works fine with 3DS Max 2 (according to this tutorial (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohl3.html)), 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...

Dave Black
11-22-2005, 07:35 PM
Or what bobo said.

:D

-Dave

The2Saint
11-22-2005, 09:19 PM
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?

Bobo
11-22-2005, 10:30 PM
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...

magicm
11-22-2005, 11:36 PM
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

Bobo
11-23-2005, 12:29 AM
I've downloaded a script I need for my model developing (IOUV (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohlimages/iouv.zip)). Apparently this script works fine with 3DS Max 2 (according to this tutorial (http://www.thewavelength.net/oldcontent/models/tutorials/q2tohl3.html)), 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?

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

CGTalk Moderation
11-23-2005, 12:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.