Set HDR/EXR maps to Spherical via Script

Hello.
Im using ChanSoo Eun script to Drag and Drop maps into SME on Max 2024, everythings works nice but I want too add a function where if the map has HDR or EXR extension it could have Spherical Mapping
I can do to every map adding “amap.maptype = 2”
but like I said I want to recognice only those extensions

This should do it:


for i in (getclassinstances VRayBitmap) where (matchPattern i.HDRIMapName pattern:"*.hdr*") == true or (matchPattern i.HDRIMapName pattern:"*.exr*") == true do (
i.coords.mappingType = 1
i.coords.mapping = 0
)​

Thanks Hermit, how does this work? I tried using it as a single script by selecting vraybitmaps but it does nothing, also I tried to use it inside ther other script and it has an error

Updated the original script. Test it out.

Note: Not sure if importing .exrs with spherical mapping is that good of an idea, since you may come across regular textures saved as .exr. You can always edit that part in the script, though.
cs_sme_drop_v1_1_updated.7z (865 Bytes)

Thank u so much Hermit, it doesnt work with the line

amap.coords.mappingType = 1
amap.coords.mapping = 0​

the maps stays the same, but I tried with the code that I tested before

amap.maptype = 2

and it finaly works, Ill keep on testing and if EXR types are problematic Ill edit like you suggested, thank u so much!!!