Page History
...
Section | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
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' |