diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-10 16:50:05 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-10 16:50:05 +0300 |
commit | 448731ac92c5fe721c08a4dde343be012b49716d (patch) | |
tree | 60f9aef89dcb98fef694e39feeaa5c0186b5cf0c /source/blender/makesrna/intern/rna_fcurve.c | |
parent | 51dbf8d71a4d7e2cf6053ff6a0503938c830b3be (diff) |
Fix part of T58964: Changing driver path/array index crashes
The issue here is that in the new dependency graph drivers are
individual nodes which depends on what they are driving. This
means that changes to RNA path or property index should ensure
those nodes are updated. Easiest way to do so is to tag relations
for update.
Diffstat (limited to 'source/blender/makesrna/intern/rna_fcurve.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 220b57bff39..8992d3ab411 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -489,6 +489,11 @@ static void rna_FCurve_update_data(Main *UNUSED(bmain), Scene *UNUSED(scene), Po rna_FCurve_update_data_ex((FCurve *)ptr->data); } +static void rna_FCurve_update_data_relations(Main *bmain, Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) +{ + DEG_relations_tag_update(bmain); +} + /* RNA update callback for F-Curves to indicate that there are copy-on-write tagging/flushing needed * (e.g. for properties that affect how animation gets evaluated) */ @@ -1969,14 +1974,14 @@ static void rna_def_fcurve(BlenderRNA *brna) "rna_FCurve_RnaPath_set"); RNA_def_property_ui_text(prop, "Data Path", "RNA Path to property affected by F-Curve"); /* XXX need an update callback for this to that animation gets evaluated */ - RNA_def_property_update(prop, NC_ANIMATION, NULL); + RNA_def_property_update(prop, NC_ANIMATION, "rna_FCurve_update_data_relations"); /* called 'index' when given as function arg */ prop = RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property affected by F-Curve if applicable"); /* XXX need an update callback for this so that animation gets evaluated */ - RNA_def_property_update(prop, NC_ANIMATION, NULL); + RNA_def_property_update(prop, NC_ANIMATION, "rna_FCurve_update_data_relations"); /* Color */ prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); |