custom property update function doesn't get called when property is animated #28286

Closed
opened 2011-08-18 06:48:29 +02:00 by Dalai Felinto · 12 comments

%%%Hi Campbell,
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.

Thanks
(also, why do we have a subtype 'UNSIGNED' if I still need to manually set min to 0?)%%%

%%%Hi Campbell, 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. Thanks (also, why do we have a subtype 'UNSIGNED' if I still need to manually set min to 0?)%%%
Author
Owner

Changed status to: 'Open'

Changed status to: 'Open'
Author
Owner

%%%ps.: my real script is actually using a custom property for Textures, not object. In case the depsgraph problem is "deeper":
http://blenderecia.orgfree.com/blender/scripts/texture_imagechanger.py%%%

%%%ps.: my real script is actually using a custom property for Textures, not object. In case the depsgraph problem is "deeper": http://blenderecia.orgfree.com/blender/scripts/texture_imagechanger.py%%%
Author
Owner

%%%quick notes:
(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, ... ;)%%%

%%%quick notes: (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, ... ;)%%%
Member

%%%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.%%%

%%%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.%%%
Author
Owner

%%%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 ....%%%

%%%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 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..%%%
Member

%%%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:

http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Dependency_Graph

(no cheap excuse - this needs to be tackled!)%%%

%%%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: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Dependency_Graph (no cheap excuse - this needs to be tackled!)%%%
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Member

Changed status from 'Archived' to: 'Duplicate'

Changed status from 'Archived' to: 'Duplicate'
Member

✘ Merged into blender/blender#37473.

✘ Merged into blender/blender#37473.

Added subscriber: @RomboutVersluijs

Added subscriber: @RomboutVersluijs

I know this is an old post, but why do custom properties dont update when doing animation render?

This add; https://blenderartists.org/t/a-text-counter-plugin/601171/21?u=rombout

With this test file show fine in viewport, shows fine when doing single renders. But doing a render animation its static?
textcounter-bug.blend

I know this is an old post, but why do custom properties dont update when doing animation render? This add; https://blenderartists.org/t/a-text-counter-plugin/601171/21?u=rombout With this test file show fine in viewport, shows fine when doing single renders. But doing a render animation its static? [textcounter-bug.blend](https://archive.blender.org/developer/F7863942/textcounter-bug.blend)
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#28286
No description provided.