[Bf-blender-cvs] [c57f1f3d278] master: Depsgraph: Simplify creation of animation nodes

Sergey Sharybin noreply at git.blender.org
Wed Feb 20 11:54:55 CET 2019


Commit: c57f1f3d2786ede19946ef77cd4d10e2b676dc0d
Author: Sergey Sharybin
Date:   Wed Feb 20 11:18:38 2019 +0100
Branches: master
https://developer.blender.org/rBc57f1f3d2786ede19946ef77cd4d10e2b676dc0d

Depsgraph: Simplify creation of animation nodes

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

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 68e01536aba..47574902b0d 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -831,8 +831,9 @@ void DepsgraphNodeBuilder::build_object_pointcache(Object *object)
  */
 void DepsgraphNodeBuilder::build_animdata(ID *id)
 {
+	/* Special handling for animated images/sequences. */
 	build_animation_images(id);
-
+	/* Regular animation. */
 	AnimData *adt = BKE_animdata_from_id(id);
 	if (adt == NULL) {
 		return;
@@ -840,39 +841,24 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 	if (adt->action != NULL) {
 		build_action(adt->action);
 	}
-	/* animation */
-	if (adt->action || adt->nla_tracks.first || adt->drivers.first) {
-		(void) add_id_node(id);
-		ID *id_cow = get_cow_id(id);
-
-		// XXX: Hook up specific update callbacks for special properties which
-		// may need it...
-
-		/* actions and NLA - as a single unit for now, as it gets complicated to
-		 * schedule otherwise.  */
-		if ((adt->action) || (adt->nla_tracks.first)) {
-			/* create the node */
-			add_operation_node(
-			        id, NodeType::ANIMATION,
-			        OperationCode::ANIMATION,
-			        function_bind(BKE_animsys_eval_animdata, _1, id_cow),
-			        id->name);
-			/* TODO: for each channel affected, we might also want to add some
-			 * support for running RNA update callbacks on them
-			 * (which will be needed for proper handling of drivers later) */
-		}
-
-		/* NLA strips contain actions */
-		LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
-			build_animdata_nlastrip_targets(&nlt->strips);
-		}
-
-		/* drivers */
-		int driver_index = 0;
-		LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
-			/* create driver */
-			build_driver(id, fcu, driver_index++);
-		}
+	/* Make sure ID node exists. */
+	(void) add_id_node(id);
+	ID *id_cow = get_cow_id(id);
+	if (adt->action != NULL || !BLI_listbase_is_empty(&adt->nla_tracks)) {
+		add_operation_node(id, NodeType::ANIMATION,
+		                   OperationCode::ANIMATION,
+		                   function_bind(BKE_animsys_eval_animdata, _1, id_cow),
+		                   id->name);
+	}
+	/* NLA strips contain actions. */
+	LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) {
+		build_animdata_nlastrip_targets(&nlt->strips);
+	}
+	/* Drivers. */
+	int driver_index = 0;
+	LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
+		/* create driver */
+		build_driver(id, fcu, driver_index++);
 	}
 }



More information about the Bf-blender-cvs mailing list