[Bf-blender-cvs] [448731ac92c] blender2.8: Fix part of T58964: Changing driver path/array index crashes

Sergey Sharybin noreply at git.blender.org
Mon Dec 10 15:01:13 CET 2018


Commit: 448731ac92c5fe721c08a4dde343be012b49716d
Author: Sergey Sharybin
Date:   Mon Dec 10 14:50:05 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB448731ac92c5fe721c08a4dde343be012b49716d

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.

===================================================================

M	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);



More information about the Bf-blender-cvs mailing list