How to list all downstream connections?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  02 February 2007
How to list all downstream connections?

Ok.. an example. lets say you've got a lambert and it has a blendColors node connected to it's color. This blendColors has a fileTexture node on it's input. How do I get from the lambert to the fileTexture node directly.
I need something like:
listConnections -children -type file;
But we know that the "children" relates to DAG nodes on listRelatives.

Thanks for any help in advance.

  02 February 2007
You could do something like this:

string $conn1[] = `listConnections -d 0 -s 1 lambert1`; // get first connection...
    string $conn2[] = `listConnections -d 0 -s 1 $conn1[0]`; // get second connection...

Of course you could have multiple connections on either node so you may need to use the nodeType command in a loop to verify results...

string $conn1[] = `listConnections -d 0 -s 1 lambert1`;
    for($c1 in $conn1) {
    	if(`nodeType $c1` == "blendColors") { 
    		string $conn2[] = `listConnections -d 0 -s 1 $conn1[0]`;
    		for($c2 in $conn2) {
    			if(`nodeType $conn2` == "file") {

  02 February 2007
list DG

Thanks analogue!

I've been looking for something that is more universal and where I don't have to worry about the depth of the connection so I can have a shading network with 20 or more nodes and few file texture nodes in that and I can quickly get a list of all these file nodes that end up in a specific material.
There is one command I found "dgInfo" that would make sense to use in this case but I could not make it work.
The solution is simplier than I thought because the listHistory does it all I just forgot about that a shading network is nothing else than a DG.

string $selectedShader[] = `ls -sl`;
string $DGlist[] = `listHistory $selectedShader`;
string $fileTextures[] = `ls -typ "file" $DGlist`;
print $fileTextures;
  02 February 2007
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
Society of Digital Artists

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

All times are GMT. The time now is 03:54 AM.

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