XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : vray shadows on with maxscript?

3rd Dimentia
09-16-2009, 07:19 AM
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.



09-16-2009, 07:38 AM
Check this out: http://forums.cgsociety.org/showthread.php?f=98&t=275125&highlight=VRayShadow

$Spot01.shadowGenerator = VRayShadow()

09-16-2009, 07:51 AM
Erhmm.. What VVaari said :)

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
#(shadowMap, raytraceShadow, Area_Shadows, VRayShadow, Adv__Ray_Traced, mental_ray_Shadow_Map, VRayShadowMap, Missing_Shadow_Type)

-- create a VRayShadow generator
s = 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

So, in short, you can assign a VRayShadow to the selected spotlight by using:
$.shadowGenerator = VRayShadow()
Hope this helps,

3rd Dimentia
09-16-2009, 02:19 PM
Thanks very much for that.. As usual: question answered with extra education thrown in. :)

Man I love this interweb thingy.

CGTalk Moderation
09-16-2009, 02:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.