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 Nurbs?

    SDK Help
    0
    6
    541
    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 30/04/2013 at 13:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   r14 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hey there,
      i am using GetRad to get the Boundingbox of an object. This works fine until i try to get it from a NurbsObject. Then only 0,0,0 is returned. How do i get the Boundingbox for NurbsObjects?

      thanks in advance,
      Ello

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

        On 30/04/2013 at 14:23, xxxxxxxx wrote:

        GetRad() does work fine for me in python (also on NURBS objects). This has to be a cpp specific
        problem or, as things working in python but do not working in cpp are really rare, you are doing
        something wrong. Are you sure your nurbs generator has a properly build cache ? Or in other
        words - GetRad() won't work for most objects if you have not inserted them into a document.

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

          On 30/04/2013 at 15:16, xxxxxxxx wrote:

          hm, i am using it like this:

            
          BaseList2D myObjectLink = bc->GetLink(OBJECTLINK,doc);
          ...
          myObject = static_cast<BaseObject*>(myObjectLink->GetClone(COPYFLAGS_0, NULL));
          if (myObject )
          {
          Vector baseSize = myObject ->GetRad();
          GePrint(RealToString(baseSize.x)+","+RealToString(baseSize.y)+","+RealToString(baseSize.z));
          }
          
          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 30/04/2013 at 15:46, xxxxxxxx wrote:

            i am not really sure about all that cpp stuff but GetClone() might be the culprit, i think the
            cloned object does not inherit the cache from its parent and as long you do not insert the
            clone into the document there won't be build a new one.

            a solution might be to try to cast the BaseList2D from GetLink directly into a BaseObject,
            so that you can invoke GetRad() on the object in your document, but again i do have almost
            no clue whats going on in cpp and this barely more than brain farting 😉

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

              On 02/05/2013 at 08:25, xxxxxxxx wrote:

              The bounding box is returned if I do CurrentStateToObject on the clone before calling GetRad(). The ModelingCommandData result isn't used.

              Presumably this is due to the cache being rebuilt. I wasn't able to find a more elegant way of doing this.

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

                On 02/05/2013 at 09:48, xxxxxxxx wrote:

                thank you!

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