Thanks a lot Justin,
I was testing version 1.2.2 and had no swapping texture problems anymore. Downloading 1.2.3 now.
volderette
Thanks a lot Justin,
I was testing version 1.2.2 and had no swapping texture problems anymore. Downloading 1.2.3 now.
volderette
Awesome. Glad it’s working well now. I wasn’t able to reproduce the error after the tool was updated to v1.2.2 so it should be good to go. Hopefully adding support for the mib_color_mix will help some people out as well.
One other thing I wanted to mention is that I actually added a feature to this tool that helps manage ambient occlusion for mia_materials. Part of the whole ‘linear workflow toolkit’ idea. It allows you to adjust all ambient occlusion parameters for either a selected number of mia_materials or all of them in the scene. I wanted the exact same UI as seen on the mia_material material to function exactly the same way…I just wanted to be able to adjust a selected number of materials or all of them in the scene at the same time. I didn’t expose the controls for this because after I wrote it I felt it should have an entire separate UI instead of being tacked onto the end of this one…or at least have a scroll bar. I’ve been too busy to go back and make the separate UI so I just left those controls hidden.
But just in case anyone is interested I thought I’d throw that out there. I can upload a separate version of the tools that has that feature exposed if anyone would like to try it.
-Justin
I think i’ve found another error. Sometimes i get a “Error: Attribute name not recognized” when i try to undo. For now i only had this in scenes where i set some lights. I will send you a scene where the problem is reproducible.
Also I used a volume light today and there you have a ramp to set a color range. The colors of this ramp dont get gamma corrected when I try to update all shaders with your gamma tool.
Using your tool almost daily right now. Thanks a lot again.
volderette
Thanks for the heads up. I’ll take a look and see what the deal is. Glad it’s helping you out.
-Justin
Updated to v.1.2.4
That error should be fixed now. Let me know if it works out for you.
I’ll support that volume light later on as well.
-Justin
Wow, that was quick. Great support!
Edit:
Now with 1.2.4 I get a “// Error: Unknown object type: mib_color_mix” when i try to update all shaders.
Just wanted to let anyone who is using the latest version know that this is caused by mental ray not being loaded in the plug-in manager. There was a typo in this post and what volderette meant to type was:
// Error: Unknown object type: mia_physicalsky //
For right now, if mental ray is not loaded and you try and run the tool it will throw an error and complain it can’t find the mental ray physical sky node. Once mental ray is loaded the tool will run perfectly fine though. Its performance will not be affected at all.
This is a known issue at this point and one I will be fixing in the near future.
Thanks,
Justin
Fixed the bug that would throw an error if mental ray plug-in is not loaded.
I know I’ve been constantly updating this script as of late with minor things, and that might be kind of annoying. But I feel its important to have this bug free. So as soon as I fix a known bug I figure its best to put it out there instead of waiting.
Thanks,
Justin
You effort is much appreciated. Im curious though, as to the whole gamma correcting colors on lights. Is it only on the Maya lights and not the MR lights that needs correction?
Awesome tool Justin! I use it practically every day. 
one thing that I’ve noticed though, is that it doesn’t gamma correct the reflection color of the mia material. is there any particular reason for that?
In this version I added support for the ‘color range’ section of the volume light and support for the mia_light_surface. The cool thing about it is that the connection from the mia_light_surface to the mia_material still will not be gamma corrected, only the color swatch of the light surface itself.
I would recommend testing this one on an old scene or two before using it. Supporting the ‘color range’ section of the volume light meant sorting multi compounds. I’m 99% sure it’s air tight, but still, it would be a good idea to test it out. That’s why I still left the old version up there. Let me know if you run into any bugs.
Glad it’s been helping you out. The reason that one isn’t included is because of the information in this thread:
http://forums.cgsociety.org/showthread.php?f=87&t=809879
David’s logic made sense to me, so I went with that approach.
Is it only on the Maya lights and not the MR lights that needs correction?
Well, that depends. If you have to pick the color via a color swatch, meaning the color looks right to your eye, most likely it needs to be gamma corrected. Some of the mental ray lights, like the black_body are selected based on a Kelvin color temperature measurement and are already linear. So those do not need it.

