From a6c4e39876d8a0765290312f6d8c0175274114cd Mon Sep 17 00:00:00 2001 From: Henrik Dick Date: Thu, 3 Dec 2020 10:42:29 +0100 Subject: Add Custom Object Space to Constraints Add Custom Space to the list of space conversions for constraints. Constraints can use World Space, Local Space, Pose Space, Local with Parent, and now also Custom Space with a custom object to define the evaluation space. The Custom Space option uses the Local Space of an other object/bone/vertex group. If selected on owner or target it will show a box for object selection. If an armature is selected, then it will also show a box for bone selection. If a mesh object is selected it will show the option for using the local space of a vertex group. Reviewed By: #animation_rigging, sybren, Severin, angavrilov Differential Revision: https://developer.blender.org/D7437 --- source/blender/blenkernel/BKE_constraint.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/BKE_constraint.h') diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index e5c4535560d..4b9f480e091 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -56,6 +56,8 @@ typedef struct bConstraintOb { float matrix[4][4]; /** original matrix (before constraint solving) */ float startmat[4][4]; + /** space matrix for custom object space */ + float space_obj_world_matrix[4][4]; /** type of owner */ short type; @@ -203,6 +205,7 @@ void BKE_constraints_clear_evalob(struct bConstraintOb *cob); void BKE_constraint_mat_convertspace(struct Object *ob, struct bPoseChannel *pchan, + struct bConstraintOb *cob, float mat[4][4], short from, short to, @@ -221,6 +224,7 @@ void BKE_constraint_targets_for_solving_get(struct Depsgraph *depsgraph, struct bConstraintOb *ob, struct ListBase *targets, float ctime); +void BKE_constraint_custom_object_space_get(float r_mat[4][4], struct bConstraint *con); void BKE_constraints_solve(struct Depsgraph *depsgraph, struct ListBase *conlist, struct bConstraintOb *cob, -- cgit v1.2.3