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
    • Recent
    • Tags
    • Users
    • Login

    Finding a camera under a null and activate it

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 521 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 12/01/2016 at 06:30, xxxxxxxx wrote:

      Hi Community,

      i have a noobish python question, but maybe someone can help me out:

      i have a certain null object and somewhere under that null is a camera.
      I now need some code which iterates through the hierarchy of that null (starting from that null), testing if there's a camera nested and then activate it as scene camera.

      I know how to activate the Camera with SetSceneCamera() but i'm stuck in this iteration process.

      Thanks in advance! 🙂
      Greetings, Martin

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

        On 12/01/2016 at 10:53, xxxxxxxx wrote:

        Hi
        Scroll down to the Python section on this page:
        https://c4dprogramming.wordpress.com/2012/09/12/recursive-hierarchy-iteration/

        -b

        EDIT: Corrected url

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

          On 13/01/2016 at 01:23, xxxxxxxx wrote:

          @Bonsak: you links is broken. You find the content of the former C4DProgramming blog now also on developers.maxon.net.

          There are ways for both recursive and non-recursive hierarchy iterations:

          • Recursive hierarchy iteration[URL-REMOVED]
          • Non-recursive hierarchy iteration[URL-REMOVED]

          best wishes,
          Sebastian


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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

            On 13/01/2016 at 01:33, xxxxxxxx wrote:

            Thanks Sebastian and bonsak! That should help!

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

              On 13/01/2016 at 16:14, xxxxxxxx wrote:

              @Sebastian Thanks.

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