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

    OBJECT_OPERATOR_OBJECT_OUT

    PYTHON Development
    0
    7
    726
    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
      Helper
      last edited by

      On 18/11/2014 at 06:52, xxxxxxxx wrote:

      Hi,

      I'm working on a python script.
      I want to make some expresso nodes with it.
      Adding the node and a position-output port works fine, but when I try to add an object-output port it does nothing.
      No errors, but no port as well.

      Here is the code I use:

      import c4d
      from c4d import gui
      #Welcome to the world of Python

      def main() :
      doc = c4d.documents.GetActiveDocument()
      pointobject = doc.GetActiveObject()

      xpressotag = c4d.BaseTag(c4d.Texpresso)
      xpressotag.SetName("PointLock XPresso")
      op.InsertTag(xpressotag)
      nodemaster = xpressotag.GetNodeMaster()
      basenode = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None, 100, 100)
      basenodeobjectoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.GV_OBJECT_OPERATOR_OBJECT_OUT)
      basenodepositionoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_REL_POSITION)
      c4d.modules.graphview.RedrawMaster(nodemaster)
      c4d.EventAdd()

      if __name__=='__main__':
      main()

      I think there isn't anything wrong with my code, and I found "GV_OBJECT_OPERATOR_OBJECT_OUT inside Applications -> CINEMA 4D R16 -> resource -> modules -> expression tag -> description -> gvobject.res

      What I want is the port to be added.

      Thanks in advance for your help and time!
      Greetings,

      Casimir

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

        On 18/11/2014 at 07:26, xxxxxxxx wrote:

        Correct me if I'm wrong but I am pretty sure this Port is broken in python. I haven't used that bit of code in R16 yet but from the sound of it, it's still broken? What I have done to bypass this is to add a link userdata to the object and add the object to the link and then make an output port for the link. (A lot of unnecessary code)

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

          On 19/11/2014 at 03:55, xxxxxxxx wrote:

          Hello,

          thanks for reporting this. A bug report was filed.

          Best wishes,
          Sebastian

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

            On 20/11/2014 at 03:05, xxxxxxxx wrote:

            Hi Sebastian,

            Do you know when (approximately) the bug will be fixed?

            @ShawnFrueh, thanks, I'll look into it!

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

              On 20/11/2014 at 08:15, xxxxxxxx wrote:

              Hello,

              I don't know when this bug will be fixed. Also I can't make any statements about future Cinema 4D releases.

              best wishes,
              Sebastian

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

                On 21/11/2014 at 06:58, xxxxxxxx wrote:

                @ShawnFrueh,

                Hi,

                Thanks again for your answer!
                After a bit of digging how to make user data I came up with a perfectly working script to create an object port, like you did it!

                Here is my code, for the people not yet understanding it:

                import c4d
                from c4d import gui
                #Welcome to the world of Python

                def main() :
                  doc = c4d.documents.GetActiveDocument()
                  pointobject = doc.GetActiveObject()
                 
                  userdata = c4d.GetCustomDatatypeDefault(c4d.DTYPE_BASELISTLINK)
                  userdata[c4d.DESC_NAME] = "Object Data"
                 
                  linkobject = op.AddUserData(userdata)
                  op[linkobject] = op

                xpressotag = c4d.BaseTag(c4d.Texpresso)
                  xpressotag.SetName("PointLock XPresso")
                  op.InsertTag(xpressotag)
                  nodemaster = xpressotag.GetNodeMaster()
                  basenode = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None, 100, 100)
                  basenodeobjectoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER, 0), c4d.DescLevel(1)), message = True)
                  basenodepositionoutput = basenode.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_REL_POSITION)
                  c4d.modules.graphview.RedrawMaster(nodemaster)
                  c4d.EventAdd()

                if __name__=='__main__':
                  main()

                Greetings,
                Casimir

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

                  On 21/11/2014 at 09:15, xxxxxxxx wrote:

                  Glad I could help 🙂

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