get associated renderlayer from geometry

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  06 June 2012
get associated renderlayer from geometry

is there any chance to qry the renderlayer from the given geometry?

maybe I'm missing something here..
 
  06 June 2012
apparently I thought I figured it out.
But not really.. cause the renderlayer is somewhere upstream and not downstream.
So whatever I do with listRelatives/ listConnections or so. I always go downstream :(

Last edited by Sorath : 06 June 2012 at 10:39 AM.
 
  06 June 2012
try this:

  string $rl[];
 for ($o in `ls -sl`) $rl = `listConnections -type "renderLayer" $o`;
 print $rl;
 

maybe that already does what you're looking for. if you also want to find all render layers of all it's parents you'll need a recursive loop. but the querying will remain the same. hope this helps you to get the hang of it. cheers!
__________________
myBlog
 
  06 June 2012
in case you haven't solved it yet, here's the recursive loop through parents:

string $testObj;
  string $rl[];
  for ($obj in `ls -sl`)
  {
  	$testObj = $obj;
  	$rl = `listConnections -type "renderLayer" $testObj`;
  	while (!size($rl))
  	{
  		$parent = `listRelatives -p $testObj`;
  		$rl = `listConnections -type "renderLayer" $parent[0]`;
  		$testObj = $parent[0];
  	}
  	print ("\nThe next upstream transfom node of \"" + $obj + "\" connected to a render layer is: \"" + $testObj + "\"\n");
  	print ("Connected render layers are: \n");
  	print $rl;
  }
  
__________________
myBlog
 
  06 June 2012
thanks procanic.

Really helpful and actually exactly what I need.
Just got busy with other parts of my code meanwhile.

cheers
 
  06 June 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:31 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.