Fix #32742: Motion path calculation on linked armatures locks up Blender
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Oct 2012 08:51:05 +0000 (08:51 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Oct 2012 08:51:05 +0000 (08:51 +0000)
Issue was happening when linking armature object and making proxy and was
caused by not copying visualization settings in BKE_pose_copy_data.

This lead to deadlocks in motion path drawing code.

After discussion with Campbell decided it is crucial fix since it fixes
bug appearing in really common scenario of using armatures.

source/blender/blenkernel/intern/action.c
source/blender/blenloader/intern/readfile.c

index 925658b..66df7ec 100644 (file)
@@ -539,6 +539,7 @@ void BKE_pose_copy_data(bPose **dst, bPose *src, int copycon)
        outPose->iksolver = src->iksolver;
        outPose->ikdata = NULL;
        outPose->ikparam = MEM_dupallocN(src->ikparam);
+       outPose->avs = src->avs;
        
        for (pchan = outPose->chanbase.first; pchan; pchan = pchan->next) {
                /* TODO: rename this argument... */
index 80943c2..97aa21c 100644 (file)
@@ -8008,6 +8008,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
+       /* correction for files saved in blender version when BKE_pose_copy_data
+        * didn't copy animation visualization, which lead to deadlocks on motion
+        * path calculation for proxied armatures, see [#32742]
+        */
+       if (main->versionfile < 264) {
+               Object *ob;
+
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       if (ob->pose) {
+                               if (ob->pose->avs.path_step == 0) {
+                                       animviz_settings_init(&ob->pose->avs);
+                               }
+                       }
+               }
+       }
+
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */