PDA

View Full Version : SDK: Problem from Max 8 to Max 9


maxplugins
10-20-2007, 10:11 AM
Hi all,

I'm in the process of updating an old plugin (MAXShade - Renderman shaders in Max) for use with Max 8 and 9.

The Max 8 version is already working fairly well, but the Max 9 version is causing me problems... The Renderman shaders I am importing use a decimal point, but my OS uses a decimal comma. In Max 8 this isn't a problem, everything works as expected, but in Max 9 none of the float values in the Renderman shader get imported (due to the decimal point / comma thing I suppose).

What I don't understand is why this works fine in Max 8, and not in Max 9. I can't find any relevant changes in the SDK that might explain this. If anyone has any ideas, I'd love to hear them...

Dave

scorpion007
10-20-2007, 11:04 AM
How does the importing code process numerical data in these shaders?

Are the shaders your average .sl type of shaders?

Where does it get numbers anyway? Hard-coded arguments to the shader, or does it parse the shader source code and do something funky?

I'd need some more information to give further assistance.

maxplugins
10-20-2007, 11:26 AM
I've attached the help file for MAXShade which explains how it works, and an example shader showing how the shader source code is adapted for MAXShade.

Basically when you load a shader, it gets parsed by the plugin, which then automatically builds a GUI for the shader using the #pragma statements.

I've spent a lot of time going through the code trying to find a reason for this problem, but when I realised that the Max 8 version works fine, I assumed that something has changed between 8 and 9 to break the parser.

Dave

scorpion007
10-20-2007, 11:45 AM
ok, so if I understand this correctly, the problem is how maxshade parses the default values for the arguments? It doesn't treat the decimal point as a separator since your locale uses commas?

I can't say what the issue is without knowing how maxshade does this. Perhaps it relies on some max sdk feature that changed, but I wouldn't have any clue as to which one.

You might want to show the code for the argument parsing, or have another look at it.

maxplugins
10-20-2007, 12:24 PM
ok, so if I understand this correctly, the problem is how maxshade parses the default values for the arguments? It doesn't treat the decimal point as a separator since your locale uses commas?

I'm just assuming this has something to do with the locale settings, but I don't know for sure. It just seems really odd to me that Max 8 on the same computer has no problems.

I won't have time today (my daughters 5th birthday party, loads of kids to keep under control... :eek: ), but I'll upload the source code soon. It is open-source anyway...

Dave

maxplugins
10-22-2007, 03:43 PM
OK, here is the original source code:
http://source.maxplugins.de/maxshade/maxshade.041204.zip

This is the Max 4 version, not the one I've already updated for Max 8/9
It just need the usual updates (there aren't many) for Max 8 and 9. I didn't upload the updated version in case I added the error (which is certainly possible!)

Cheers,

Dave

Voocha
01-03-2008, 05:42 PM
Hi Dave, im very interested in maxshade, but unfortunatly I dont have much knowledge in programming to update it for latest versions, could u be so kind to upload the max 8 version u updated, or at list explane how to do that?
Best regards
Vladimir

maxplugins
01-07-2008, 05:49 AM
Hi Vladimir,

if I can find it, I'll upload it for you...

Dave

maxplugins
01-07-2008, 03:16 PM
Here's the Max 8 version:
http://www.maxplugins.de/r8_files/duncan/maxshade_r8.zip

I think it works OK, but I haven't looked at it since October last year...

Dave

Voocha
01-07-2008, 04:53 PM
Thanks so mush Dave, I've been looking for it so long

Vladimir

Voocha
01-08-2008, 09:11 PM
Hi Dave, I was playing around with Maxshade, and i'ts fantastic, I was very impressed, that Vray actually rendered all shaders and even raytrace.sl worked well,
howerverI couldn't use renderman's ambient occlusion shader found here:

http://www.fundza.com/rman_shaders/ray/ambient_occlusion/occlude1.html

here is the code:

surface occlude1(float samples = 32){normal n = normalize(N), nf = faceforward(n, I);float hits = 0; gather("illuminance", P, nf, PI/2, samples, "distribution","cosine") { hits += 1; }/* find the average occlusion factor */float average = hits / samples; Ci = (1 - average) * Cs;Oi = 1;}
as far as I understood maxshade didn't understand gather() function,but it was not in the list of unsupported functions in maxshade,as I mentined before I'm not very goodin programming,do you have any idea how to use it,

thanks anyway

Vladimir

maxplugins
01-09-2008, 10:06 AM
I think you'll find that Renderman functions added after the plugin was written just won't work. That's why it doesn't appear in the list of unsupported functions, because it didn't exist at the time the plugin was written...

Sorry I can't help more,

Dave

leelittledragon
01-11-2008, 02:33 AM
Hi, everyone

How could create a menu in 3dsMax menu bar with use C++ MAXSDK?

Thanks!

MSN: leelittledragon@hotmail.com (http://forums.cgsociety.org/leelittledragon@hotmail.com)

leelittledragon
01-11-2008, 02:36 AM
Using MAXScript is very easily!
But using MAXSDK ...
How write I don't know !

CGTalk Moderation
01-11-2008, 02:36 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.