When tweaking an FModifiers UI, updates are not happening the same way as
tweaking other UI parts in blender. General DEG tagging takes place, but
the animation system / dependency graph evaluation does not call RNA
update functions for performance reasons, usually one can expect this to
happen through the UI though.
So to make sure we have the same updates happening, we need to ensure
that the FCurve's corresponding property's RNA callbacks are executed.
- tweaking the property in the Properties Editor would call it directly
- tweaking keyframes in an FCurve in animation editors would call it (via ANIM_animdata_update --> ANIM_list_elem_update --> RNA_property_update_main (on fcu->rna_path)
- adding or removing FCurve Modifiers would do it via ANIM_animdata_update as well
- BUT: the UI for the FCurve Modifiers has its own RNA, the properties associated with the FCurve will not get their RNA update functions called (this is what we need to change I think)
What updates happen with the UI for the FCurve Modifiers?
- the corresponding RNA update function for the FCurve Modifier is called (mostly just rna_FModifier_update), again: not the corresponding property the FCurve is coupled with
- rna_FModifier_update only does very general update tagging (rna_tag_animation_update -- which now tags the Action ID_RECALC_ANIMATION)
- depending on the Type of the FCurve Modifier, its UI will also jump through hoops and call 'deg_update()' [which sends NC_ANIMATION | ND_KEYFRAME | NA_EDITED notifiers, as well as tagging the Action ID_RECALC_ANIMATION -- but these are also not enough here]
So, I think what we should be after when tweaking the FModifiers UI is:
- [1] call proper RNA updates on the underlying properties coupled with that FCurve
- [2] clean up the whole FModifier UI
- get rid of custom button/block callbacks and use FModifier RNA where possible
- get rid of this 'deg_update()'
This patch implements [1].
This is a costly operation, it loops over the main database to find IDs using this particular action (but I dont see a way around this).
Note: [2] is partly done in D7997
Fixes T80121