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

    Get size of an object (bounding box) [SOLVED]

    PYTHON Development
    0
    5
    967
    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
      Helper
      last edited by

      On 08/12/2014 at 07:11, xxxxxxxx wrote:

      Hi!

      I try to write a short script in cinema 4d R14 in Python.
      I want to get the size of an object in a c4d scene (Polygon Object). For that I used:

      bc = obj.GetDataInstance()
      bc.GetVector(c4d.PRIM_CUBE_LEN)

      The Output is always (0,0,0) and I dont know why. I am not sure, if c4d.PRIM_CUB_LEN is the size of the bounding box but I could not find something else than that.
      Would be cool if someone has a clue/ idea 🙂

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

        On 08/12/2014 at 08:06, xxxxxxxx wrote:

        Hello and welcome,

        PRIM_CUBE_LEN[URL-REMOVED] is a parameter of a parametric cube object. So you won't find this parameter in a polygon object's BaseContainer[URL-REMOVED].

        The size of an object's bounding box is returned by GetRad()[URL-REMOVED], it's center by GetMp()[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
          Helper
          last edited by

          On 08/12/2014 at 08:21, xxxxxxxx wrote:

          That's it! 🙂 Thanks a lot!

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

            On 22/09/2015 at 11:56, xxxxxxxx wrote:

            If the object's size changes (e.g., animated spline), how do I get the size for each frame without stepping through the animation frame range?
            Do I need to change the scene frame?

            Thanks,

            Chris

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

              On 23/09/2015 at 00:28, xxxxxxxx wrote:

              Hello,

              you can animate a single object using AnimateObject(). Then you can get the object's bounding box. If the state of the object does not only depend on its own animation but also on other components like expressions you have to animate the while document using ExecutePasses().

              Best wishes,
              Sebastian

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