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

    GetRot() of linked spline

    Scheduled Pinned Locked Moved SDK Help
    8 Posts 0 Posters 660 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 28/05/2010 at 16:39, xxxxxxxx wrote:

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

      ---------
      Hi there,

      i am using this to get a spline out of a link field:
            userSpline = (SplineObject* )bc->GetObjectLink(USERSPLINE, doc);

      now i want to get the rotation of the linked object but
            userSpline->GetRot() always returns zeros..

      can anyone tell my what i am doing wrong?

      cheers,
      Ello

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 29/05/2010 at 02:20, xxxxxxxx wrote:

        IIRC GetRot() returns local coordinates. So if the userSpline object is a child of another object, and it's the parent that is rotated, the spline itself may have local coordinates of zero. In which case you'll have to get the spline object's global matrix.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 29/05/2010 at 11:44, xxxxxxxx wrote:

          i tried that to. but nothing happened. if i use th op instead of the userspline it returns values so i guess somehow the userspline doesnt take the rotation of the linked spline

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 29/05/2010 at 16:50, xxxxxxxx wrote:

            GetRot just returns the local rotation as HPB angles. You have much more might if you get the global matrix with

            Matrix mtx = op->GetMg();
            

            Anyway, if GetRot always returns zero vectors, something else seems to go wrong. Is your pointer to the Spline object valid? Does op->GetName() even return the correct object's name?
            Cheers,
            Frank

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 29/05/2010 at 17:11, xxxxxxxx wrote:

              hi Frank,

              the userSpline is at least working since i can use its points correctle. name doesnt return the linked splines name, but "Spline Object" , that made me think something is wrong so i converted the parametric spline i used to test (a Helix) and voila, rotating works. i guess somehow there is something missing on how i take the user defined spline..

              userSpline = (SplineObject* )bc->GetObjectLink(USERSPLINE, doc);  
                    if (userSpline->GetRealSpline()) userSpline = userSpline->GetRealSpline();  
              

              any idea what i need to do to get it work with parametric splines?

              thanks in advance,
              ello

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 30/05/2010 at 13:21, xxxxxxxx wrote:

                hm, does anyone have an idea why it only works with non parametric splines?
                i really have no idea why

                cheers,
                ello

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

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 30/05/2010 at 13:39, xxxxxxxx wrote:

                  Just a thought, but try to get the Spline Object's matrix BEFORE doing the GetRealSpline() thing. GetRealSpline() is AFAIK for parametric Spline Objects. Normal Spline Objects return NULL there. So you should try to get the matrix first, then check for GetRealSpline() and if it's not NULL, use it.
                  Cheers,
                  Jack

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

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 30/05/2010 at 13:48, xxxxxxxx wrote:

                    wow, thank you very very much.. that did the trick

                    cheers,
                    ello

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