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

    Problem with SplineHelp

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 485 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 11/12/2011 at 15:11, xxxxxxxx wrote:

      In the documentation, the GetOffSetFromUnit and GetOffsetFromReal have their discription swapped.
      And I just can't get any usable value from the GetTangent function. If the spline is a flat spline, it always returns Vector(0,1,0).

      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 13/12/2011 at 00:57, xxxxxxxx wrote:

        Hi,

        Originally posted by xxxxxxxx

        In the documentation, the GetOffSetFromUnit and GetOffsetFromReal have their discription swapped.

        Thank you for the error report in the docs. I fixed it.

        Originally posted by xxxxxxxx

        And I just can't get any usable value from the GetTangent function. If the spline is a flat spline, it always returns Vector(0,1,0).

        About SplineHelp.GetTangent(), you should try to use SplineObject.GetTangent() :

        import c4d
        from c4d import utils
          
        def MakeEditable(op) :
            if (not op) | op.CheckType(c4d.Ospline) : return op
            
            op = [op.GetClone()]
            doc = c4d.documents.BaseDocument()
            doc.InsertObject(op[0], None, None)
            op = c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_MAKEEDITABLE,
                                               list = op,
                                               mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,
                                               doc = doc)
            return op[0]
          
          
        def main() :
            spline = MakeEditable(op)
            if (not spline) | (not spline.CheckType(c4d.Ospline)) : return
            
            for i in range(0, spline.GetTangentCount()) :
                tangent = spline.GetTangent(i)
                print tangent
          
          
        if __name__=='__main__':
            main()
        
        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/12/2011 at 14:56, xxxxxxxx wrote:

          I'd like to align my clone to the spline
          As I have the percentage along spline and the mograph clone matrix for each clone

          using
          spltanvec = c4d.utils.SplineHelp.GetTangent( pospercent,   smooth=True, realoffset=True)
          gives me an error - expecting spline help object?

          out of the blue I added a spline help object
          used earlier in my code
          shelp = SplineHelp()
          shelp.InitSpline(spl,use_deformed_points=True)

          spltanvec = c4d.utils.SplineHelp.GetTangent(shelp, pospercent,   smooth=True, realoffset=True)

          but this just gives me an unchanging vector - no matter what position percentage I use

          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 31/12/2011 at 02:36, xxxxxxxx wrote:

            I've posted the whole c4d file on CGSociety Maxon thread - coding. Any help appreciated.

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