[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32514] trunk/blender/source/blender/ editors/curve/editcurve.c: Fix #24280: NURBS default "12x12" UV resolution is not actually "12x12"

Sergey Sharybin g.ulairi at gmail.com
Sat Oct 16 12:14:17 CEST 2010


Revision: 32514
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32514
Author:   nazgul
Date:     2010-10-16 12:14:17 +0200 (Sat, 16 Oct 2010)

Log Message:
-----------
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

Modified Paths:
--------------
    trunk/blender/source/blender/editors/curve/editcurve.c

Modified: trunk/blender/source/blender/editors/curve/editcurve.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editcurve.c	2010-10-16 09:42:52 UTC (rev 32513)
+++ trunk/blender/source/blender/editors/curve/editcurve.c	2010-10-16 10:14:17 UTC (rev 32514)
@@ -5620,6 +5620,7 @@
 	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 @@
 	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 @@
 		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 @@
 
 		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 @@
 			}
 			
 			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 @@
 			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 @@
 			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 */
 





More information about the Bf-blender-cvs mailing list