Manipulate Time Scale? [SOLVED]



  • 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



  • 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



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

    Hey Sebastian,

    well actually, your code you wrote does work really well for me :D
    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



  • 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


Log in to reply