[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43267] branches/soc-2011-onion-uv-tools: UV Tools: changes for issues found in code review

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jan 10 22:35:37 CET 2012


Revision: 43267
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43267
Author:   blendix
Date:     2012-01-10 21:35:24 +0000 (Tue, 10 Jan 2012)
Log Message:
-----------
UV Tools: changes for issues found in code review

* Fix merge issue in imbuf indexer, seems one commit was missing.
* Rename High Bit Depth to 16 Bit.
* Remove some left over weight baking / island manager code in headers.
* Fix seams not showing after using uv editor seam tools.
* Simplify uv unwrap with subsurf code a bit.
* Fix wrong non-uniform size check for unwrap, should check matrix and
  FLT_EPSILON is too small for float imprecision checks.
* Follow file code style better and fix indenting in some files.
* Fix a bunch of compiler warnings.

Modified Paths:
--------------
    branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref.py
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_uvedit.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_view3d.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/interface/resources.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/mesh/editmesh_lib.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/object/object_edit.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/screen/screen_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/CMakeLists.txt
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_intern.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/sculpt_uv.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/space_image/space_image.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/space_view3d/view3d_draw.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/CMakeLists.txt
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_draw.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_intern.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_parametrizer.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_parametrizer.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_smart_stitch.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/gpu/intern/gpu_draw.c
    branches/soc-2011-onion-uv-tools/source/blender/imbuf/IMB_imbuf.h
    branches/soc-2011-onion-uv-tools/source/blender/imbuf/intern/IMB_indexer.h
    branches/soc-2011-onion-uv-tools/source/blender/imbuf/intern/indexer.c
    branches/soc-2011-onion-uv-tools/source/blender/imbuf/intern/indexer_dv.c
    branches/soc-2011-onion-uv-tools/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-onion-uv-tools/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2011-onion-uv-tools/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-onion-uv-tools/source/blender/makesrna/intern/rna_sculpt_paint.c
    branches/soc-2011-onion-uv-tools/source/blender/makesrna/intern/rna_userdef.c

Modified: branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py	2012-01-10 21:35:24 UTC (rev 43267)
@@ -259,6 +259,10 @@
 
         layout.separator()
 
+        layout.prop(toolsettings, "use_uv_sculpt")
+
+        layout.separator()
+
         layout.prop(uv, "use_live_unwrap")
         layout.operator("uv.unwrap")
         layout.operator("uv.pin", text="Unpin").clear = True
@@ -270,7 +274,7 @@
         layout.operator("uv.average_islands_scale")
         layout.operator("uv.minimize_stretch")
         layout.operator("uv.stitch")
-        layout.operator("uv.mark_seam_uv")
+        layout.operator("uv.mark_seam")
         layout.operator("uv.seams_from_islands")
         layout.operator("mesh.faces_mirror_uv")
 
@@ -289,8 +293,6 @@
         layout.separator()
 
         layout.menu("IMAGE_MT_uvs_showhide")
-        layout.separator()
-        layout.prop(toolsettings, "use_uv_sculpt")
 
 
 class IMAGE_MT_uvs_select_mode(Menu):

Modified: branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref.py	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref.py	2012-01-10 21:35:24 UTC (rev 43267)
@@ -427,7 +427,7 @@
         col.label(text="OpenGL:")
         col.prop(system, "gl_clip_alpha", slider=True)
         col.prop(system, "use_mipmaps")
-        col.prop(system, "use_high_bit_depth_tex")
+        col.prop(system, "use_16bit_textures")
         col.label(text="Anisotropic Filtering")
         col.prop(system, "anisotropic_filter", text="")
         col.prop(system, "use_vertex_buffer_objects")

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_mesh.h
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_mesh.h	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_mesh.h	2012-01-10 21:35:24 UTC (rev 43267)
@@ -153,7 +153,7 @@
 
 struct UvVertMap *EM_make_uv_vert_map(struct EditMesh *em, int selected, int do_face_idx_array, float *limit);
 struct UvMapVert *EM_get_uv_map_vert(struct UvVertMap *vmap, unsigned int v);
