I have a script that a adds a dropdown menu that I want to later animate the values of. In the update of the EnumProperty I update some visibility filters depending on the item selected which works fine when flipping through the items in the drop down, but when I animate the value and it changes that way the "update" doesn't get called. Can I make it so it does?

Here is an example script

import bpy

class MYOBJECT_PT_Panel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "My Object"
    bl_idname = "MYOBJECT_PT_Panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "My Object"

    def draw(self, context):
        self.layout.prop(context.scene, "MyObjectList")

def print_to_console(scene, context):

def register():
    bpy.types.Scene.MyObjectList = bpy.props.EnumProperty(
        name="My Objects",
        items=[(x, x, "") for x in ["A", "B", "C"]],

def unregister():
    del bpy.types.Scene.MyObjectList

if __name__ == "__main__":

Then go into animate and key the property and scrub the frames, you can see that the print state ment doesn't get called.


1 Answer 1


I achieved a similar functionality by adding a handler to bpy.app.handlers.frame_change_pre. This will make the print_to_console print every frame I can then check "is the gui displaying the same value as the previous frame", and if not it is animated on this frame.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .