diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-14 05:48:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-14 05:48:55 +0400 |
commit | 9b06435653522400c7136ae3cfc6ee6b52ae1378 (patch) | |
tree | 09ba1d46e3c9e7268729b4b023bb707b07d41ab8 /source/blender/blenkernel | |
parent | dd2a2ec6993060f3dbf62c64c4ff56bcca02c54f (diff) |
move ED_object_pose_armature --> object_pose_armature_get to so we dont get bad level calls in the weight paint branch.
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 | 31 |
2 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 7f2a133d27a..7e39461a032 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -108,6 +108,7 @@ void object_to_mat4(struct Object *ob, float mat[][4]); void object_apply_mat4(struct Object *ob, float mat[][4], const short use_compat, const short use_parent); void set_no_parent_ipo(int val); +struct Object *object_pose_armature_get(struct Object *ob); void where_is_object_time(struct Scene *scene, struct Object *ob, float ctime); void where_is_object(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 1c326efe3ec..c2b561b122a 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1310,6 +1310,37 @@ static void copy_object_pose(Object *obn, Object *ob) } } +static int object_pose_context(Object *ob) +{ + if( (ob) && + (ob->type == OB_ARMATURE) && + (ob->pose) && + (ob->mode & OB_MODE_POSE) + ) { + return 1; + } + else { + return 0; + } +} + +//Object *object_pose_armature_get(Object *ob) +Object *object_pose_armature_get(struct Object *ob) +{ + if(ob==NULL) + return NULL; + + if(object_pose_context(ob)) + return ob; + + ob= modifiers_isDeformedByArmature(ob); + + if(object_pose_context(ob)) + return ob; + + return NULL; +} + static void copy_object_transform(Object *ob_tar, Object *ob_src) { copy_v3_v3(ob_tar->loc, ob_src->loc); |