-- PART 1: Convert V-Ray HDRI maps to Standard Bitmap Textures for b in (getClassInstances VrayHDRI) do ( -- Check that the map has a valid file path before converting if (b.HDRIMapName != undefined) and (b.HDRIMapName != "") do ( -- Create a new standard Bitmap local new_bmp = BitmapTexture() -- Transfer the file path and the original name new_bmp.filename = b.HDRIMapName new_bmp.name = b.name -- Globally replace the V-Ray HDRI with the new BitmapTexture replaceInstances b new_bmp ) ) -- PART 2: Convert V-Ray materials to Standard materials for each in (getclassinstances VRayMtl) do ( -- Create a new Standard material and keep the original name local stdMat = StandardMaterial() stdMat.name = each.name -- Diffuse Map if (isProperty each "texmap_diffuse") then ( stdMat.diffusemap = each.texmap_diffuse ) -- Bump Map if (isProperty each "texmap_bump") then ( stdMat.bumpMap = each.texmap_bump ) -- Opacity Map if (isProperty each "texmap_opacity") then ( stdMat.opacityMap = each.texmap_opacity ) -- Reflection Map if (isProperty each "texmap_reflection") then ( stdMat.reflectionMap = each.texmap_reflection ) -- Refraction Map if (isProperty each "texmap_refraction") then ( stdMat.refractionMap = each.texmap_refraction ) -- Displacement Map if (isProperty each "texmap_displacement") then ( stdMat.displacementMap = each.texmap_displacement ) -- Self-Illumination Map if (isProperty each "texmap_self_illumination") then ( stdMat.selfIllumMap = each.texmap_self_illumination ) -- Globally replace the V-Ray material with the new Standard material replaceinstances each stdMat )