Vray Scene Converter - script help wanted

When using the Vray scene converter-script I lose all bump values and bump maps for Architectural Materials.

For Architectural materials I’d also like to have
If there’s a shininess map:
- shininess map in the Vray reflect-map slot
- shininess value to the reflect-value (percentage in maps-rollout)
- reflect color to 0,0,0

If there’s no shininess map:
- R=G=B= (shininessvalue/100)*255 in the reflect-color swatch.

Any script-guru’s that know how to fix that? I’ve got a couple of large scenes with loads of materials I need to convert. I can offer a (not too large) fee.

Doing this isn’t too hard, however, integration into the vray scene converter is quite a bit more difficult. I’m not even sure how to use scene converter as I’ve never done it before, does it completely discard the bump maps and information? Maybe a test file with details on what you want it to do exactly?

Thx for looking into it!

Here’s the test file: http://www.3dv.nl/forum/Material-convert-test.max

The bumpmap is completely gone after conversion, I think something along the lines of this should be added in ‘convertFrom_Architectural’:

r.texmap_bump=origmtl.bumpMap
    r.texmap_bump_on=origmtl.useBumpMap
    r.texmap_bump_multiplier=origmtl.bumpMapAmount

But .bumpMap is apparently the wrong name for the bumpmap in the Arch. material, or it should check it’s existence first.

Fixed the bump-part, by adding these lines in ‘convertFrom_Architectural’:

```
-- bump component added by Ruud van Reenen - 3DV
r.texmap_bump=orig_mtl.bumpMap
if (r.texmap_bump!=undefined) then (
    r.texmap_bump_on=orig_mtl.bumpMapEnable
    r.texmap_bump_multiplier=orig_mtl.bumpMapAmount
)
In the previous post I used origmtl instead of orig\_mtl, the spelling of this is inconsistent in the script :)

Hmmm… this is fun :slight_smile:
Replaced the specular part with the following:

```
-- specular component  modified by Ruud van Reenen - 3DV
r.texmap_reflection=orig_mtl.shininessMap
if (r.texmap_reflection!=undefined) then (
    r.reflection=(color 0 0 0)
    r.texmap_reflection_multiplier=(orig_mtl.shininess)
    )
else (
    r.reflection=(orig_mtl.shininess*0.01)*(color 255 255 255)
)
r.reflection_glossiness=0.85 -- default chosen glossiness, can't be calculated
r.reflection_fresnel=true
r.reflection_lockGlossiness=true

And while i’m at it, added:

```

– if this is a RPC-material, return the same one
if ((findString orig_mtl.name “rpc_”)!=undefined) then return orig_mtl


If anyone is interest, the modified script can be downloaded here: http://www.3dv.nl/forum/vrayutils-2.zip
I only changed the conversion of Architectural Materials and prevented RPC-materials to be converted.

haha, so you’ve fixed it yourself? Well done :slight_smile: