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/makesdna/DNA_constraint_types.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 70d33d9ff94..ddc1b3bd9d7 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -61,12 +61,17 @@ typedef struct bConstraint { /** Space that target should be evaluated in (only used if 1 target). */ char tarspace; - /** Constraint name, MAX_NAME. */ - char name[64]; - /* An "expand" bit for each of the constraint's (sub)panels (uiPanelDataExpansion). */ short ui_expand_flag; + /** Object to use as target for Custom Space of owner. */ + struct Object *space_object; + /** Subtarget for Custom Space of owner - pchan or vgroup name, MAX_ID_NAME-2. */ + char space_subtarget[64]; + + /** Constraint name, MAX_NAME. */ + char name[64]; + /** Amount of influence exherted by constraint (0.0-1.0). */ float enforce; /** Point along subtarget bone where the actual target is. 0=head (default for all), 1=tail. */ @@ -722,6 +727,8 @@ typedef enum eBConstraint_Flags { typedef enum eBConstraint_SpaceTypes { /** Default for all - worldspace. */ CONSTRAINT_SPACE_WORLD = 0, + /** For all - custom space. */ + CONSTRAINT_SPACE_CUSTOM = 5, /** * For objects (relative to parent/without parent influence), * for bones (along normals of bone, without parent/rest-positions). -- cgit v1.2.3