FORUMS: list search recent posts

Adjusting colors of a texture file

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacqueline Johnsen
Adjusting colors of a texture file
on Aug 31, 2011 at 10:48:57 am

I'm trying to create a Melscript GUI to adjust the colors of a character. I'm allready able to adjust the skin colors, but now for the next challenge, I want to be able to adjust the colors of a file (a difuse map I created with photoshop that holds some shadow details and color differences).

I've already got something that kinda works, but it has glitches when rendering and it's unable to give me a black color.

How I did it was, I used Color Remap. Then redirected one of the colorEntryLists to a material and now if I adjust that material it changes my eye colors. But like I said, I can't turn it black and when I render it I get artifacts on the first entrylist color.

(fyi: I needed the material so I could add a HSVtoRGB script and use this script:)

attrFieldSliderGrp -label "EyeHue" -minValue 0 -maxValue 250 -at ("hsvToRgb2.inHsvR");
attrFieldSliderGrp -label "EyeSaturation" -minValue 0 -maxValue 250 -at ("hsvToRgb2.inHsvG");
attrFieldSliderGrp -label "EyeValue" -minValue 0 -maxValue 250 -at ("hsvToRgb2.inHsvB");

Seems to me, like this is not the way to do it. Anyone got any ideas?
It be greatly apreciated! ^^

Return to posts index

Steve Sayer
Re: Adjusting colors of a texture file
on Sep 6, 2011 at 1:57:35 pm

I wouldn't use a Color Remap node for this. It's probably simpler to set up using other nodes.

You could probably get the results you want by setting up a chain like this:

'File node' > 'RGB to HSV' > 'Plus Minus Average' > HSV to RGB > 'Material colour'

With the addition of the Plus Minus Average node in there, you will be able to modify the values being passed along. It's probably easiest for the user to do this in HSV mode, which is why you need the two utility nodes to switch back and forth from RGB mode.

In this case your UI script would have to modify the attributes of the Plus Minus Average node. Note that for Hue, it does make sense to use Plus Minus Average, but if you also want to modify Saturation or Value it might make more sense to use Multiply Divide for that instead. If you want to get really fancy, of course, you can use one of each and have a branching network.

(In other words, the RGB to HSV node would feed just its H channel out to a Plus Minus Average node, and at the same time feed its S and V channels out to a Multiply Divide node. These two nodes would then both feed back into the HSV to RGB node to recombine the information.)

This is more work to set up, perhaps, but will probably make for a cleaner and more intuitive interface in the end.

Hope that helps,


Return to posts index

Jacqueline Johnsen
Re: Adjusting colors of a texture file
on Nov 17, 2011 at 9:23:27 pm

I finnaly found a solution to this, the last explanation went a bit over my head... XD Still Many thanks for it. However here's my simpler solution that works perfect for my project.
Here's how it works: I created two ramps for the colors, attached them to the blendcolor node by color1 and color2 then also attached a file to it that had a black and white image... Now all the blacks will be replaced by one color and the whites by the other. And if you have gray they will be a blend. ^^
I used this technique mainly for clothing patterns, but for the eyes as well. But with the eyes instead of 2 colors, you have one color and 1 file that shows the white and Pupil of the eye. The maskfile will then only show the Iris with the color the node can infuence.
It's a great technique. ^^
:/ Hope I'm making sense...
o// Take care!

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved