From d51e0594fb74b390a9dc5a2807eef2359e24769a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Jan 2010 19:34:19 +0000 Subject: [PATCH] sanity check that prevents crashing when syncing poses, attempted to do a partial sync with pose mode however this seems not easy at all since connected data gets lost, parents are invalid etc. --- source/blender/blenkernel/intern/armature.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index e53e4a1155b..9ae871b1dea 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1480,8 +1480,23 @@ static void pose_proxy_synchronize(Object *ob, Object *from, int layer_protected bPose *pose= ob->pose, *frompose= from->pose; bPoseChannel *pchan, *pchanp, pchanw; bConstraint *con; + int error = 0; if (frompose==NULL) return; + + /* in some cases when rigs change, we cant synchronize + * to avoid crashing check for possible errors here */ + for (pchan= pose->chanbase.first; pchan; pchan= pchan->next) { + if (pchan->bone->layer & layer_protected) { + if(get_pose_channel(frompose, pchan->name) == NULL) { + printf("failed to sync proxy armature because '%s' is missing pose channel '%s'\n", from->id.name, pchan->name); + error = 1; + } + } + } + + if(error) + return; /* exception, armature local layer should be proxied too */ if (pose->proxy_layer)