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

    Using Python Node to Traverse Deep Hierarchy... fail

    Cinema 4D SDK
    python
    3
    5
    784
    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.
    • N
      noseman
      last edited by

      In the attached example, I am using a Python Node to traverse a hierarchy, and although I can print the name of each child in the console, the OutputObject refuses to pass through and affect the next Object node. What am I missing here?
      How do I force the object to "export" inside the while loop.
      If that's not possible, what's the easiest way to do that hierarchy traversing?
      CheersPython Hierarchy Node 14A.c4d

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by mp5gosu

        Hi noseman. I don't quite understand. For me, you example outputs the name of all nodes, but the topmost. All objects rotate accordingly.
        What do you expect to happen?

        edit: Ah, you probably expect the toroids to also rotate around their own axis?

        N 1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by

          Hi, Noseman find in the attached scene an example of how to make it work.
          The main issue is Python GvNode is not designed to work as an iteration node since internally the Python Xpresso node is not registered with the GV_OPERATORFLAG_ITERATOR.

          To work around the issue you could expose an InExcludeData (aka list of objects for Cinema 4D user, this is what you find in the light to include or exclude light). Then process this InExcludeData with standard Xpresso tool.

          iterate_hierarchy_xpresso.c4d

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          N 1 Reply Last reply Reply Quote 0
          • N
            noseman @m_adam
            last edited by

            @m_adam said in Using Python Node to Traverse Deep Hierarchy... fail:

            The main issue is Python GvNode is not designed to work as an iteration node

            Thanks. That answers my question.

            1 Reply Last reply Reply Quote 0
            • N
              noseman @mp5gosu
              last edited by

              Ah, you probably expect the toroids to also rotate around their own axis

              exactly. Thanks

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