diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-23 06:31:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-23 06:31:30 +0400 |
commit | 3b487a6944892204afbdc920ac839a266f54aff5 (patch) | |
tree | 7834f1b3cc26f797541ecde21f46f16fd2758c7d /source/blender/blenkernel | |
parent | 89d6cc7e23a26a3036bfa52592303e6d745edd09 (diff) |
fix for all pose-group editing functions crashing when the context didnt have an area (in background mode),
fix pose-group-sort and pose-group-moving being disabled for pinned poses.
also fix for own missing NULL check for pose mask clear which would crash when run without an active object
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 31642dad60d..269d96d5c38 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -93,6 +93,7 @@ void BKE_object_to_mat3(struct Object *ob, float mat[][3]); void BKE_object_to_mat4(struct Object *ob, float mat[][4]); void BKE_object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent); +int BKE_object_pose_context_check(struct Object *ob); struct Object *BKE_object_pose_armature_get(struct Object *ob); void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 958e488f748..e659441abfe 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1079,12 +1079,12 @@ static void copy_object_pose(Object *obn, Object *ob) } } -static int object_pose_context(Object *ob) +int BKE_object_pose_context_check(Object *ob) { - if ( (ob) && - (ob->type == OB_ARMATURE) && - (ob->pose) && - (ob->mode & OB_MODE_POSE)) + if ((ob) && + (ob->type == OB_ARMATURE) && + (ob->pose) && + (ob->mode & OB_MODE_POSE)) { return 1; } @@ -1098,12 +1098,12 @@ Object *BKE_object_pose_armature_get(Object *ob) if (ob == NULL) return NULL; - if (object_pose_context(ob)) + if (BKE_object_pose_context_check(ob)) return ob; ob = modifiers_isDeformedByArmature(ob); - if (object_pose_context(ob)) + if (BKE_object_pose_context_check(ob)) return ob; return NULL; |