-void		EM_free_uv_vert_map(struct UvVertMap *vmap);
+void              EM_free_uv_vert_map(struct UvVertMap *vmap);
 
 struct UvElementMap *EM_make_uv_element_map(struct EditMesh *em, int selected, int doIslands);
 void		EM_free_uv_element_map(struct UvElementMap *vmap);

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_uvedit.h
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_uvedit.h	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_uvedit.h	2012-01-10 21:35:24 UTC (rev 43267)
@@ -42,7 +42,6 @@
 struct bContext;
 struct bNode;
 struct wmKeyConfig;
-struct UVIslandManager;
 
 /* uvedit_ops.c */
 void ED_operatortypes_uvedit(void);
@@ -82,14 +81,10 @@
 void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel);
 
 /* uvedit_draw.c */
-void draw_uvedit_main(const struct bContext *C, struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit);
+void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit, struct Object *obact);
 
 /* uvedit_buttons.c */
 void ED_uvedit_buttons_register(struct ARegionType *art);
 
-/* get enable state of island manager */
-int ED_uvedit_island_manager_get_enabled(void);
-/* draw the island manager */
-void ED_uvedit_island_manager_draw(void);
 #endif /* ED_UVEDIT_H */
 

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_view3d.h
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_view3d.h	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_view3d.h	2012-01-10 21:35:24 UTC (rev 43267)
@@ -280,7 +280,6 @@
 
 struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey, unsigned int flag, char err_out[256]);
 struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(struct Scene *scene, struct Object *camera, int width, int height, unsigned int flag, int drawtype, char err_out[256]);
-int view3d_weight_offscreen_draw(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, struct Object *ob, int w, int h, const char *directory);
 
 
 struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/interface/resources.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/interface/resources.c	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/interface/resources.c	2012-01-10 21:35:24 UTC (rev 43267)
@@ -1716,7 +1716,7 @@
 			SETCOLF(btheme->tima.preview_stitch_unstitchable, 1.0, 0.0, 0.0, 1.0);
 			SETCOLF(btheme->tima.preview_stitch_active, 0.886, 0.824, 0.765, 0.140);
 		}
