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

    Overall Scene Size (polygon objects)

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 497 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 28/02/2013 at 00:59, xxxxxxxx wrote:

      How do I get the overall Scene Size (not Document size) of the actual polygon Objects in the scene.

      Do I have to Loop over the objects and get all the dimensions and therefrom the maximum points or the bounding box - or is there a better solution?

      Ideal would be the output of a Cube surrounding the "main" object for further calculations.

      kind regards
      mogh

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

        On 28/02/2013 at 01:56, xxxxxxxx wrote:

        BaseObject.GetRad() returns a vector containing the 'radius' of the bounding box. the method
        could be named better though 🙂

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

          On 28/02/2013 at 03:19, xxxxxxxx wrote:

          Yes this is the fastest way to get the bounding box. but how to handle all the objects is there a faster way than looping through all the objects.

          Anyway thanks littledevil

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

            On 28/02/2013 at 13:13, xxxxxxxx wrote:

            How should there be? This is a too specific request as it would be included as a function in the API,
            and even if it would be included in the c4d module, it internally would require to iterate over all
            objects in the OM as well (although in C++, little faster ;).

            Go through all objects, take their global position, mid-point and radius and compute the bounding-box
            of the document. You can use the AABB helper-class of the c4dtools module for this!

            Best,
            -Niklas

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

              On 28/02/2013 at 22:13, xxxxxxxx wrote:

              Ok thanks NiklasR, the I will do that. Was just thinking that perhaps that the doc or the clipping would have stored some data which could help.

              then loping over all objects it is.

              kind regards

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

                On 28/02/2013 at 23:04, xxxxxxxx wrote:

                Ah, I see what you meant. No, there's no such data available (at least for Python, not sure for C++,
                but I guess not).

                Best,
                -Niklas

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