AddPort() not working with TP Channel ID?

On 18/11/2017 at 09:47, xxxxxxxx wrote:

I am developing a plugin that will initialize a certain XPresso network.

I have a function that's dedicated to building an XPresso node network, and I can successfully add all nodes I need, I can also add all the general ports with AddPort(), but it's not working as expected with customized TP channels when adding inport for let's say a PSetData node.

problematic code:
> port_channel1 = node_psetdata.AddPort(c4d.GV_PORT_OUTPUT,  c4d.IN_PART_DATACHANNEL)
and
> print node_psetdata.AddPortIsOK(c4d.GV_PORT_OUTPUT, c4d.IN_PART_DATACHANNEL)
returns False.

I see that IN_PART_DATACHANNEL is defined to equal to 10000 in op_particledata.h

If I manually add the inport in XPresso Editor, and then:

> ports = node_psetdata.GetInPorts()
> for port in ports:
> > print port.GetMainID()

It will print out 10000, (and 10001 ...  if there are more channels), the correct type ID in the Console.

How can I add customized TP channel inports to nodes?

On 20/11/2017 at 03:14, xxxxxxxx wrote:

Hi,

The issue I see in the code you posted is you're passing GV_PORT_OUTPUT, whereas for adding an input port GV_PORT_INPUT should be passed instead.

On 20/11/2017 at 04:36, xxxxxxxx wrote:

OMG you are right, how stupid I am 😣

On 20/11/2017 at 06:22, xxxxxxxx wrote:

No worries, that's what we are here for.
And welcome to the Plugin Café forums by the way 🙂

On 20/11/2017 at 06:36, xxxxxxxx wrote:

Thanks Andreas! 
Edit: found out that GetDescription() works for nodes.

On 21/11/2017 at 02:14, xxxxxxxx wrote:

Hi,

For questions no longer related to this thread's original topic please open a new thread, with some code showing the issue. Thanks.