timeline changes

Hi, appreciate if someone could help me.

I need to know how to determine whether there are changes in the timeline.

Like a “if bpy.data.objects.is_updated”. Someone comes up with something?
Thanks.

Sorry for ny english(Google traslator)

You may want to investigate handlers. You can set a handler to point to your code. when the scene is updated or the frame changes run your code and make evaluations based upon your required logic.

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.61/Python

yep, read this:

http://www.blender.org/documentation/blender_python_api_2_65_9/bpy.app.handlers.html

Yes, I’m working with “handlers.scene_updated_post” I want to know is how I can make the script stop working when there are changes in the timeline.
I can not think how to mix “handlers.scene_updated” with “handlers.frame_changed_post”.
thanks

I have a script ‘A’ and let me know how to stop it when you move the timeline or when in ‘play’ (Alt + a)

remove your scene_update_post handler when frame_change_pre / post occurs. But i wonder if it makes any sense to use it like this?!

The simple solution is to just ditch the scene.update and use frame_change_pre. Then add an update= function to the properties in your GUI that call the same function as the frame_change_pre. The net result is you can get updates when the user changes one of your properties and when the frame changes.

The one thing the above solution does not support is for the analysis of scene state and calling update based upon changes which you may be after.

But globals do exist. Just make a busy flag and check it in each handler.


###################################################
# Event logic.
###################################################
isRendering = False
isBusy = False

@persistent
def pre_render (scene):
    global isRendering

    print("pre_render")
    isRendering = True

@persistent
def post_render (scene):
    global isRendering

    print("post_render")
    isRendering = False

@persistent
def pre_frame_change(scene):
    global isRendering, isBusy
    print("pre_frame_change")

@persistent
def post_frame_change (scene):
    print("post_frame_change")
    pass

def register():
    # Handlers space out the tasks we need to do.
    bpy.app.handlers.frame_change_pre.append(pre_frame_change)
    bpy.app.handlers.frame_change_post.append(post_frame_change)
    bpy.app.handlers.render_pre.append(pre_render)
    bpy.app.handlers.render_post.append(post_render)

I can not think otherwise.
In my handlers.scene_update_post depending on the selected object’s behavior or another. If I record key, when I move the timeline does not respond with the animation recorded as follows funcinando the script.

My script is actually a ikfk AutoSnap, the explanation is to make it easier to understand.
If I record an animation fk, if when I press play ik bone is selected, I can not see the animation as it does strange things.
one option was to deselect all objects with a
handlers.frame_change_post, but I wanted to not do that.
Thank you. I hope you understand.

I don’t think a scene.update() actually occurs when you press play or try to render an animation. The scene.update() occurs after Blender completes playing or Rendering the entire range.