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

    Serializing a spline, how?

    SDK Help
    0
    3
    299
    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 21/08/2013 at 09:07, xxxxxxxx wrote:

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

      ---------
      How would you go about to serialize a spline? That is get hold of all the data needed in order to recreate it? No cloning / copying here. I might want to store the data in a disc file, and read this file later, in order to create an exact copy. I am just after what data to collect and how.
      This is an example:

      Edited:
      To sum it up: What spline properties do I need to know, in order to create an identical spline programmatically?

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

        On 21/08/2013 at 15:47, xxxxxxxx wrote:

        its pretty straight forward you you just need three vector arrays - one for the control point vectors 
        in local spline space and two for the left and right tangent in the local control point space. you can 
        also store the spline type and the spline closed state if you do want to support closed splines and 
        other interpolations than the bezier interpolation.

        i did something like that some time ago in python ( i do not have the code here). i did use a
        base container hierarchy to store the splines in a hyperfile.

        bc spline
        	bc data
        		bc sgement0
        			bc point0
        				int point id
        				vector p
        				vector t0
        				vector t1
        			bc point1
        			bc point2
        			...
        		bc sgement1
        		bc sgement2
        		...
        	int type
        	bool closed
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 22/08/2013 at 03:00, xxxxxxxx wrote:

          Thanks,
          I will try to understand it. I also found this:
          http://www.microbion.co.uk/graphics/c4d/create_plugins4b.htm
          which is about creating a spline. Knowing that, I might probably learn how to read out the data from a spline too.

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