Announcement

Collapse
No announcement yet.

Vray Scene Converter - script help wanted

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.
    3DV - Ruud van Reenen
    www.3dv.nl

  • #2
    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?
    Colin Senner

    Comment


    • #3
      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.
      3DV - Ruud van Reenen
      www.3dv.nl

      Comment


      • #4
        Fixed the bump-part, by adding these lines in 'convertFrom_Architectural':

        Code:
            -- 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
        Last edited by ruud3dv; 18-11-2008, 03:17 AM. Reason: code in code tags
        3DV - Ruud van Reenen
        www.3dv.nl

        Comment


        • #5
          Hmmm... this is fun
          Replaced the specular part with the following:

          Code:
              -- 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
          Works perfectly, thx though for offering help!
          3DV - Ruud van Reenen
          www.3dv.nl

          Comment


          • #6
            And while i'm at it, added:

            Code:
            -- if this is a RPC-material, return the same one
               if ((findString orig_mtl.name "rpc_")!=undefined) then return orig_mtl
            in the createVrayMtl to skip RPC-materials.

            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.
            Last edited by ruud3dv; 18-11-2008, 05:30 AM.
            3DV - Ruud van Reenen
            www.3dv.nl

            Comment


            • #7
              haha, so you've fixed it yourself? Well done
              Colin Senner

              Comment

              Working...
              X