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:
authorOmar Emara <mail@OmarEmara.dev>2021-02-20 19:05:13 +0300
committerOmar Emara <mail@OmarEmara.dev>2021-02-20 19:05:13 +0300
commitf2c0bbed1ce5270eee1332a02da02c1819bb230c (patch)
tree3bc309ba191cc1a4c81d3daa6e1b57fa987ef6a1 /source/blender/makesdna/DNA_object_types.h
parent5dced2a0636a7f3db73be09139cf8abd952612e7 (diff)
Python: Add to_curve method to the object API
This patch adds a to_curve method to the Object ID. This method is analogous to the to_mesh method. The method can operate on curve and text objects. For text objects, the text is converted into a 3D Curve ID and that curve is returned. For curve objects, if apply_modifiers is true, the spline deform modifiers will be applied and a Curve ID with the result will be returned, otherwise a copy of the curve will be returned. The goal of this addition is to allow the developer to access the splines of text objects and to get the result of modifier applications which was otherwise not possible. Reviewed By: Brecht Differential Revision: https://developer.blender.org/D10354
Diffstat (limited to 'source/blender/makesdna/DNA_object_types.h')
-rw-r--r--source/blender/makesdna/DNA_object_types.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 8b13db8a012..5f414aa2bdd 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -38,6 +38,7 @@ extern "C" {
struct AnimData;
struct BoundBox;
+struct Curve;
struct FluidsimSettings;
struct GeometrySet;
struct Ipo;
@@ -186,6 +187,12 @@ typedef struct Object_Runtime {
*/
struct Mesh *object_as_temp_mesh;
+ /**
+ * This is a curve representation of corresponding object.
+ * It created when Python calls `object.to_curve()`.
+ */
+ struct Curve *object_as_temp_curve;
+
/** Runtime evaluated curve-specific data, not stored in the file. */
struct CurveCache *curve_cache;
@@ -623,7 +630,7 @@ enum {
*/
#define BA_TRANSFORM_LOCKED_IN_PLACE (1 << 7)
-#define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */
+#define BA_TRANSFORM_CHILD (1 << 8) /* child of a transformed object */
#define BA_TRANSFORM_PARENT (1 << 13) /* parent of a transformed object */
#define OB_FROMDUPLI (1 << 9)