-		U.high_bit_depth_tex = 0;
+		U.use_16bit_textures = 0;
 	}
 	
 	/* GL Texture Garbage Collection (variable abused above!) */

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/mesh/editmesh_lib.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/mesh/editmesh_lib.c	2012-01-10 19:45:20 UTC (rev 43266)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/mesh/editmesh_lib.c	2012-01-10 21:35:24 UTC (rev 43267)
@@ -2370,7 +2370,6 @@
 {
 	EditVert *ev;
 	EditFace *efa;
-	int totverts;
 
 	/* vars from original func */
 	UvElementMap *vmap;
@@ -2385,35 +2384,33 @@
 	int stacksize = 0;
 
 	/* we need the vert */
-	for (ev = em->verts.first, i = 0; ev; ev = ev->next, i++) {
+	for(ev = em->verts.first, i = 0; ev; ev = ev->next, i++)
 		ev->tmp.l = i;
-	}
 
 	totuv = 0;
 
-	for (efa = em->faces.first; efa; efa = efa->next)
+	for(efa = em->faces.first; efa; efa = efa->next)
 		if(!selected || ((!efa->h) && (efa->f & SELECT)))
 			totuv += (efa->v4)? 4: 3;
 
-	if(totuv == 0) {
+	if(totuv == 0)
 		return NULL;
-	}
+
 	vmap = (UvElementMap *)MEM_callocN(sizeof(*vmap), "UvVertElementMap");
-	if (!vmap) {
+	if(!vmap)
 		return NULL;
-	}
 
 	vmap->vert = (UvElement**)MEM_callocN(sizeof(*vmap->vert)*em->totvert, "UvElementVerts");
 	buf = vmap->buf = (UvElement*)MEM_callocN(sizeof(*vmap->buf)*totuv, "UvElement");
 
-	if (!vmap->vert || !vmap->buf) {
+	if(!vmap->vert || !vmap->buf) {
 		EM_free_uv_element_map(vmap);
 		return NULL;
 	}
 
 	vmap->totalUVs = totuv;
 
-	for (efa = em->faces.first; efa; a++, efa = efa->next) {
+	for(efa = em->faces.first; efa; a++, efa = efa->next) {
 		if(!selected || ((!efa->h) && (efa->f & SELECT))) {
 			nverts = (efa->v4)? 4: 3;
 
@@ -2429,10 +2426,10 @@
 				buf++;
 			}
 		}
+
 		efa->tmp.l = INVALID_ISLAND;
 	}
 
-
 	/* sort individual uvs for each vert */
 	for(a = 0, ev = em->verts.first; ev; a++, ev = ev->next) {
 		UvElement *newvlist = NULL, *vlist = vmap->vert[a];
@@ -2457,7 +2454,8 @@
 				efa = iterv->face;
 				tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
 				uv2 = tf->uv[iterv->tfindex];
-					if(fabsf(uv[0]-uv2[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1]-uv2[1]) < STD_UV_CONNECT_LIMIT) {
+
+				if(fabsf(uv[0]-uv2[0]) < STD_UV_CONNECT_LIMIT && fabsf(uv[1]-uv2[1]) < STD_UV_CONNECT_LIMIT) {
 					if(lastv) lastv->next = next;
 					else vlist = next;
 					iterv->next = newvlist;
@@ -2465,14 +2463,17 @@
 				}
 				else
 					lastv = iterv;
-					iterv = next;
+
+				iterv = next;
 			}
-				newvlist->separate = 1;
+
+			newvlist->separate = 1;
 		}
-			vmap->vert[a] = newvlist;
+
+		vmap->vert[a] = newvlist;
 	}
 
-	if(do_islands){
+	if(do_islands) {
 		/* at this point, every UvElement in vert points to a UvElement sharing the same vertex. Now we should sort uv's in islands. */
 
 		/* map holds the map from current vmap->buf to the new, sorted map*/
@@ -2480,23 +2481,25 @@
 		stack = MEM_mallocN(sizeof(*stack)*em->totface, "uv_island_face_stack");
 		islandbuf = MEM_callocN(sizeof(*islandbuf)*totuv, "uvelement_island_buffer");
 
-		for(i = 0; i < totuv; i++){
-			if(vmap->buf[i].island == INVALID_ISLAND){
+		for(i = 0; i < totuv; i++) {
+			if(vmap->buf[i].island == INVALID_ISLAND) {
 				vmap->buf[i].island = nislands;
 				stack[0] = vmap->buf[i].face;
 				stack[0]->tmp.l = nislands;
 				stacksize=1;
 
-				while(stacksize > 0){
+				while(stacksize > 0) {
 					efa = stack[--stacksize];
 					nverts = efa->v4? 4 : 3;
-					for(j = 0; j < nverts; j++){
+
+					for(j = 0; j < nverts; j++) {
 						UvElement *element, *initelement = vmap->vert[(*(&efa->v1 + j))->tmp.l];
-						for(element = initelement; element; element = element->next){
-							if(element->separate){
+
+						for(element = initelement; element; element = element->next) {
+							if(element->separate)
 								initelement = element;
-							}
-							if(element->face == efa){
+
+							if(element->face == efa) {
 								/* found the uv corresponding to our face and vertex. Now fill it to the buffer */
 								element->island = nislands;
 								map[element - vmap->buf] = islandbufsize;
@@ -2506,11 +2509,11 @@
 								islandbuf[islandbufsize].island =  nislands;
 								islandbufsize++;
 
-								for(element = initelement; element; element = element->next){
-									if(element->separate && element != initelement){
+								for(element = initelement; element; element = element->next) {
+									if(element->separate && element != initelement)
 										break;
-									}
-									if(element->face->tmp.l == INVALID_ISLAND){
+
+									if(element->face->tmp.l == INVALID_ISLAND) {
 										stack[stacksize++] = element->face;
 										element->face->tmp.l = nislands;
 									}

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list