Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Xpresso set port for all nodes

    Cinema 4D SDK
    python
    2
    3
    552
    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.
    • ROMANR
      ROMAN
      last edited by Manuel

      Hello for everyone. Is it real to set up parameters like a position and rotation for all selected nodes by python?

      def main():
          nodes = [] 
          root = nodeMaster.GetRoot() 
          for node in root.GetChildren():
              if node.GetBit(c4d.BIT_ACTIVE): 
              ##place for setting parameter##
      

      If its real, could you write a command which set up x position in input for example

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        first i would like to point you to our guidelines. You will read there how to mark your thread as a question and how to use tags.

        You got some example in our github repository that could help. The first one will show you how to iterate nodes and go inside groups if any. The second is to create and connect nodes. Once you got your node, you must use the function AddPort

        You have to define the direction (output or input) and use the right ID

            child.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_REL_POSITION )
            child.AddPort(c4d.GV_PORT_OUTPUT, [c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] )
        

        Don't forget you can use drag and drop on the python console to retrieve the IDs, more information on this page

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        ROMANR 1 Reply Last reply Reply Quote 1
        • ROMANR
          ROMAN @Manuel
          last edited by

          @m_magalhaes Thank you for answer!

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