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

    XpressoNode Plugin

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 576 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 01/01/2017 at 07:10, xxxxxxxx wrote:

      Hey all,

      are we able to write something like XpressoNode Plugins similar to the PointNode?
      Of course, I could do it with the PythonNode, but I´d like to restict the inports and outports to what the node is able to work with. And if, is there an example somewhere?

      Thx, a happy new year ans greetings
      rownn

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

        On 01/01/2017 at 09:09, xxxxxxxx wrote:

        As I know you can't create custom xpresso node in python (which is really sad. it will be a really nice feature).
        You can do it in c++ look at this https://developers.maxon.net/docs/cpp/2023_2/class_gv_operator_data.html

        After if you want to stick to python you can make an Xgroup with the python code and lock it so people won't have acces to the python code.
        http://recordit.co/9Om9lMFX0l

        For dealing with multiple type of input you can probably do it with https://developers.maxon.net/docs/py/2023_2/modules/c4d.modules/graphview/GvNode/index.html#c4d.modules.graphview.GvNode for getting the parented xgroup of your python node andthen change his input/output.

        Hope it was helpful.

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

          On 01/01/2017 at 13:38, xxxxxxxx wrote:

          Hey g,

          I think working with GvNode is a quite good idea to control inports and outports, but dealing with it isn´t really intuitive. I was able to remove ports, but creating ... 😞

          import c4d  
          #PYTHON NODE  
            
          def main() :  
            xgroup = op.GetUp()  
            objectInbool = xgroup[c4d.ID_USERDATA,2]  
            cornerINbool = xgroup[c4d.ID_USERDATA,3]  
            radiusINbool = xgroup[c4d.ID_USERDATA,4]  
              
            #for i in xrange(op.GetInPortCount()) :  
                #xgroup.RemovePort(xgroup.GetInPort(0))  
                  
            ID = c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA, c4d.DTYPE_SUBCONTAINER, 0), c4d.DescLevel(2))  
            port = xgroup.AddPort(c4d.GV_PORT_INPUT, ID, c4d.GV_PORT_FLAG_IS_VISIBLE, True)  
          

          And anyway, is it possible or recommended from pythonNode?

          Thx and greetings
          rownn

          EDIT:

          Ok, adding outport for op works, but for the xgroup doesnt work.

          import c4d  
          #PYTHON NODE  
            
          def main() :  
            xgroup = op.GetUp()  
            print xgroup  
            port = xgroup.AddPort(c4d.GV_PORT_OUTPUT, c4d.OUT_LONG, c4d.GV_PORT_FLAG_IS_VISIBLE, True)  
            print port  
            #port = op.AddPort(c4d.GV_PORT_OUTPUT, c4d.OUT_LONG)  
            #print port
          
          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 01/01/2017 at 15:06, xxxxxxxx wrote:

            Ok, it seems it is simply not possible to add ports to xgroups alike all other operators (of course) beside the python operator. 😞

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

              On 03/01/2017 at 03:44, xxxxxxxx wrote:

              Hi,

              The Python XPresso node source code can only operate within itself. It's not meant to be used to change anything outside of its context e.g. in other XPresso nodes, in the active document etc.

              Some operations could work but that's not recommended and could lead to crashes/strange behaviors sooner or later.

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

                On 03/01/2017 at 04:37, xxxxxxxx wrote:

                Hey,

                thx for your reply. I´ll keep it mind.

                greetings
                rownn

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