[Bf-blender-cvs] [c7e0bb0b901] blender2.8: Depsgraph: Make bAction a part of dependency graph

Sergey Sharybin noreply at git.blender.org
Wed May 2 17:10:47 CEST 2018


Commit: c7e0bb0b901e264cc5b9a505daf47ab8b6da9142
Author: Sergey Sharybin
Date:   Tue May 1 17:46:51 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc7e0bb0b901e264cc5b9a505daf47ab8b6da9142

Depsgraph: Make bAction a part of dependency graph

There are various values which depends on context in there, for example
current driver value and original DNA value f-curve is applied for.

This partially fixes issue with not being able to tweak keyed values
when material preview is open.

The material preview is not being currently updated against non-keyed
changes since every tweak of material property does full preview scene
depsgraph evaluation.

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

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
M	source/blender/editors/animation/keyframing.c

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index cbe11f8d7fa..3c7740e62fd 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -677,12 +677,17 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 	if (adt == NULL) {
 		return;
 	}
-
 	/* animation */
 	if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
 		(void) add_id_node(id);
 		ID *id_cow = get_cow_id(id);
 
+		if (adt->action != NULL) {
+			add_operation_node(&adt->action->id, DEG_NODE_TYPE_ANIMATION,
+			                   NULL,
+			                   DEG_OPCODE_ANIMATION);
+		}
+
 		// XXX: Hook up specific update callbacks for special properties which
 		// may need it...
 
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 5514d4b9452..c862b0e7af4 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -898,6 +898,11 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
 	ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
 	TimeSourceKey time_src_key;
 	add_relation(time_src_key, adt_key, "TimeSrc -> Animation");
+	/* Relation from action itself. */
+	if (adt->action != NULL) {
+		ComponentKey action_key(&adt->action->id, DEG_NODE_TYPE_ANIMATION);
+		add_relation(action_key, adt_key, "Action -> Animation");
+	}
 	/* Get source operations. */
 	DepsNode *node_from = get_node(adt_key);
 	BLI_assert(node_from != NULL);
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index cb03c0dc92c..c149218a204 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -45,6 +45,7 @@
 #include <cstring>
 
 #include "BLI_utildefines.h"
+#include "BLI_listbase.h"
 #include "BLI_threads.h"
 #include "BLI_string.h"
 
@@ -61,6 +62,7 @@
 
 extern "C" {
 #include "DNA_ID.h"
+#include "DNA_anim_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
@@ -329,7 +331,6 @@ static bool check_datablocks_copy_on_writable(const ID *id_orig)
 	}
 	return !ELEM(id_type, ID_BR,
 	                      ID_LS,
-	                      ID_AC,
 	                      ID_PAL);
 }
 
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index b490ae9c097..7b637e5b725 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -159,7 +159,9 @@ bAction *verify_adt_action(ID *id, short add)
 		/* XXX: we probably should have bmain passed down, but that involves altering too many API's */
 		DEG_relations_tag_update(G.main);
 	}
-		
+
+	DEG_id_tag_update(&adt->action->id, DEG_TAG_COPY_ON_WRITE);
+
 	/* return the action */
 	return adt->action;
 }



More information about the Bf-blender-cvs mailing list