[Closed] vray shadows on with maxscript?
Does anyone know how to change standard spot light shadows to be Vray shadows with maxscript? When I switch using UI, the listener just shows:
$.raytracedShadows = on
But when I use that code to switch, it just (obviously) switches the shadows to raytraced and not to Vray shadows.
I’ve looked on the Vray help in the maxscript section but can’t see anything.
Cheers,
Cg.
Check this out: http://forums.cgsociety.org/showthread.php?f=98&t=275125&highlight=VRayShadow
$Spot01.shadowGenerator = VRayShadow()
[Edit]Erhmm… What VVaari said :)[/Edit]
You can change the shadow generator of a light by setting the .shadowGenerator property. To do this you need to create an instance of a “shadow generator” class and assign it to this property.
You can check which shadow generators are available and get information on them with this code (execute the white lines).
-- list available shadow generator classes
shadow.classes
#(shadowMap, raytraceShadow, Area_Shadows, VRayShadow, Adv__Ray_Traced, mental_ray_Shadow_Map, VRayShadowMap, Missing_Shadow_Type)
-- create a VRayShadow generator
s = VRayShadow()
VRayShadow:VRayShadow
-- list the available properties for this shadow generator
show s
.spin : float
.areaShadow (Spin) : boolean
.areaShadowType (Spin) : integer
.usize (Spin) : worldUnits
.vsize (Spin) : worldUnits
.wsize (Spin) : worldUnits
.notUsed : integer
.subdivs (Spin) : integer
.transparentShadows (Spin) : boolean
.bias (Spin) : float
.notUsed : integer
.smoothShadows (Spin) : boolean
-- assign it to the selected light(s)
$.shadowGenerator = s
VRayShadow:VRayShadow
So, in short, you can assign a VRayShadow to the selected spotlight by using:
$.shadowGenerator = VRayShadow()
Hope this helps,
Martijn
Thanks very much for that… As usual: question answered with extra education thrown in.
Man I love this interweb thingy.