Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width20%

 

Column
width60%
Before after
afterLabelOn
beforeLabelOff
Panel
borderStylenone

Panel
borderStylenone

Column
width20%

 

 

 

 

...

 

Example: Convert textures to TX format before

...

rendering

 

Code Block
import os
import vray
import subprocess
from vfh import vfh_utils


def convertToTX(f):
    make_tx = os.path.join(os.environ['VRAY_APPSDK'], 'bin', 'maketx.exe')
    cmdArgs = [
        make_tx,
        f
    ]
    call = ' '.join(cmdArgs)
    proc = subprocess.Popen(call, universal_newlines=True)
    proc.communicate()
    return os.path.splitext(f)[0] + '.tx'


with vray.VRayRenderer() as renderer:
    for plugin in renderer.plugins:
        if (plugin.getType() == 'BitmapBuffer'):
            if(os.path.splitext(plugin.file)[1] != '.tx'):
                if( not os.path.exists(os.path.splitext(plugin.file)[0] + '.tx')):
                    plugin.file = convertToTX(plugin.file)
                else:
                    plugin.file = os.path.splitext(plugin.file)[0] + '.tx'