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

    Timeline control via OSC and EventAdd doesnt update the scene

    Cinema 4D SDK
    python
    2
    2
    521
    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.
    • Z
      Zebru
      last edited by a_block

      Hello!

      I'm new to the forum so hopefully this is the right place to ask 🙂

      I'm using the fOSC pluggin (https://github.com/fillmember/fOSC) to read an external timecode (basically, the frame number position of another program) in c4d.

      This plugin stores the variable into a null object X position so I’ve written this code for it:

      def main:
      	obj = op.GetObject()
      	frame = obj[c4d.ID_BASEOBJECT_REL_POSITION, c4d.VECTOR_X]
      	fps = doc[c4d.DOCUMENT_FPS]
      	time = c4d.BaseTime (frame, fps)
      	doc.SetTime(time)
      	c4d.EventAdd()
      

      The thing is that the timeline cursor moves accordingly but the scene is not updated (EventAdd seems not to work) and moreover: this happens on a PC but on a MAC it works. And of course I have to use a PC 😞

      Someone has any idea on what’s going on?

      Thank you very much in advance!

      Zebru

      1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hi,

        welcome to the Plugin Café forum ☺

        Before answering your question, I'd like to ask you to please read "Read Before Posting". No worries, I have turned this thread into a "question", added tags and moved it to the Cinema 4D Development category for you.

        I'm a bit surprised it's supposed to work on Mac. The thing is, SetTime() just sets the time of the document, but it does not implicitly trigger a re-evaluation or execution of the scene. For this you need to use ExecutePasses() after calling SetTime().

        There's some more information on this in our C++ SDK manuals. I know, we are talking Python here, but maybe it's interesting anyway: BaseDocument manual -Time.

        Cheers,
        Andreas

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