script for adding color correct

Just wondering if somebody could do a simple script to add a color correct map with the 2.2 gamma to all selected object’s diffuse maps. I would be most grateful.

first version - works on standard, raytrace and vray materials as well as multi subobjects. I’ll add in more controls and stability later.

http://www.joconnell.com/stuff/vray\_cc\_01.ms

Run the script, customise your ui and you’ll find it under John O’Connell tools.

Could you just work harder on your point 4 of the to be done list?

:lol:

PS: Thanks a lot of course!

Well, I’m fairly shit at that part so I decided to beocme a 3d op in a post house so i can complain about the long hours and lack of dependability outside of work - it’s all a clever smokescreen :smile:

Wow! That was fast :smile:

Now, I can’t seem to get it to not add multiple colOUr correct maps per material. So far I get anywhere from 3 to 8 per material.

Is that my problem or the script problem?

Thanks so much!

Heya tim,

one of the current problems is that it literally takes whatever is in the diffuse and puts it into a colour correct map - I’ll add in a check to make sure that there isn’t already a colour correct map in there and if there is, simply adjust the gamma.

Hmm, 'cause I was just trying it on vray materials with only one map in the diffuse channel - no color corrects. And still for some reason it adds anywhere from 3 to 9 color corrects with 2.2 all on top of each other, which of course just turns the base map black.

We are doing an animation with our output gamma set to 2.2 and I am going to need to adjust a lot of car & plant texture maps accordingly. So if I can get this script to work for me it will be a piece of cake.

That’s rather odd - I’ll have a look at the code now and see have I done anything daft.

Are you using a lot of multi sub object materials?

Okay here’s a new version - the main difference is it checks the material to see if it has a colour correct already and if it does it only changes the gamma value. If it has any other type of texture instead, it’ll nest that texture in a colour correct slot with the specified gamma. Previously if you kept running the script, it was quite dumb and would take whatever you had in the diffuse slot and put it into a colour correct so you would keep putting your current colour correct into another colour correct and you’d end up with as many colour corrects as button presses. The new version won;t do this anymore.

http://www.joconnell.com/stuff/vray\_cc\_02.ms

Thanks, I’ll give it a shot. I wasn’t using sub object mats at all.

The only other map in the material was in the opacity slot. I didn’t try the script on a material without an opacity map, but I can’t imagine why that would have messed it up.

Ok, I tried the new script and this time I just get a Maxscript Rollout Hander Exception: --Unknown property: “material” in $selection and then it highlites this line of the script if (classof $.material.texmap_diffuse != ColorCorrect) then

And nothing changes at all in the material now.

Ok, I think I figured out what the original problem was…I was testing the script on a group, all with the same material. So however many objects were in the group was how many times the color correct map was applied.

Now, as far as the 2nd script goes, I don’t have a clue about that.

I’m off the crack now - try the same .02 again.

Ok, it works, but still doesn’t prevent multiple layers. However, this is great still, and thank you so much for doing this!

could you send mer a simple scene where this is happening? Maybe replace all of the meshes with boxes or similar?

Sure, got Max 8?

Not here - I’m on 7 so that may be whats causing our problem. We havent moved up to 8 yet here since we havent had down time to upgrade. I’ve still got a good few days left in the trial version at home though so if you mail me something at *mail removed* i’ll have a look this evening.

Thanks, email is on it’s way.

Hi Tim,

I got a chance to have a look at the sample scene that you sent me and it seems to be working as expected here so I’m not sure what the problem is. As a bit of a preventative measure though I’ll add in a control to strip out the colour correct map from any material to clean it so you can re apply the script - I thought it might be something weird with colorcorrect’s maxscript settings under 8 but they seem to be the same - I’m using the colorcorrect build for max 7 and I’m on max 8.1 at home - anything different to you there?

John,

Just tried your script and ran into an error with Shellac materials.

-- Unknown property: “diffuseMap” in CarPaint:Shellac

I’m running Max 8 SP2. The object in question uses a multi/sub-object which includes a Carpaint material (hence the Shellac).

Thanks,
Ryan