GetOutputTarget

Discussions about SOFTIMAGEs© Interactive Creative Environment©
caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 14:13

GetOutputTarget

Post by caledonian_tartan » 12 Jul 2013, 08:36

hello
i looked up the SDK and found "GetOutputTarget"

i would like to get all the ports logged that a particular node is connected to.
but i have some troubles to use this successfully...
SI 2015 @ WIN7-64

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 14:13

Re: GetOutputTarget

Post by caledonian_tartan » 23 Jul 2013, 13:27

now i use this to get the connections of a particular node of the selected ice tree

Code: Select all

from siutils import log             # LogMessage

for op in Application.Selection(0).ActivePrimitive.ConstructionHistory:

    if op.Type == "ICETree":

        ICETree = op

        # output port direction

        log("output ports")

        for node in op.Nodes:

            for port in node.OutputPorts:

                for connectedPort,connectedNode in zip(port.ConnectedPorts, port.ConnectedNodes):

                    if node.Name == "PPG_Connector":
						log("%s.%s -> %s.%s" % (node.Name, port.Name, connectedNode.Name, connectedPort.Name))
						
        # input port direction

        log("input ports")

        for node in op.Nodes:

            for port in node.InputPorts:

                for connectedPort,connectedNode in zip(port.ConnectedPorts, port.ConnectedNodes):

					if connectedNode.Name == "PPG_Connector":
					
						log("%s.%s -> %s.%s" % (node.Name, port.Name, connectedNode.Name, connectedPort.Name))
how can i get the input value (string/reference) of a "get data" node of the SELECTED pointcloud??

Code: Select all

here's a working example using the pointcloud name:
oTest = Application.GetValue("pointcloud.pointcloud.ICETree.PPG_Connector.PPG_Name_string")
print oTest
SI 2015 @ WIN7-64

User avatar
csaez
Posts: 253
Joined: 09 Jul 2012, 13:31
Skype: csaezmargotta
Location: Sydney, Australia

Re: GetOutputTarget

Post by csaez » 24 Jul 2013, 07:28

Hi,
You can get it from the parameters of the node :)

Code: Select all

from siutils import si, log

for ICETree in si.Selection(0).ActivePrimitive.ICETrees:
    for node in ICETree.Nodes:
        for port in node.InputPorts:
            for connectedNode in port.ConnectedNodes:
                for param in connectedNode.Parameters:
                    log("{0}: {1}".format(param.FullName, param.Value))

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 14:13

Re: GetOutputTarget

Post by caledonian_tartan » 24 Jul 2013, 12:37

cool! this works, thanks!

thing is that it returns the value 4 times although it only has one input...
SI 2015 @ WIN7-64