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:
-rw-r--r--source/blender/blenkernel/intern/curve.c18
-rw-r--r--source/blender/editors/object/object_add.c1
-rw-r--r--source/blender/makesdna/DNA_curve_types.h4
3 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 8a6e8faf29a..358c63b4f9f 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -169,6 +169,7 @@ Curve *add_curve(const char *name, int type)
cu->texflag= CU_AUTOSPACE;
cu->smallcaps_scale= 0.75f;
cu->twist_mode= CU_TWIST_MINIMUM; // XXX: this one seems to be the best one in most cases, at least for curve deform...
+ cu->type= type;
cu->bb= unit_boundbox();
@@ -303,16 +304,23 @@ ListBase *curve_editnurbs(Curve *cu)
short curve_type(Curve *cu)
{
Nurb *nu;
+ int type= cu->type;
+
if(cu->vfont) {
return OB_FONT;
}
- for (nu= cu->nurb.first; nu; nu= nu->next) {
- if(nu->pntsv>1) {
- return OB_SURF;
+
+ if(!cu->type) {
+ type= OB_CURVE;
+
+ for (nu= cu->nurb.first; nu; nu= nu->next) {
+ if(nu->pntsv>1) {
+ type= OB_SURF;
+ }
}
}
-
- return OB_CURVE;
+
+ return type;
}
void update_curve_dimension(Curve *cu)
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index a6d3365ad8a..bcd8b8903e7 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1366,6 +1366,7 @@ static int convert_exec(bContext *C, wmOperator *op)
makeDispListCurveTypes(scene, newob, 0);
newob->type= OB_CURVE;
+ cu->type= OB_CURVE;
if(cu->vfont) {
cu->vfont->id.us--;
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index d189a692083..236d6dd4732 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -186,7 +186,9 @@ typedef struct Curve {
float size[3];
float rot[3];
- short texflag, pad1; /* keep a short because of give_obdata_texspace() */
+ short type; /* creation-time type of curve datablock */
+
+ short texflag; /* keep a short because of give_obdata_texspace() */
short drawflag, twist_mode;
float twist_smooth, smallcaps_scale;