Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    AddPort() not working with TP Channel ID?

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 711 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          OMG you are right, how stupid I am 😣

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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 🙂

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

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

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post