Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-07-15 20:39:02 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-11-06 10:56:08 +0300
commit798cdaeeb6927cb9ca42597fa23845eac04c02b2 (patch)
tree92e444a0a2268d891cdd90f56299ccb8f1c1bf3b /source/blender/makesdna/DNA_constraint_types.h
parenta817613be5ab1545b000e9173a8d3079aaaefa01 (diff)
Implement an Armature constraint that mimics the modifier.
The main use one can imagine for this is adding tweak controls to parts of a model that are already deformed by multiple other major bones. It is natural to expect such locations to deform as if the tweaks aren't there by default; however currently there is no easy way to make a bone follow multiple other bones. This adds a new constraint that implements the math behind the Armature modifier, with support for explicit weights, bone envelopes, and dual quaternion blending. It can also access bones from multiple armatures at the same time (mainly because it's easier to code it that way.) This also fixes dquat_to_mat4, which wasn't used anywhere before. Differential Revision: https://developer.blender.org/D3664
Diffstat (limited to 'source/blender/makesdna/DNA_constraint_types.h')
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index fd98774e948..15555a2bd50 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -94,6 +94,8 @@ typedef struct bConstraintTarget {
short flag; /* runtime settings (for editor, etc.) */
short type; /* type of target (eConstraintObType) */
short rotOrder; /* rotation order for target (as defined in BLI_math.h) */
+ float weight; /* weight for armature deform */
+ char pad[4];
} bConstraintTarget;
/* bConstraintTarget -> flag */
@@ -180,6 +182,13 @@ typedef struct bSplineIKConstraint {
float bulge_smooth;
} bSplineIKConstraint;
+/* Armature Constraint */
+typedef struct bArmatureConstraint {
+ int flag; /* general settings/state indicators accessed by bitmapping */
+ char pad[4];
+
+ ListBase targets; /* a list of targets that this constraint has (bConstraintTarget-s) */
+} bArmatureConstraint;
/* Single-target subobject constraints --------------------- */
@@ -504,6 +513,7 @@ typedef enum eBConstraint_Types {
CONSTRAINT_TYPE_CAMERASOLVER = 27, /* Camera Solver Constraint */
CONSTRAINT_TYPE_OBJECTSOLVER = 28, /* Object Solver Constraint */
CONSTRAINT_TYPE_TRANSFORM_CACHE = 29, /* Transform Cache Constraint */
+ CONSTRAINT_TYPE_ARMATURE = 30, /* Armature Deform Constraint */
/* NOTE: no constraints are allowed to be added after this */
NUM_CONSTRAINT_TYPES
@@ -747,6 +757,13 @@ typedef enum eSplineIK_XZScaleModes {
CONSTRAINT_SPLINEIK_XZS_VOLUMETRIC = 3
} eSplineIK_XZScaleModes;
+/* bArmatureConstraint -> flag */
+typedef enum eArmature_Flags {
+ CONSTRAINT_ARMATURE_QUATERNION = (1<<0), /* use dual quaternion blending */
+ CONSTRAINT_ARMATURE_ENVELOPE = (1<<1), /* use envelopes */
+ CONSTRAINT_ARMATURE_CUR_LOCATION = (1<<2), /* use current bone location */
+} eArmature_Flags;
+
/* MinMax (floor) flags */
typedef enum eFloor_Flags {
MINMAX_STICKY = (1<<0),