// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== global proc string mayaHardwareRender(int $width, int $height, int $doShadows, int $doGlowPass, string $camera, string $option) { global string $gHardwareRenderSelectedFlag; string $result = ""; // If the useRenderRegion attribute is set, then // we need to pass the render region to the "hwRender" // command through its "-renderRegion" flag. // if (useRenderRegion()) { int $left = `getAttr defaultRenderGlobals.left`; int $right = `getAttr defaultRenderGlobals.rght`; int $bottom = `getAttr defaultRenderGlobals.bot`; int $top = `getAttr defaultRenderGlobals.top`; // Check if the region is within the boundary. // if( $left < 0 ) { $left = 0; } if( $bottom < 0 ) { $bottom = 0; } catch($result = `eval hwRender $gHardwareRenderSelectedFlag -width $width -height $height -camera $camera -cf -notWriteToFile 0 -renderRegion $left $right $bottom $top`); } else { // If useRenderRegion is false, we do regular hardware // rendering. // $result = `eval hwRender $gHardwareRenderSelectedFlag -camera $camera -cf -notWriteToFile 0 -width $width -height $height $option`; } return $result; }