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
    • Register
    • Login

    Encouraging evaluation when a document is opened

    Cinema 4D SDK
    python
    3
    3
    414
    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.
    • P
      pyr
      last edited by

      I have several object plugins and they all have the same problem - my custom caching functions work as expected until the document is saved and reopened. In that case the generator object returns an empty object. is there any kind of event I could use to force an update?

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,

        For your next question, please read the Forum Guidelines, especially the structure of a question. This help us to understand what you are trying to achieve.

        In your case, i can only guess.

        You are implementing an ObjectData and you are storing information inside your class. This information isn't stored in the BaseContainer of your object, so it's not saved with the document.

        Two solutions:

        • storing the information inside the BaseContainer of the object. For that you need to retrieve on pluginID so you will be sure that your information will not be erased by something else.

        • Implementing the Read/Write/CopyTo functions. Most of the case, when you need to implement one, you need all three. Those function allow to write the data when you save the document, read it when you open it and CopyTo allow to copy the data when you copy the object.

        Question that could help:

        • What kind of object are you creating?
        • What's the workflow?
        • What's the final goal?

        You think you need to force the evaluation of your object when you open a document, but it might be not the case.

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand
          last edited by

          Hello @pyr,

          without any further replies or questions, we will consider this thread as solved by Thursday and flag it accordingly.

          Thank you for your understanding,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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