Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2017-05-05 10:49:30 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-05-05 10:56:17 +0300
commitd2cd27a39d6980860fccecf35f344ec8f1a1caa9 (patch)
tree082957fc2d0e73c85dfc8a8f71f8a0b3037edc5f /source/blender/blenkernel/intern/library.c
parentfbf4b2f17a7bf43707125a86f5debe580e3008e0 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c19
1 files changed, 18 insertions, 1 deletions
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);