[Bf-blender-cvs] [d2cd27a39d6] master: MakeLocal: forcefully recalc affected armatures' poses.

Bastien Montagne noreply at git.blender.org
Fri May 5 10:07:22 CEST 2017


Commit: d2cd27a39d6980860fccecf35f344ec8f1a1caa9
Author: Bastien Montagne
Date:   Fri May 5 09:49:30 2017 +0200
Branches: master
https://developer.blender.org/rBd2cd27a39d6980860fccecf35f344ec8f1a1caa9

MakeLocal: forcefully recalc affected armatures' poses.

This should not be needed imho, we already set POSE_RECALC flag
correctly there, but it still is missing actual update of poses in some
(complex and convoluted) cases. So at least for now, let's go with this
hack, it's not really harming anyone anyway.

Fixes crash in Agent327's 04_01_H.lighting.blend when making all local.

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

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

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 15a90ab731e..cde606734f7 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -2118,11 +2118,28 @@ void BKE_library_make_local(
 
 #ifdef DEBUG_TIME
 	printf("Step 6: Try to find circle dependencies between indirectly-linked-only datablocks: Done.\n");
-	TIMEIT_END(make_local);
+	TIMEIT_VALUE_PRINT(make_local);
 #endif
 
 #endif
 
+	/* This is probably more of a hack than something we should do here, but...
+	 * Issue is, the whole copying + remapping done in complex cases above may leave pose channels of armatures
+	 * in complete invalid state (more precisely, the bone pointers of the pchans - very crappy cross-datablocks
+	 * relationship), se we tag it to be fully recomputed, but this does not seems to be enough in some cases,
+	 * and evaluation code ends up trying to evaluate a not-yet-updated armature object's deformations.
+	 * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */
+	for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
+		if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && ob->pose->flag & POSE_RECALC) {
+			BKE_pose_rebuild(ob, ob->data);
+		}
+	}
+
+#ifdef DEBUG_TIME
+	printf("Hack: Forcefully rebuild armature object poses: Done.\n");
+	TIMEIT_VALUE_PRINT(make_local);
+#endif
+
 	BKE_main_id_clear_newpoins(bmain);
 	BLI_memarena_free(linklist_mem);




More information about the Bf-blender-cvs mailing list