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

    GetRad() and GetMp() for Selected Points?

    Cinema 4D SDK
    r21 python
    2
    3
    364
    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.
    • B
      bentraje
      last edited by

      Hi,

      Normally, GetRad() and GetMp is for the whole object.
      Is there an equivalent for only selected points?

      My use case is to create an FFD deformer that fits exactly where all the selected points sit.
      This is to avoid manually adjusting the FFD.

      Regards,
      Ben

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by ferdinand

        Hi,

        no, I do not think there is, you can either:

        1. Add the vertices in question to a new PointObject, then let Cinema crunch on it (you might have to execute the cache pass on the object, I am not sure about this) and finally use the build in methods to get the bounding box vector.
        2. Or, and this is definitely the more sane solution and probably also even in Python the faster one, simply compute the bounding box yourself. You have just to loop over all vertices and find the minima and maxima for each component (i.e. x, y, z) and the average of the absolute of these two values is then the respective component of the bounding box vector.

        Cheers,
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 2
        • B
          bentraje
          last edited by

          @zipit

          Thanks for the response. I was able to compute the bounding box as you mentioned. I went with the #2 route.
          Though I have problem with creating the FFD deformer, but that would be for another thread.

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