Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / Get renderLayer override attr values?
  RSS 2.0 ATOM  

Get renderLayer override attr values?
Rate this thread
 
57745
 
Permlink of this thread  
avatar
  • FredrikS
  • Posted: 06 July 2011 11:30 PM
  • Total Posts: 5
  • Joined: 08 February 2011 04:32 AM

Hello, anyone knows how to do just that?

Say I want to get the per render layer render frame range of all my different render layers (that have been set with overrides).
How can I do that *without actually changing currently active layer*, using Mel, Python or PythonAPI?

cheers
fred



Replies: 1
/img/forum/dark/default_avatar.png

Try this MEL script; the procedure will list the overrides for each one of your render layers:

////////////////////////////

global proc renderLayerDiagnose()
{

int $currentLayer = `getAttr renderLayerManager.crl`;
string $renderLayers[] = `listConnections -destination 1 -source 0 -plugs 0 renderLayerManager.renderLayerId`;

for ($rl=0; $rl < `size($renderLayers)`; $rl++)
{
int $id = `getAttr ($renderLayers[$rl]+".identification")`;
if ($id == $currentLayer)
{
// do your own thing here....
// e.g. this block prints out the overrides that apply to the current layer
string $overrides[] = `listConnections -destination 0 -source 1 -plugs 1 ($renderLayers[$rl]+".adjs")`;
int $index, $overridesSize;
$overridesSize = `size($overrides)`;
if ($overridesSize!=0)
for ($index=0; $index < $overridesSize; $index++)
{
print ($overrides[$index] + “\t");
print `getAttr ($renderLayers[$rl]+”.adjs["+$index+"].value")`;
print “\n”;
}
else print ("No overrides on “+$renderLayers[$rl]+"\n");
}
}
}
///////////////////////////////////////

Owen
Mayastation

Author: owen burgess

Replied: 07 July 2011 12:48 AM  
avatar
  • FredrikS
  • Posted: 07 July 2011 03:38 AM

Hi Owen,

and and thanks so much for that mel script, that is really very helpful!! :)
I hope you didn’t write it just now!?

That should be plenty for me to figure out how to do what I want!

thanks again
fred



Replies: 0