@echo off rem Shave and a Haircut rem (c) 2019 Epic Games rem US Patent 6720962 rem Build all of the V-Ray plugins and shaders for a given version of Maya rem if "%~2"=="" ( echo Usage: %0 mayaVersion compactMayaVersion exit /b 1 ) if not defined SHAVE_VRAY_SDKS ( echo SHAVE_VRAY_SDKS not defined. Shave will be built without V-Ray support. exit /b 2 ) setlocal set mayaVersion=%1 set compactMayaVersion=%2 rem The libraries in V-Ray's 'vc14' directories are actually for Visual C++ rem 14.1, which is Visual Studio 2017. That means that for Maya 2018 we need rem to build the V-Ray plugins, shaders and exporters using a different rem version of Visual Studio from the rest of Shave. rem rem To support this, we have a 'getVrayVSVersion' script which sets the rem 'vrayVSVersion' envariable to the version of Visual Studio used by V-Ray rem for the given version of Maya. rem call ..\utils\getVrayVSVersion %mayaVersion% rem Clean out old builds. rem del /q bin\win64\*.* rem Build V-Ray plugins for all the ranges of V-Ray versions supported by this rem version of Maya. rem set hasSupport=n for /f "tokens=1,2 delims=: " %%i in ('findstr /r "^%mayaVersion%:" supportedVrayVersions.txt') do call :buildOneVersion %%j if errorlevel 1 exit /b %errorlevel% if %hasSupport%==n ( echo No supported versions of V-Ray found for Maya %mayaVersion%. exit /b 1 ) exit /b rem ------------------------------------------------------------------------- rem The argument is the V-Ray version string for the start of the range of rem range of versions of V-Ray which can all work with the same rem Maya plugin and V-Ray shader. rem rem This subroutine builds the corresponding plugin and shader. rem :buildOneVersion set vrayVersion=%1 if "%vrayVersion:~0,3%"=="3.6" ( set versionTag=36 ) else if "%vrayVersion:~0,2%"=="4." ( set versionTag=40 ) else ( echo V-Ray version %vrayVersion% not supported. 'mkwin.bat' and 'supportedVrayVersions.txt' are out of synch. exit /b 1 ) set hasSupport=y call ..\utils\vcbuild . plugin\shaveVray ReleaseVRay%versionTag% %vrayVSVersion% plugin\shaveVray 64 if errorlevel 1 exit /b 3 call ..\utils\vcbuild . plugin\shaveVraySh ReleaseVray%versionTag% %vrayVSVersion% plugin\shaveVraySh 64 if errorlevel 1 exit /b %errorlevel% rem The exporter is located in the mayaPlug directory, but it's vray-version rem specific so we build it here. rem pushd ..\mayaPlug\shaveVrayExporter call ..\..\utils\vcbuild . shaveVrayExporter RelM%compactMayaVersion%V%versionTag% %vrayVSVersion% shaveVrayExporter 64 set savedErr=%errorlevel% popd exit /b %savedErr%