Vray Matte ShadowColor

Hi
I need a script that allows you to switch the set of properties to
and I managed to do each of the items, except for setting the color of the shadow:
"Vray_Matte_ShadowColor"
It's interesting that when you change the color of an object and run even an empty script, the shadow color returns to black.
Who faced such a problem and in what form should the code be presented for color change?
___
Here is the script itself:

fn ShadowPlane obj =
(
try(setUserProp obj "VRay_Matte_Enable" true)catch()
try(setUserProp obj "VRay_Matte_Alpha" -1.0)catch()
try(setUserProp obj "VRay_Matte_Shadows" true)catch()
try(setUserProp obj "VRay_Matte_ShadowAlpha" true)catch()
try(setUserProp obj "VRay_Matte_ShadowBrightness" 0.8)catch()
try(setUserProp obj "Vray_Matte_ShadowColor" [128 128 128])catch()

)
for n = 1 to objects.count do ShadowPlane objects[n]

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

you forgot commas between the numbers
[ number, number, number ]

Aarc's picture

I tried a lot of writing

I tried a lot of writing options for color.
Neither came up.
Neither commas nor points. No brackets, not every color in separate brackets.

jahman's picture

.

mxs ref
try this
([ number, number, number ] as Color)

pixamoon's picture

`

Hi,

Just checked and looks like this color needs to be set as Point3 variable [0, 0, 0] to [1.0, 1.0, 1.0] (Decimal 0.00-1.00 instead of 0-255)

In your code this line should look:

setUserProp obj "VRay_Matte_ShadowColor" [(128 / 255.0), (128 / 255.0), (128 / 255.0)]
-- or :
setUserProp obj "VRay_Matte_ShadowColor" ([128, 128, 128] / 255.0)

Note:
Each value needs to be divided by 255.0 (not by 255). This way result is Decimal not Integer

Best,
Pixamoon

Aarc's picture

`

Thank you all for your answers.
I want to note that during the week I tried to understand why the recommendations that you gave me do not work.
It turns out that in 2014 max and V-Ray 2.40, namely this one is installed in my house - a color change has not worked, but at work, where I stand 2017 max and V-Ray 3.40 - works according to the scheme that you advised me.
Thanks again, I really appreciate your help.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.