GetRot() of linked spline



  • 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



  • 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.



  • 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



  • 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



  • 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



  • 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



  • 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



  • 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


Log in to reply