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:
authorSergey Sharybin <sergey.vfx@gmail.com>2010-10-16 14:14:17 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2010-10-16 14:14:17 +0400
commit5999658569d781bdc4e0b8fa6e0cceb2efb5e612 (patch)
tree6b19050a9cb8ad4bcf785a167758535fa6049571 /source/blender/editors
parent87533e679c3134bb3ba972a45c0d648df47703dd (diff)
Fix #24280: NURBS default "12x12" UV resolution is not actually "12x12"
When adding new nurb primitive it'll have got the same resolution as curve
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/curve/editcurve.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 9fa7ba44c58..97379cc110c 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -5620,6 +5620,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
Nurb *nu = NULL;
BezTriple *bezt;
BPoint *bp;
+ Curve *cu= (Curve*)obedit->data;
float vec[3];
float fac, grid;
int a, b, cutype, stype;
@@ -5641,13 +5642,13 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
if (stype!=CU_PRIM_TUBE && stype!=CU_PRIM_DONUT) {
nu = (Nurb*)MEM_callocN(sizeof(Nurb), "addNurbprim");
nu->type= cutype;
- nu->resolu= 4;
- nu->resolv= 4;
+ nu->resolu= cu->resolu;
+ nu->resolv= cu->resolv;
}
switch(stype) {
case CU_PRIM_CURVE: /* curve */
- nu->resolu= 12; /* set as 4 above */
+ nu->resolu= cu->resolu;
if(newname) {
rename_id((ID *)obedit, "Curve");
rename_id((ID *)obedit->data, "Curve");
@@ -5724,7 +5725,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
nu->pntsv= 1;
nu->orderu= 5;
nu->flagu= CU_NURB_ENDPOINT; /* endpoint */
- nu->resolu= 8;
+ nu->resolu= cu->resolu;
nu->bp= callocstructN(BPoint, 5, "addNurbprim3");
bp= nu->bp;
@@ -5753,7 +5754,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
break;
case CU_PRIM_CIRCLE: /* circle */
- nu->resolu= 12; /* set as 4 above */
+ nu->resolu= cu->resolu;
if(newname) {
rename_id((ID *)obedit, "CurveCircle");
rename_id((ID *)obedit->data, "CurveCircle");
@@ -5870,7 +5871,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
}
nu= add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_CIRCLE, 0); /* circle */
- nu->resolu= 4;
+ nu->resolu= cu->resolu;
nu->flag= CU_SMOOTH;
BLI_addtail(editnurb, nu); /* temporal for extrude and translate */
vec[0]=vec[1]= 0.0;
@@ -5913,8 +5914,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
nu->pntsu= 5;
nu->pntsv= 1;
nu->orderu= 3;
- nu->resolu= 4;
- nu->resolv= 4;
+ nu->resolu= cu->resolu;
+ nu->resolv= cu->resolv;
nu->flag= CU_SMOOTH;
nu->bp= callocstructN(BPoint, 5, "addNurbprim6");
nu->flagu= 0;
@@ -5962,8 +5963,8 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newname)
xzproj= 1;
nu= add_nurbs_primitive(C, mat, CU_NURBS|CU_PRIM_CIRCLE, 0); /* circle */
xzproj= 0;
- nu->resolu= 4;
- nu->resolv= 4;
+ nu->resolu= cu->resolu;
+ nu->resolv= cu->resolv;
nu->flag= CU_SMOOTH;
BLI_addtail(editnurb, nu); /* temporal for spin */