renderers.current = VRay()
vr=renderers.current
IDisplayGamma.colorCorrectionMode = #gamma
IDisplayGamma.gamma = 2.2
IDisplayGamma.affectColorPickers = true
IDisplayGamma.affectMEdit = true
fileInGamma = 2.2
fileOutGamma = 2.2
renderPresets.Loadall 0 "X:\\Path\\preset\\preset.rps"
renderheight= 1920
renderwidth= 1080
vr.options_probabilisticLights = false
vr.options_overrideDepth_on = true
vr.options_maxRayIntensity_on = false
vr.imageSampler_type = 2 -- 0=Fixed, 1=Adaptive, 2=Adaptive subdv, 3=Progressive
vr.filter_on = true
vr.filter_kernel = Area() -- Cubic(), Video(), Soften(), Blend()...ect
vr.adaptiveSubdivision_minRate = -1
vr.adaptiveSubdivision_maxRate = 2
vr.imageSampler_shadingRate = 1
vr.adaptiveSubdivision_threshold = 0.05
vr.dmc_subdivs_mult = 1
vr.imageSampler_type = 1 -- 0=Fixed, 1=Adaptive, 2=Adaptive subdv, 3=Progressive
vr.filter_on = true
vr.filter_kernel = Area() -- Cubic(), Video(), Soften(), Blend()...ect
vr.twoLevel_baseSubdivs = 1
vr.twoLevel_fineSubdivs = 8
vr.imageSampler_shadingRate = 10
vr.dmc_earlyTermination_amount = 1
vr.dmc_earlyTermination_minSamples = 8
vr.dmc_earlyTermination_threshold = 0.01
vr.environment_gi_on = true
vr.environment_gi_color = color 204 230 255
vr.environment_gi_map_on = true
hdr = VRayhdri()
hdr.HDRIMapName = "X:\\chemin\\de\\votre\\hdri.hdr"
hdr.mapType = 2
hdr.horizontalRotation = 55
hdr.multiplier = 3.0
vr.environment_gi_map = hdr
vr.gi_on = true
vr.gi_primary_type = 3 -- 0=Irradiance map, 1=Photon map, 2=Brute force, 3=Light cache
vr.gi_secondary_type = 3 -- 0=None, 1=Photon map, 2=Brute force, 3=Light cache
vr.dmcgi_subdivs = 128 -- Subdivs de GI en Brute Force
vr.lightcache_subdivs = 444
vr.lightcache_sampleSize = 0.02
vr.lightcache_storeDirectLight = 0
vr.lightcache_multipleViews = false
vr.lightcache_prefilter_on = true
vr.lightcache_prefilter_samples = 64
vr.lightcache_retrace_on = false
vr.lightcache_useForGlossyRays = true
vr.lightcache_bounces = 100
vr.lightcache_adaptiveTracing = false
vr.lightcache_retrace_on = false
vr.lightcache_adaptiveTracing_dirsOnly = false
vr.lightcache_filter_type = 2
vr.lightcache_filter_size = 0.06
vr.lightcache_mode = 0
vr.gi_irradmap_preset = 1
vr.gi_irradmap_minRate = -4
vr.gi_irradmap_maxRate = -3
vr.gi_irradmap_subdivs = 33
vr.gi_irradmap_interpSamples = 20
vr.gi_irradmap_showCalcPhase = true
vr.gi_irradmap_showDirectLight = false
vr.gi_irradmap_colorThreshold = 0.4
vr.gi_irradmap_normalThreshold = 0.3
vr.gi_irradmap_distThreshold = 0.1
vr.system_region_x = 48
vr.system_region_y = 48
vr.system_region_sequence = 3
vr.system_region_sequence_reverse = 0
vr.system_embree_on = true
vr.system_raycaster_memLimit = 0
vr.system_embree_hair = false
vr.colorMapping_type = 0
vr.colorMapping_gamma = 1
vr.colorMapping_affectBackground = false
vr.colorMapping_linearWorkflow = false
vr.colorMapping_darkMult = 1
vr.colorMapping_brightMult = 1
for a in (getClassInstances VrayMtl) do
(
a.option_traceRefraction = false
a.option_traceReflection = false --(si pas besoin)
a.preservationMode = 1 --(switch dans les Options VrayMtl "preservation mode en Mono")
a.option_useirradmap = false --( pas de IRRMAP par defaut donc supp de UseirrMap)
)
for a in getclassinstances VRayMtl do
(
a.texmap_diffuse.coords.blur = val
)
for a in getclassinstances VRayMtl do
(
a.texmap_displacement_on = off
)
VRayMap, VRayLightMtl, VRayFastSSS2, VRayFastSSS, VRayMtl, VRayLight, VRayIES, VRayShadow
val = 8
for a in getclassinstances VRayMap do
(
a.reflect_subdivs = val
a.refract_subdivs = val
)
for a in getclassinstances VRayLightMtl do
(
a.directLight_subdivs = val
)
for a in getclassinstances VRayFastSSS2 do
(
a.specular_subdivs = val
a.single_scatter_subdivs = val
)
for a in getclassinstances VRayFastSSS do
(
a.subdivs = val
)
for a in getclassinstances VRayMtl do
(
a.reflection_subdivs = val
a.refraction_subdivs = val
a.option_useirradmap = true
)
for a in getclassinstances VRayLight do
(
a.subdivs = val
a.storeWithIrradMap = false
)
for a in getclassinstances VRaySun do
(
a.shadow_subdivs = val
)
for a in getclassinstances VRayIES do
(
a.shape_subdivs = val
)
for a in getclassinstances VRayShadow do
(
a.subdivs = val
)
r = maxOps.GetCurRenderElementMgr()
r.SetElementsActive
r.removeallrenderelements()
r.AddRenderElement (VrayRawGlobalIllumination elementname:"RawGI")
r.AddRenderElement (VrayRawLighting elementname:"RawLighting")
r.AddRenderElement (VrayReflection elementname:"Reflection")
r.AddRenderElement (VrayRefraction elementname:"Refraction")
r.AddRenderElement (VrayRawShadow elementname:"Shadow")
r.AddRenderElement (VrayDiffuseFilter elementname:"Diffuse")
r.AddRenderElement (VraySpecular elementname:"Specular")
r.AddRenderElement (VrayMtlReflectGlossiness elementname:"ReflectGlossiness")
r.AddRenderElement (VraySelfillumination elementname:"Selfillumination")
r.AddRenderElement (VRayNormals elementname:"Normal")
r.AddRenderElement (VRayZDepth elementname:"VRayZDepth")
r.AddRenderElement (VrayVelocity elementname:"Velocity")
r.AddRenderElement (VRayExtraTex elementname:"PositionPass")
r.AddRenderElement (VRayExtraTex elementname:"AO")
Par rapport à la liste ci-dessus
elementCount = r.NumRenderElements() --Enumeration des Render Element courant
z = r.GetRenderElement (elementCount-4) --Selection de bas (-4) en haut pour selectionner "VRayZDepth"
z.vrayVFB = true
z.clamp_zdepth = true
z.zdepth_min = 200
z.zdepth_max = 3000
z.invert_zdepth = true
Par rapport à la liste ci-dessus
elementCount = r.NumRenderElements() --Enumeration des Render Element courant
g = r.GetRenderElement (elementCount-3) --Selection de bas (-3) en haut pour selectionner "Velocity"
g.vrayVFB = false
g.clamp_velocity = false
g.max_velocity = 100
g.ignore_z_direction = true
Par rapport à la liste ci-dessus
elementCount = r.NumRenderElements() --Enumeration des Render Element courant
g = r.GetRenderElement (elementCount-2) --Selection de bas (-2) en haut pour selectionner "PositionPass"
ppass = VRaySamplerInfoTex()
ppass.name = "PositionPass"
ppass.type = 0
ppass.coord_system = 2
g.texture = ppass
g.consider_for_antialiasing = false
Par rapport à la liste ci-dessus
elementCount = r.NumRenderElements()
k = r.GetRenderElement (elementCount-1)
vdirt = VRayDirt()
vdirt.name = "AO"
vdirt.radius = 16
vdirt.subdivs = 200
k.texture = vdirt
renderSceneDialog.update()
freeSceneBitmaps(); gc light:true
mergeMAXFile "X:\\path\\de\\votre\\fichier.max"