[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39903] trunk/blender/source/blender: Fix #28423: Screw-modifier crash in cunjunction with subsurf modifier

Sergey Sharybin g.ulairi at gmail.com
Sun Sep 4 13:13:42 CEST 2011


Revision: 39903
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39903
Author:   nazgul
Date:     2011-09-04 11:13:41 +0000 (Sun, 04 Sep 2011)
Log Message:
-----------
Fix #28423: Screw-modifier crash in cunjunction with subsurf modifier

Problems was caused by angle=2*pi and steps=2 in screw modifier.
Such configuration produced duplicated geometry to close object
and it was confusing for subsurf cache.

Restrict steps=2 for screw modifier now, so now 3<=steps<=512.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_modifier.c
    trunk/blender/source/blender/modifiers/intern/MOD_screw.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_modifier.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2011-09-04 02:12:03 UTC (rev 39902)
+++ trunk/blender/source/blender/makesrna/intern/rna_modifier.c	2011-09-04 11:13:41 UTC (rev 39903)
@@ -2366,7 +2366,7 @@
 
 	prop= RNA_def_property(srna, "steps", PROP_INT, PROP_UNSIGNED);
 	RNA_def_property_range(prop, 2, 10000);
-	RNA_def_property_ui_range(prop, 2, 512, 1, 0);
+	RNA_def_property_ui_range(prop, 3, 512, 1, 0);
 	RNA_def_property_ui_text(prop, "Steps", "Number of steps in the revolution");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 

Modified: trunk/blender/source/blender/modifiers/intern/MOD_screw.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_screw.c	2011-09-04 02:12:03 UTC (rev 39902)
+++ trunk/blender/source/blender/modifiers/intern/MOD_screw.c	2011-09-04 11:13:41 UTC (rev 39903)
@@ -275,7 +275,7 @@
 	if (fabsf(screw_ofs) <= (FLT_EPSILON*100.0f) && fabsf(fabsf(angle) - ((float)M_PI * 2.0f)) <= (FLT_EPSILON*100.0f)) {
 		close= 1;
 		step_tot--;
-		if(step_tot < 2) step_tot= 2;
+		if(step_tot < 3) step_tot= 3;
 	
 		maxVerts =	totvert  * step_tot; /* -1 because we're joining back up */
 		maxEdges =	(totvert * step_tot) + /* these are the edges between new verts */
@@ -286,7 +286,7 @@
 	}
 	else {
 		close= 0;
-		if(step_tot < 2) step_tot= 2;
+		if(step_tot < 3) step_tot= 3;
 
 		maxVerts =	totvert  * step_tot; /* -1 because we're joining back up */
 		maxEdges =	(totvert * (step_tot-1)) + /* these are the edges between new verts */




More information about the Bf-blender-cvs mailing list