Interfaces> Core Interfaces > IViewportShadingMgr |
The IViewportShadingMgr Core Interface exposes some properties of the advanced hardware viewport shading (per-pixel illumination and shadow casting) to MAXScript.
This interface is available in 3ds Max 2008 and higher.
Some additional properties related to viewport shading have been exposed in 3ds Max 2010 via a different set of interfaces documented here.
IViewportShadingMgr. ShadingLimits : enum : Read|Write ShadingLimits enums: { #None | #Good | #Best }
Get/Set the Viewport Shading Limits:
None - old mode, light limit dependent on graphics driver, typically 8 lights, per vertex lighting.
Good (SM 2.0) - shadow casting is enabled. On graphics hardware that supports only the SM2.0 shader model, only the old-style per vertex lighting will be calculated.
Best (SM 3.0) - shadow casting and per-pixel lighting are enabled, 64 lights are supported. This mode depends on the graphics hardware which must be SM 3.0 compliant.
This method is equivalent to the properties .ActivateViewportShading and .ShadingQuality exposed by the ViewportBasicSettings Interface in 3ds Max 2010 and higher.
Get/Set the state of the "Auto Display Selected Lights" checkbox in the "Lighting and Shadows" tab of the "Viewport Configuration" dialog. When set to true, the currently selected lights will be enabled to illuminate/cast shadows, while unselected lights will be off. When set to false, all lights will be turned on.
Get/Set the state of the "Cast Shadows for Default Light" checkbox in the "Lighting and Shadows" tab of the "Viewport Configuration" dialog. When set to true, the default lights will cast shadows. When set to false, default lights will not cast shadows.
Get/Set the value of the "Global Shadow Intensity" spinner in the "Lighting and Shadows" tab of the "Viewport Configuration" dialog. Controls the intensity of the viewport Shadows. When set to 0.5, shadows will be 50% less dense.
Get/Set whether viewport shadows will respect transparency.
Get/Set whether viewport shadows will update in the active viewport only (true) or in all viewports (false, default).
Get/Set the maximum number of lights to be displayed in the viewport. Default is 64.
Available in 3ds Max 2009 and higher.
Get/Set whether the Ambient Occlusion mode will respect transparency or not.
Available in 3ds Max 2010 and higher.
Get/Set the soft shadows filter size. Should be in the range from 0.0 to 1.0.
Available in 3ds Max 2010 and higher.
Calling this method selects all lights currently set to cast shadows in the viewports.
Only the Light node's Interface: INodeShadingProperties . ViewportShadowCasting property value is taken into account, not the base object's shadow casting property.
Calling this method selects all lights currently set to illuminate in the viewports.
Only the Light node's Interface: INodeShadingProperties . ViewportIllumination property value is taken into account, not the base object's .on property.
Calling this method disables the viewport illumination for all lights that are not selected, enabling only the selected lights to illuminate in the viewports.
If no lights are selected, the illumination is disabled for all lights.
The method manipulates the Light Node's Interface: INodeShadingProperties . ViewportIllumination property, turning Viewport Illumination on and off based on the node's selected state. It does not affect the node's . ViewportShadowCasting property.
Locks/Unlocks the currently selected lights.
When the .AutoDisplaySelLights property is set to true, lights that are not selected will not illuminate the scene.
You can lock the current selection to keep on illuminating the scene even after it has been deselected using this method with argument of true , or unlock the selected lights again by passing an argument of false .
<void>IViewportShadingMgr.GetViewportShadingLights <&node array>nodeList <enum>lightProperty nodeList is In and Out parameter lightProperty enums: {#ShadowCasting|#Illuminating|#Locked}
Returns the viewport shading lights into the by-reference array nodeList.
The lightProperty enum defines whether to collect the shadow-casting, the illuminating or the locked lights.
When the argument is true, the system will be switched to cast shadows only from selected lights. When the argument is false, all lights will be allowed to cast shadows.
Returns true if the given light is supported by the Viewport Shading system.
<bool>IViewportShadingMgr.IsShadingLimitValid <enum>ShadingLimits ShadingLimits enums: {#None|#Good|#Best}
Returns true if the given shading mode is valid on the current hardware.
Prints a GPU diagnostics report to the MAXScript Listener.
<void>IViewportShadingMgr.SetViewportShadingLimits <enum>ShadingLimits Quiet:<bool> ShadingLimits enums: {#None|#Good|#Best} Quiet default value: true
Sets the viewport shading limit to the given mode. If the quiet: optional keyword argument is specified as true, no errors will be reported if the given node is not supported on the current system.