06-07-2013, 08:14 PM
I want shared an small .bat file for use with .xml YafaRay files.
Is useful for 'drap and drop' files or command line mode.
I also used http://www.xnview.com for view images.
Is useful for 'drap and drop' files or command line mode.
I also used http://www.xnview.com for view images.
Code:
rem [][][] YAFARAY XML RENDERER BAT FILE [][][]
echo off
rem Example .bat for 'drap and drop' YafaRay .XML files and
rem command line mode. Change params for you own YafaRay configuration
rem
set HOME=C:\YafarayMaster
rem
@if not exist %HOME%\yafaray-xml.exe goto ERROR
rem Set binary file
set BIN=yafaray-xml.exe
rem Set path to plugins
set PLUGINS=%HOME%\plugins
rem Set image format in command line.
rem This option override 'out file' parameter inside .XML scene
rem Types allowed; tga, png, jpg, tif, hdr or exr
rem For use the commandline parameter.. Example: 'this_file.bat' file.xml 'image extension'
rem
set IMAGE=%2
rem If use 'drap and drop' option.. default file format is 'tga'
@if "%IMAGE%"=="" set IMAGE=tga
rem Set verbosity level for YafaRay console messages
set VL= 1
rem set custom message
set CS= "Rendered with YafaRay bat file"
rem GO!! to render...
%HOME%\%BIN% -vl %VL% -pp "%PLUGINS%" -f %IMAGE% -dp -cs %CS% -op "%HOME%" %1
rem I use a free XnView (http://www.xnview.com/) for view render image
rem This soft no support 'exr' files.. atm.
if "%IMAGE%"=="exr" goto EXR
set VIEWER=h:\XnView\XnView.exe
rem go to view..
%VIEWER% "%HOME%\yafray.%IMAGE%"
goto EXIT
:ERROR
echo !! Not yafaray-xml.exe in your path !!
pause
:EXR
echo !! Xnview not support .exr files. Use other viewer. !!
pause
rem
:EXIT
The Universe is an infinite equation