Notifications
Clear all

[Closed] SDK: Problem from Max 8 to Max 9

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

13 Replies

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.

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

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.

1 Reply
(@maxplugins)
Joined: 11 months ago

Posts: 0

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… 😮 ), but I’ll upload the source code soon. It is open-source anyway…

Dave

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

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

Hi Vladimir,

if I can find it, I’ll upload it for you…

Dave

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

Thanks so mush Dave, I’ve been looking for it so long

Vladimir

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

Page 1 / 2