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:
authorPablo Dobarro <pablodp606@gmail.com>2020-01-07 18:46:56 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-01-07 18:57:54 +0300
commitfdf89acc8634ecba4dfe66e20ff595c0c24ffdee (patch)
tree0c0f6398468259cca6e0f08ee5fca4079e3aca53 /source/blender/blenkernel/BKE_paint.h
parentbd766f8f0608d04c473544274b8dd9dcc00ec39a (diff)
Sculpt: Pose Brush with Inverse Kinematics
This commits introduces the pose_ik_segments brush property in the Pose Brush. When increasing the IK segments count, the brush generates more segments and weights associations following the topology of the mesh. When moving the brush, these segments are transformed using an IK solver and they are used to deform the mesh. When pressing Ctrl, the brush controls the segments' roll rotation instead of using the IK solver. The brush falloff controls how much rotation is propagated from the first to the last segment in the chain. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D6389
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r--source/blender/blenkernel/BKE_paint.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index fdd3bd7cd86..6089db5ed46 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -98,6 +98,20 @@ typedef enum eOverlayControlFlags {
(PAINT_OVERLAY_OVERRIDE_SECONDARY | PAINT_OVERLAY_OVERRIDE_PRIMARY | \
PAINT_OVERLAY_OVERRIDE_CURSOR)
+/* Defines 8 areas resulting of splitting the object space by the XYZ axis planes. This is used to
+ * flip or mirror transform values depending on where the vertex is and where the transform
+ * operation started to support XYZ symmetry on those operations in a predictable way. */
+
+#define AREA_SYMM_DEFAULT 0
+
+typedef enum ePaintSymmetryAreas {
+ AREA_SYMM_X = (1 << 0),
+ AREA_SYMM_Y = (1 << 1),
+ AREA_SYMM_Z = (1 << 2),
+} ePaintSymmetryAreas;
+
+#define PAINT_SYMM_AREAS 8
+
void BKE_paint_invalidate_overlay_tex(struct Scene *scene,
struct ViewLayer *view_layer,
const struct Tex *tex);
@@ -211,6 +225,29 @@ struct SculptVertexPaintGeomMap {
struct MeshElemMap *vert_to_poly;
};
+/* Pose Brush IK Chain */
+typedef struct PoseIKChainSegment {
+ float orig[3];
+ float head[3];
+
+ float initial_orig[3];
+ float initial_head[3];
+ float len;
+ float rot[4];
+ float *weights;
+
+ /* Store a 4x4 transform matrix for each of the possible combinations of enabled XYZ symmetry
+ * axis. */
+ float trans_mat[PAINT_SYMM_AREAS][4][4];
+ float pivot_mat[PAINT_SYMM_AREAS][4][4];
+ float pivot_mat_inv[PAINT_SYMM_AREAS][4][4];
+} PoseIKChainSegment;
+
+typedef struct PoseIKChain {
+ PoseIKChainSegment *segments;
+ int tot_segments;
+} PoseIKChain;
+
/* Session data (mode-specific) */
typedef struct SculptSession {
@@ -273,7 +310,10 @@ typedef struct SculptSession {
/* Dynamic mesh preview */
int *preview_vert_index_list;
int preview_vert_index_count;
+
+ /* Pose Brush Preview */
float pose_origin[3];
+ PoseIKChain *pose_ik_chain_preview;
/* Transform operator */
float pivot_pos[3];