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-09-05 16:17:59 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-09-20 11:52:42 +0300
commit12788906113c4f2b304b368001bd2ef68c4dc6b8 (patch)
tree866371adf7cb11e65b3809ec2fb9358799d2656e /source/blender/makesdna/DNA_key_types.h
parent1789c1e90df373293338dadd4f7140c9995c456f (diff)
Put the Radius property of Curve points under shape key control.
Since shape keys are stored as raw floating point data, this unfortunately requires changes to all code that works with it. An additional complication is that bezier and nurbs control points have different entry size, and can be mixed in the same object (and hence shape key buffer). Shape key entries are changed from: bezier: float v1[3], v2[3], v3[3], tilt, pad, pad; nurbs: float vec[3], tilt; To: bezier: float v1[3], v2[3], v3[3], tilt, radius, pad; nurbs: float vec[3], tilt, radius, pad; The official shape key element size is changed to 3 floats, with 4 elements for bezier nodes, and 2 for nurbs. This also means that the element count is not equal to the vertex count anymore. While searching for all curve Shape Key code, I also found that BKE_curve_transform_ex and BKE_curve_translate were broken. This can be seen by trying to change the Origin of a Curve with keys. Reviewers: campbellbarton, sergey Differential Revision: https://developer.blender.org/D3676
Diffstat (limited to 'source/blender/makesdna/DNA_key_types.h')
-rw-r--r--source/blender/makesdna/DNA_key_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index 2b097092bc4..fa58f8f8abd 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -135,4 +135,15 @@ enum {
KEYBLOCK_LOCKED = (1 << 2)
};
+#define KEYELEM_FLOAT_LEN_COORD 3
+
+/* Curve key data layout constants */
+#define KEYELEM_ELEM_SIZE_CURVE 3
+
+#define KEYELEM_ELEM_LEN_BPOINT 2
+#define KEYELEM_FLOAT_LEN_BPOINT (KEYELEM_ELEM_LEN_BPOINT * KEYELEM_ELEM_SIZE_CURVE)
+
+#define KEYELEM_ELEM_LEN_BEZTRIPLE 4
+#define KEYELEM_FLOAT_LEN_BEZTRIPLE (KEYELEM_ELEM_LEN_BEZTRIPLE * KEYELEM_ELEM_SIZE_CURVE)
+
#endif /* __DNA_KEY_TYPES_H__ */