Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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 Deformed Spline

    SDK Help
    0
    3
    296
    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

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

      On 28/12/2003 at 09:34, xxxxxxxx wrote:

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

      ---------
      Hi,
      Im trying to make a clone of a deformed primitive spline.
      The code im using is:

          
          
          
          
          // obj1 is a Arc Spline (that has a bend deformer as its child)
          
          
          
          
           BaseObject *object = op->GetAndCheckHierarchyClone(hh, obj1, HCLONE_ASSPLINE, &dirty, 0, false);
          
          
          
          
           if(!dirty) return object;
          
          
          
          
           SplineObject *spline = static_cast<SplineObject*>(object)->GetRealSpline();
          
          
          
          
           if(!spline)   
           {  
            GePrint("Spline is null");  
            return NULL;  
           }
          
          
          
      

      The result of that returns "Spline is null in the console when I have a deformer as a child of the spline. If i remove or de-activate the deformer, the spline variable is valid and my plugin works like it should.
      What am I doing wrong?
      Thanks

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

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

        On 31/12/2003 at 02:15, xxxxxxxx wrote:

        A deformed spline is no longer a SplineObject, it's a LineObject. You might be able to use HCLONE_ASLINE. I prefer to use HCLONE_ASIS, SendModelingCommand(MCOMMAND_CURRENTSTATETOOBJECT) and then GetRealSpline() on that. If I get something back I consider it a spline object.
        The drawback is that once a spline is converted to a Line it loses its interpolation option, it's just a couple of line segments. So you'll lose precision when using e.g. GetSplineTangent(). Therefore you might want to provide a variant without the current state to object, to only accept undeformed splines.

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

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

          On 02/01/2004 at 08:29, xxxxxxxx wrote:

          Thanks Mikael,
          Worked a charm 🙂 I used the HCLONE_ASIS/SendModelingCommand way

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