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

    Advice for storing animation in a Hyperfile

    Cinema 4D SDK
    python sdk
    3
    4
    553
    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.
    • ?
      A Former User
      last edited by

      Hello,
      Is there a recommended way for storing an object's animation in a Hyperfile?

      My instincts would be to serialize everything (desc_ids, keyframes, value, spline types etc.) as ints, floats, & strings in the BaseContainer.

      It would be more simple though if I could store the object's CTracks however I don't see a Data Type for them in BaseContainer and I haven't been able to get the BaseContainer's SetLink & GetLink to work with Hyperfile.

      Advice before I dive into this would be very appreciated. Thank you very much!

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by

        CTrack inherits from C4DAtom which has the write() and read() member functions. So you should be able to write them directly to your hf.

        1 Reply Last reply Reply Quote 0
        • r_giganteR
          r_gigante
          last edited by

          Hi @blastframe , thanks for reaching out us.

          With regard to your request, I think the most effective approach is to isolate the object by using c4d.documents.IsolateObjects() and then save the file using c4d.documents.SaveDocument().

          With regard instead to the other discussion you've referred to, note that BaseLink has nothing to do on saving objects outside Cinema 4D, but rather on handling a reference to a C4DAtom eventually in the context of a specific BaseDocument.

          Best, Riccardo

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by

            Additional information here:
            https://developers.maxon.net/forum/topic/12295/bug-with-getlink-setlink-hyperfile/3

            Thank you @m_magalhaes & @r_gigante!

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