From 448731ac92c5fe721c08a4dde343be012b49716d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 10 Dec 2018 14:50:05 +0100 Subject: 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. --- source/blender/makesrna/intern/rna_fcurve.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern/rna_fcurve.c') 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); -- cgit v1.2.3