please see attached file.
The update function is only called if I change the property manually. If I animate it if does not call the update function.
(also, why do we have a subtype 'UNSIGNED' if I still need to manually set min to 0?)
- To Do
ps.: my real script is actually using a custom property for Textures, not object. In case the depsgraph problem is "deeper":
(1) to test the sample file you need to run the script (forgot to toggle "register")
(1.1) also forgot to clean some junk on top of the script file, sorry
(2) this is not urgent (for me at least). I'm using a ScriptLink (the hack with a driver calling __import__(mymodule).func()) to set all props manually:
e.g. for ob in bpy.data.objects: ob.bugprop = ob.bugprop
it works like a charm (for animation, render, ... ;)
NOTE: RNA update functions are called by animsys for properties now in Pepper. Whether this applies for custom properties I'm not sure.
Unless I'm misreading this report, I think we can just mark this as "fixed" in the meantime.
Hi Joshua, it's not fixed in pepper.
What's happening is:
I created a custom property via python. While doing it I created a function to be called whenever the property is updated.
If I change the property in the ui my update function get called.
If I change the property via "playback" (or render animation) - assuming I keyframed different values for the prop - the update function doesn't get called.
I seems like a depsgraph problem to me. Re-opening ....
The problem is that Blender handles these kinds of animation system updates different than what you are expecting, and there's no python hook for it...
Property update function are never called on e.g. frame change for animation, only when changing the property in the UI, editing the fcurve, etc. The update function is intended to be quick, and builtin properties usually will tag the datablock for update in the depsgraph, and then the actual update will be done delayed before the next redraw in object_handle_update. Not sure how to solve this..
The problem is generic - and has been reported many times before. I'll add this report to the long list of similar ones in wiki:
(no cheap excuse - this needs to be tackled!)