[Bf-blender-cvs] [f0982220bef] blender2.8: Nodes: Remove workaround for action copy

Sergey Sharybin noreply at git.blender.org
Tue May 1 12:07:47 CEST 2018


Commit: f0982220befeeed19c542795bab0f86fcaa8dd96
Author: Sergey Sharybin
Date:   Tue May 1 11:34:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf0982220befeeed19c542795bab0f86fcaa8dd96

Nodes: Remove workaround for action copy

Actions shouldn't be copying by new library management code.
Or at least should be possible to make it to not copy actions
or do unneeded user management.

This way we avoid modification of original data which could
and does cause threading conflict with copy-on-write which
could be happening for viewport.

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

M	source/blender/blenkernel/intern/node.c

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

diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 62c3bb5be35..b209b96e3fb 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -1989,9 +1989,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
 	if (ntree) {
 		bNodeTree *ltree;
 		bNode *node;
-		AnimData *adt;
-
-		bAction *action_backup = NULL, *tmpact_backup = NULL;
 
 		BLI_spin_lock(&spin);
 		if (!ntree->duplilock) {
@@ -2001,18 +1998,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
 
 		BLI_mutex_lock(ntree->duplilock);
 
-		/* Workaround for copying an action on each render!
-		 * set action to NULL so animdata actions don't get copied */
-		adt = BKE_animdata_from_id(&ntree->id);
-
-		if (adt) {
-			action_backup = adt->action;
-			tmpact_backup = adt->tmpact;
-
-			adt->action = NULL;
-			adt->tmpact = NULL;
-		}
-
 		/* Make full copy outside of Main database.
 		 * Note: previews are not copied here.
 		 */
@@ -2026,20 +2011,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
 			}
 		}
 
-		if (adt) {
-			AnimData *ladt = BKE_animdata_from_id(&ltree->id);
-
-			adt->action = ladt->action = action_backup;
-			adt->tmpact = ladt->tmpact = tmpact_backup;
-
-			if (action_backup)
-				id_us_plus(&action_backup->id);
-			if (tmpact_backup)
-				id_us_plus(&tmpact_backup->id);
-
-		}
-		/* end animdata uglyness */
-
 		/* ensures only a single output node is enabled */
 		ntreeSetOutput(ntree);



More information about the Bf-blender-cvs mailing list