Yes, I did write those things, and I probably sounded like I knew what I was writing about, but really I was discussing my take on the subject and open to other peoples reasoning. These days I try to be a bit more cautious, because what starts as a discussion (18 months ago) can end up looking like a statement of fact, and that can lead to confusion if it turns out later to be incorrect.
Short story:
My current opinion is that you should gamma correct your reflection color for a linear workflow if you want the reflection to look like the swatch.
Long story:
You can test this quickly by assigning a black mia_material_x to a sphere, and a white surface shader to a nearby cube. Set the mia reflectivity=1 and set a reflection color=128,0,0 (mid red). Make sure the mia BRDF 0 & 90 degree reflection values are 1. You should then get pure and even reflection of the white cube. Turn off the default light in render settings render options.
If you render this in maya2011 renderview with the renderView colorManagement set to ImageColorProfile=Linear and DisplayColorProfile=sRGB then you’ll be rendering linear and seeing an sRGB result. (Note: no exposure nodes required).
Then if you compare the color of the rendered reflection with the mia reflection color swatch you’ll find the reflection is brighter 186,0,0 (it should be 128,0,0)
Now if you hook up a gamma correct (gamma=0.455) and set the same mid red color in the gammaCorrect node and do the render again you’ll see that now the reflection is exactly the same color as the swatch 128,0,0
Sorry for the long post, but I feel bad that I may have sent you (and probably many others) up the wrong path. Please test it yourself and if you disagree, please let me know.
David
Hey David,
Thanks a lot for the thorough reply. The topic of gamma correction in mental ray is a tricky one. I appreciate all the work you’ve put into helping figure out a proper work flow in mental ray over the past few years. It’s unfortunate that its such a pain in mental ray for maya, but in a way I’m glad it is a pain. It’s forced me to gain a serious and thorough understanding of the issue. I even took Zap’s class and I still have to go back and ask him questions every now and then on the subject. It’s a pain, but I end up with a much better understanding of the subject than I would have if it just worked…which it should.
I’ll conduct the test that you mentioned, but I have no doubt the results will be as you say they are. I will also change the way the script works so that the reflection color will be gamma corrected as well. Zap’s general advice on whether or not something should be gamma corrected can be summed up as: “The rule of thumb should be, is it a color I see, or a number.” The reflection color is definitely a color I end up seeing in the final result, so it would make sense that it would need to be gamma corrected. The idea of the reflection having a color is one of the things that makes metal look like metal.
Thanks again, David.
-Justin
So I introduced a bug into the v1.3 like I thought might possibly maybe could happen. It was a small one, but it would definitely break. Anyways, it’s fixed now.
Reading all this stuff about linear workflow and so on inspired me to the following idea…
check out my screenshot jpg.
What do you guys think if every shader had the linearize button like i did in my screenshot. :rolleyes:
I think this would make life simpler right ?
I replaced so far in the showEditor.mel the “Focus” button which noone uses anyway with the “linear on/off” button.
for now it does nothing but in couple of weeks i think i will make it happen…

That would be amazing. But! There should be a global toggle too, so if you want to go back to non-linear, you shouldn´t have to go through every material.
yes. You are right. There should be a global toggle. 
I think one should combine this method with the fantastic jjj_gammatools. ![]()
I hacked Justins jjj_gammaTools (hope you are ok with that
) and implemented it into the Maya Interface quickly (while my girlfriend was having a nap besides me); that means its not perfect or final.
Check the script out . You can place into your documents/maya/script folder. 

@PK: Nice idea. I like it.
After reading David’s thoughts on what should and should not be gamma corrected and mulling over Zap’s general rule of thumb, I’ve added support for additional attrs for certain nodes.
mia_materials: reflection color, refraction color, and the 2 ambient occlusion colors.
misss_fast_shaders: overall color, and the different kinds of specular colors where applicable.
The reason I added the ambient occlusion colors is because they are colors you see in the final render. They are not numbers. So if they are colors you actually see, they need gamma correction. If anyone disagrees, I would be interested to hear why and am open to suggestions.
I also made some slight speed improvements. Honestly it’s so slight it probably won’t even be noticeable since it works darn fast anyways. I did it just for the heck of it. 
No bugs should be introduced. I couldn’t produce any. But if you run into one let me know and I’ll fix it.
Thanks,
Justin
deeX shaders have a gamma button on all shaders ![]()
But it is just for *_x mentalRay shaders.
