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
    • Recent
    • Tags
    • Users
    • Login

    Manipulate Time Scale? [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 446 Views
    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 Offline
      Helper
      last edited by

      On 20/02/2016 at 03:18, xxxxxxxx wrote:

      Hey all,

      I want to make a TagData Plugin, which allowes the user to change the Time Scale (Dynamic Speed) for the scene. However my problem is, that for some reason "Dynamics[c4d.WORLD_TIMESCALE]" in particular Dynamics is not available for me. Everytime I search for the BaseList2D id 180000100 (which the cinema consol says is the Dynamics) it says that there isn't such an ID.

      I hope everything is clear, and you understand what I want to say ^^

      thanks in adcance,

      neon

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

        On 22/02/2016 at 01:34, xxxxxxxx wrote:

        Hello,

        can you share some more info on what you do? How does you TagData plugin want to change the settings. You should not edit the BaseDocument from its "Execute" function. Do you want to edit it in reaction to some user-interaction?

        What exactly is "Dynamics" in your example and how do you obtain that object? Can you post some code?

        180000100 is the ID of the Dynamics SceneHook. Its data is typically edited like this:

          
        dynamicshook = doc.FindSceneHook(180000100)  
        if dynamicshook is None:  
             return  
          
        bc = dynamicshook.GetDataInstance()  
        if bc is None:  
             return  
          
        bc[c4d.WORLD_ENABLED] = False  
          
        c4d.EventAdd()  
        

        Best wishes,
        Sebastian

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

          On 23/02/2016 at 08:56, xxxxxxxx wrote:

          Hey Sebastian,

          well actually, your code you wrote does work really well for me 😄
          I am quiet new to the Python SDK and with school and everything it often comes, that I just
          ask, for probably most of you guys, pretty dumb questions - sorry for that.

          But thank you for your reply helped me alot! 
          Just one litle question, why should't I edit the BaseDocument from the Execute function?
          Sorry for asking, but I really don't know.

          greetings, 
          neon

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

            On 24/02/2016 at 02:15, xxxxxxxx wrote:

            Hello,

            TagData.Execute is called in a thread context. And one should not modify the document from a thread that is not the main thread. See Threading Information.

            Best wishes,
            Sebastian

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