diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-12 12:06:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-05-12 14:06:36 +0300 |
commit | 051688b34c60a5eec7cc0227d0bda26b916d1cb8 (patch) | |
tree | c556ec7c581a26f44bf9ce184b63146f194a2ff4 /source/blender | |
parent | 08d87514d3bf33f8b4770e9213ad3dcddcda9b26 (diff) |
Depsgraph: Make ob_get_parent_matrix() more public and reusable
Currently still only used from object.c, but in the next commit it'll be also
used from granular object update callbacks.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_object.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index ec90cc74082..c270ebbda7d 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -125,6 +125,7 @@ void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4]); bool BKE_object_pose_context_check(struct Object *ob); struct Object *BKE_object_pose_armature_get(struct Object *ob); +void BKE_object_get_parent_matrix(struct Scene *scene, struct Object *ob, struct Object *par, float parentmat[4][4]); void BKE_object_where_is_calc(struct Scene *scene, struct Object *ob); void BKE_object_where_is_calc_ex(struct Scene *scene, struct RigidBodyWorld *rbw, struct Object *ob, float r_originmat[3][3]); void BKE_object_where_is_calc_time(struct Scene *scene, struct Object *ob, float ctime); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 8dfc7e0e8cd..e04f1b19dc5 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2052,14 +2052,12 @@ void BKE_object_to_mat4(Object *ob, float mat[4][4]) add_v3_v3v3(mat[3], ob->loc, ob->dloc); } -static void ob_get_parent_matrix(Scene *scene, Object *ob, Object *par, float parentmat[4][4]); - void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4]) { if (ob->parent) { float par_imat[4][4]; - ob_get_parent_matrix(NULL, ob, ob->parent, par_imat); + BKE_object_get_parent_matrix(NULL, ob, ob->parent, par_imat); invert_m4(par_imat); mul_m4_m4m4(mat, par_imat, ob->obmat); } @@ -2351,7 +2349,8 @@ static void ob_parvert3(Object *ob, Object *par, float mat[4][4]) } } -static void ob_get_parent_matrix(Scene *scene, Object *ob, Object *par, float parentmat[4][4]) + +void BKE_object_get_parent_matrix(Scene *scene, Object *ob, Object *par, float parentmat[4][4]) { float tmat[4][4]; float vec[3]; @@ -2408,7 +2407,7 @@ static void solve_parenting(Scene *scene, Object *ob, Object *par, float obmat[4 if (ob->partype & PARSLOW) copy_m4_m4(slowmat, obmat); - ob_get_parent_matrix(scene, ob, par, totmat); + BKE_object_get_parent_matrix(scene, ob, par, totmat); /* total */ mul_m4_m4m4(tmat, totmat, ob->parentinv); @@ -2566,7 +2565,7 @@ void BKE_object_apply_mat4(Object *ob, float mat[4][4], const bool use_compat, c if (use_parent && ob->parent) { float rmat[4][4], diff_mat[4][4], imat[4][4], parent_mat[4][4]; - ob_get_parent_matrix(NULL, ob, ob->parent, parent_mat); + BKE_object_get_parent_matrix(NULL, ob, ob->parent, parent_mat); mul_m4_m4m4(diff_mat, parent_mat, ob->parentinv); invert_m4_m4(imat, diff_mat); |