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

    Time Shift. Python tag.

    Cinema 4D SDK
    windows python 2023
    2
    3
    550
    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.
    • L
      ll2pakll
      last edited by

      Windows 10
      Cinema 4d 2023.2.1

      Good afternoon. I'm trying to figure out how I can transfer data between objects with a time offset using the "Python" tag. Specifically I have a number of cubes. I want to achieve a behavior where if I move the first cube, the second cube will repeat its movement but after a certain amount of time, like 2 seconds, and then the 3rd cube will do the same and so on. I know that xpresso has a "memory" node, and it does roughly what I need, but my whole scene is based on code in a single "Python" tag, and I don't want to add xpresso just for one purpose. I would be very grateful for your help.

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

        Hello @ll2pakll,

        Thank you for reaching out to us. It depends a bit on what you want to do exactly.

        1. You want to look n units back into the past of the key-frame animation of a node. This is possible, but when the effect should be general, you will have to do quite a bit of legwork yourself. If it is just a specific parameter whose animation you want to clone (which an offset), things are a bit easier as you then do not have to discover all the thingw which are animated first. In both cases you will then access the CTrack of that animation with FindCTrack to access its CCurve. Then you can call CCurve.GetValue to get a value in this interpolation at any point of time you desire.
        2. You want to look n units back into the past of anything that is not keyframed such as simulations, particle systems, or the user just scrubbing the position of an object for example. All this is uncached, or the caches are at least not public and there is also no unified cache interface for them. In most cases you would have to do your own caching and even then require initmate knowledge of non-public or only semi-public parts of the API.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        L 1 Reply Last reply Reply Quote 1
        • L
          ll2pakll @ferdinand
          last edited by

          @ferdinand Thank you very much for your reply. I only need to animate one parameter and I have already written something similar to this parameter cache myself, you saw it in a previous question and advised me to change the location of the cache for more reliability. I will take your advice in the future to avoid reinventing the wheel. Thanks again for your help.

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