Documentation
Iray includes support for MaxScript within 3ds Max. These functions have been made available to allow reading and modification of Iray+ Lights, Materials and Render Settings.
The Iray+ Render Settings can be read and modified using standard MaxScript functions.
renderers.current = Iray() // set the renderer to Iray+, You could also use Iray__Interactive() here. cur = renderers.current showproperties cur //show all render properties available to Iray+ renderer pathtofile = "C:\previews\BackplateImg.jpg" cur.backplate_file = pathtofile //Set the backplate image
.brightness : float .saturation : float .burn_highlights : float .crush_blacks : float .use_custom_whitepoint : boolean .whitepoint : RGB color .whitepoint_preset : integer .cloud_address : string .cloud_video_format : string .cloud_video_bit_rate : integer .cloud_video_frame_rate : integer .backplate_use : boolean .backplate_fit : boolean .backplate_file : string .backplate_scale : point2 .backplate_scale_linked : boolean .backplate_offset : point2 .backplate_gamma : float .dof_enable : boolean .dof_strength : float .dof_use_target_dist : boolean .dof_focus_dist : float .dof_backplate : boolean .iteration_count : integer .max_rendering_time : integer .physically_accurate : boolean .photo_max_bounces : integer .caustic_sampler : boolean .irt_approx_bounced_light : boolean .irt_approx_area_light : boolean .irt_max_bounces : integer .bloom_filter_enable: boolean .bloom_filter_radius: float .bloom_filter_threshold: float .bloom_filter_strength: float▲
Iray+ materials can be created using a single initialiser:
Iray__Material()
The layer on this can then be changed using irpSetMaterialType
IrayMaterial = Iray__Material() //Assigns a name to the Iray+ material. This can then be assigned to a scene object▲
An Iray+ map can be created using a similar approach to the creation of an Iray+ material.
IrayMaterial = Iray__Perlin_Noise()
Iray__Perlin_Noise() Iray__Worley_Noise() Iray__Flake_Noise() Iray__Flow_Noise()▲
irpGetPropertyList <object.material>
This function returns the property names of a specified object as an array.
irpGetPropertyList $obj.mat▲
irpSetProperty <object.material> <property_name_string> <property_value>
Allows you to access and set the properties of an Iray+ material.
irpSetProperty $obj.mat "refr_gloss" 1.0
You can also pass maps to the Iray+ material using this function. If supported, it will attach the map to the specified material parameter.
irpGetPropertyList
.irpGetProperty <object.material> <property_name_string>
Allows you to get the property of an Iray+ material.
irpGetProperty $obj.mat "refr_gloss" // Returns the value of the "refr_gloss" parameter
irpGetPropertyList
irpSetMaterialType <object.material> <IRP_LayerName_string> <enable_emission_bool>
Used to set the material layer type of the Iray+ material.
IrayMaterial = Iray__Material() // create a new Iray+ material irpSetMaterialType IrayMaterial "IrayPlus_ArchAndDesign" false // Set the layer type of an Iray+ Material to IrayPlus_ArchAndDesign. Disable emission on the material.
You can apply one of the Iray+ mental ray® conversion material layers using:
"IrayPlus_Generic" "IrayPlus_ArchAndDesign" "IrayPlus_MetallicPaint" "IrayPlus_FastSSS" "IrayPlus_SkinSSS"
Alternatively, you can set one of the standard Iray+ material layers using the name of the required layer. A list of the layer names can be found here
For example, to set a Velvet material with no emission you would use:
irpSetMaterialType $obj.mat "Velvet" false // Set the layer type of the Iray+ Material to Velvet. Disable emission on the material.▲
irpGetMaterialType <object.material>
Used to get the layer type of the Iray+ material.
irpGetMaterialType allObjects[1].mat //Returns a string containing the layer type of the currently applied Iray+ material layer.▲
irpExportMDL <object.material> [ filename:<output_filename> ]
Used to get export the Iray+ material to MDL.
The optional 'filename' key allows you to specify the name of the mdl file to export to. If this key is not set, then a File Save dialog will be displayed.
irpExportMDL allObjects[1].mat filename:"c:/outputdirectory/material.mdl"▲
Most of the lights are supported using the standard built-in MaxScript functions. For more information on these functions, please refer to the Autodesk MaxScript Documentation.
setProperty <IrayLight> <light_property> <value> //uses the max setProperty function to set an Iray+ lights property▲
There are some miscellaneous settings exposed to maxscript as described below:
Enable, disable, or query the state of the Irradiance layer:
MAXScriptIrayPlusRenderer.enableIrradiance [ = <optional_bool> ]
MAXScriptIrayPlusRenderer.enableIrradiance = true // To query the state, simply omit the true/false condition
Get the minimum or maximum Irradiance values in the scene.
MAXScriptIrayPlusRenderer.minIrradiance
MAXScriptIrayPlusRenderer.maxIrradiance
MAXScriptIrayPlusRenderer.maxIrradiance
Get the minimum or maximum Irradiance colour in the scene.
MAXScriptIrayPlusRenderer.getIrradianceDisplayColour<Min/Max_Scene_Irradiance>
MAXScriptIrayPlusRenderer.getIrradianceDisplayColour MAXScriptIrayPlusRenderer.minIrradiance▲
Page Last Edited: