// =========================================================================== // 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. // =========================================================================== // This script fixes several render layer outAdjustment problems caused by a bug which // will result damaged scenes. The bug is caused by uncontrolled reference operations when // render layer outAdjustment presence. // // If you get errors like this: // Error:, Connection not made: 'XXXShape.instObjGroups[0].objectGroups[0]' -> 'XXXSG.dagSetMembers[-1]'., Destination node will not allow the connection., // // This script will help. // // Usage: // 1. Make sure all reference are loaded // 2. Source this script and run fixRenderLayerOutAdjustmentErrors global proc fixMissingAdjustments() { print "------------------------------------------------\n"; print (uiRes("m_fixRenderLayerOutAdjustmentErrors.kFixTitle")); print "------------------------------------------------\n"; string $layers[] = `ls -type renderLayer`; $currentLayer = `editRenderLayerGlobals -q -currentRenderLayer`; for ($l in $layers) { if (`referenceQuery -isNodeReferenced $l` && gmatch($l, "*defaultRenderLayer")) continue; print `format -stringArg $l (uiRes("m_fixRenderLayerOutAdjustmentErrors.kLayer"))`; string $conns[] = `listConnections -d 0 -c 1 -p 1 ($l + ".outAdjustments")`; for ($i=0; $i