[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37352] branches/soc-2011-onion/source/ blender: subsurf-aware UV solver commit #4:
Ryakiotakis Antonis
kalast at gmail.com
Fri Jun 10 02:41:53 CEST 2011
Revision: 37352
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37352
Author: psy-fi
Date: 2011-06-10 00:41:53 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
subsurf-aware UV solver commit #4:
Added integer property to select subdivision level to calculate.
Modified Paths:
--------------
branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_unwrap_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_unwrap_ops.c 2011-06-10 00:19:12 UTC (rev 37351)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_unwrap_ops.c 2011-06-10 00:41:53 UTC (rev 37352)
@@ -177,8 +177,8 @@
{
int numOfVerts;
- /* ad hoc, will change later */
- smd.levels = 2;
+ /* number of subdivisions to perform */
+ smd.levels = scene->toolsettings->uv_subsurf_level;
/* no cache here */
smd.emCache = NULL;
smd.mCache = NULL;
@@ -932,6 +932,7 @@
int fill_holes = RNA_boolean_get(op->ptr, "fill_holes");
int correct_aspect = RNA_boolean_get(op->ptr, "correct_aspect");
int use_subsurf = RNA_boolean_get(op->ptr, "use_subsurf_data");
+ int subdivisionLevel = RNA_int_get(op->ptr, "uv_subsurf_level");
/* add uvs if they don't exist yet */
if(!ED_uvedit_ensure_uvs(C, scene, obedit)) {
@@ -940,6 +941,8 @@
/* remember last method for live unwrap */
scene->toolsettings->unwrapper = method;
+
+ scene->toolsettings->uv_subsurf_level = subdivisionLevel;
if(fill_holes) scene->toolsettings->uvcalc_flag |= UVCALC_FILLHOLES;
else scene->toolsettings->uvcalc_flag &= ~UVCALC_FILLHOLES;
@@ -980,7 +983,8 @@
RNA_def_enum(ot->srna, "method", method_items, 0, "Method", "Unwrapping method. Angle Based usually gives better results than Conformal, while being somewhat slower.");
RNA_def_boolean(ot->srna, "fill_holes", 1, "Fill Holes", "Virtual fill holes in mesh before unwrapping, to better avoid overlaps and preserve symmetry.");
RNA_def_boolean(ot->srna, "correct_aspect", 1, "Correct Aspect", "Map UV's taking image aspect ratio into account.");
- RNA_def_boolean(ot->srna, "use_subsurf_data", 0, "Use Subsurf Data", "Map UV's taking face area and angle after subsurf into account.");
+ RNA_def_boolean(ot->srna, "use_subsurf_data", 0, "Use Subsurf Data", "Map UV's taking vertex position after subsurf into account.");
+ RNA_def_int(ot->srna, "uv_subsurf_level", 1, 1, 6, "SubSurf Target", "Number of times to subdivide before calculating UV's", 1, 6);
}
/**************** Project From View operator **************/
Modified: branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h 2011-06-10 00:19:12 UTC (rev 37351)
+++ branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h 2011-06-10 00:41:53 UTC (rev 37352)
@@ -662,7 +662,7 @@
short uvcalc_mapalign;
short uvcalc_flag;
short uv_flag, uv_selectmode;
- short uv_pad;
+ short uv_subsurf_level;
/* Grease Pencil */
short gpencil_flags;
More information about the Bf-blender-cvs
mailing list