[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43137] branches/soc-2011-onion-uv-tools: Yet more cleanup based on reviewers' remarks

Antony Riakiotakis kalast at gmail.com
Wed Jan 4 19:13:53 CET 2012


Revision: 43137
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43137
Author:   psy-fi
Date:     2012-01-04 18:13:49 +0000 (Wed, 04 Jan 2012)
Log Message:
-----------
Yet more cleanup based on reviewers' remarks

Modified Paths:
--------------
    branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_screen.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/screen/screen_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/sculpt_uv.c
    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_smart_stitch.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_unwrap_ops.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-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py	2012-01-04 18:13:49 UTC (rev 43137)
@@ -291,7 +291,6 @@
         layout.menu("IMAGE_MT_uvs_showhide")
         layout.separator()
         layout.prop(toolsettings, "use_uv_sculpt")
-        layout.separator()
 
 
 class IMAGE_MT_uvs_select_mode(Menu):

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_screen.h
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_screen.h	2012-01-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_screen.h	2012-01-04 18:13:49 UTC (rev 43137)
@@ -168,10 +168,10 @@
 int		ED_operator_editlattice(struct bContext *C);
 int		ED_operator_editmball(struct bContext *C);
 int		ED_operator_uvedit(struct bContext *C);
-int		ED_operator_uvedit_no_uv_sculpt(struct bContext *C);
+int		ED_operator_uvedit_can_uv_sculpt(struct bContext *C);
 int		ED_operator_uvmap(struct bContext *C);
 int		ED_operator_uvmap_mesh(struct bContext *C);
-int		ED_operator_uv_seam_tag_active(struct bContext *C);
+int		ED_operator_uv_seam_tag_check_active(struct bContext *C);
 int		ED_operator_posemode(struct bContext *C);
 
 

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-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/interface/resources.c	2012-01-04 18:13:49 UTC (rev 43137)
@@ -1703,7 +1703,7 @@
 		}
 	}
 
-	if (bmain->versionfile < 261){
+	if (bmain->versionfile < 262){
 		bTheme *btheme;
 		for(btheme= U.themes.first; btheme; btheme= btheme->next) {
 			SETCOLF(btheme->tima.preview_stitch_face, 0.5, 0.5, 0.0, 0.2);

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-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/mesh/editmesh_lib.c	2012-01-04 18:13:49 UTC (rev 43137)
@@ -2336,12 +2336,13 @@
 
 			lastv= NULL;
 			iterv= vlist;
-				while(iterv) {
+
+			while(iterv) {
 				next= iterv->next;
 				efa = EM_get_face_for_index(iterv->f);
 				tf = CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
 				uv2 = tf->uv[iterv->tfindex];
-			
+
 				if(fabsf(uv[0]-uv2[0]) < limit[0] && fabsf(uv[1]-uv2[1]) < limit[1]) {
 					if(lastv) lastv->next= next;
 					else vlist= next;
@@ -2350,11 +2351,11 @@
 				}
 				else
 					lastv=iterv;
-					iterv= next;
+				iterv= next;
 			}
-				newvlist->separate = 1;
+			newvlist->separate = 1;
 		}
-			vmap->vert[a]= newvlist;
+		vmap->vert[a]= newvlist;
 	}
 
 
@@ -2365,7 +2366,7 @@
 }
 
 /* A specialized vert map used by stitch operator */
-UvElementMap *EM_make_uv_element_map(EditMesh *em, int selected, int doIslands)
+UvElementMap *EM_make_uv_element_map(EditMesh *em, int selected, int do_islands)
 {
 	EditVert *ev;
 	EditFace *efa;
@@ -2384,27 +2385,26 @@
 	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;
 
-	/* generate UvMapVert array */
-	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");
+	vmap = (UvElementMap *)MEM_callocN(sizeof(*vmap), "UvVertElementMap");
 	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");
+	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) {
 		EM_free_uv_element_map(vmap);
@@ -2413,18 +2413,18 @@
 
 	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;
+			nverts = (efa->v4)? 4: 3;
 
-			for(i=0; i<nverts; i++) {
-				buf->tfindex= i;
+			for(i = 0; i<nverts; i++) {
+				buf->tfindex = i;
 				buf->face = efa;
 				buf->separate = 0;
 				buf->island = INVALID_ISLAND;
 
-				buf->next= vmap->vert[(*(&efa->v1 + i))->tmp.l];
-				vmap->vert[(*(&efa->v1 + i))->tmp.l]= buf;
+				buf->next = vmap->vert[(*(&efa->v1 + i))->tmp.l];
+				vmap->vert[(*(&efa->v1 + i))->tmp.l] = buf;
 
 				buf++;
 			}
@@ -2434,8 +2434,8 @@
 
 
 	/* 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];
+	for(a = 0, ev = em->verts.first; ev; a++, ev = ev->next) {
+		UvElement *newvlist = NULL, *vlist = vmap->vert[a];
 		UvElement *iterv, *v, *lastv, *next;
 		float *uv, *uv2;
 
@@ -2458,37 +2458,28 @@
 				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(lastv) lastv->next= next;
-					else vlist= next;
-					iterv->next= newvlist;
-					newvlist= iterv;
+					if(lastv) lastv->next = next;
+					else vlist = next;
+					iterv->next = newvlist;
+					newvlist = iterv;
 				}
 				else
-					lastv=iterv;
-					iterv= next;
+					lastv = iterv;
+					iterv = next;
 			}
 				newvlist->separate = 1;
 		}
-			vmap->vert[a]= newvlist;
+			vmap->vert[a] = newvlist;
 	}
 
-	if(doIslands){
-		/* At this point, every UvElement in vert points to a UvElement sharing the same vertex. Now we should sort uv's in 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*/
 		map = MEM_mallocN(sizeof(*map)*totuv, "uvelement_remap");
 		stack = MEM_mallocN(sizeof(*stack)*em->totface, "uv_island_face_stack");
 		islandbuf = MEM_callocN(sizeof(*islandbuf)*totuv, "uvelement_island_buffer");
-		if(!map || !stack || !islandbuf){
-			if(stack)
-				MEM_freeN(stack);
-			if(map)
-				MEM_freeN(map);
-			if(islandbuf)
-				MEM_freeN(islandbuf);
-			EM_free_uv_element_map(vmap);
-			return NULL;
-		}
+
 		for(i = 0; i < totuv; i++){
 			if(vmap->buf[i].island == INVALID_ISLAND){
 				vmap->buf[i].island = nislands;

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/screen/screen_ops.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/screen/screen_ops.c	2012-01-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/screen/screen_ops.c	2012-01-04 18:13:49 UTC (rev 43137)
@@ -363,7 +363,7 @@
 	return ED_space_image_show_uvedit(sima, obedit);
 }
 
-int	ED_operator_uvedit_no_uv_sculpt(struct bContext *C)
+int	ED_operator_uvedit_can_uv_sculpt(struct bContext *C)
 {
 	SpaceImage *sima= CTX_wm_space_image(C);
 	ToolSettings *toolsettings = CTX_data_scene(C)->toolsettings;
@@ -404,7 +404,7 @@
 	return 0;
 }
 
-int	ED_operator_uv_seam_tag_active(struct bContext *C)
+int	ED_operator_uv_seam_tag_check_active(struct bContext *C)
 {
 	Scene *scene = CTX_data_scene(C);
 	return ed_spacetype_test(C, SPACE_IMAGE) && (scene->toolsettings->uv_flag & UV_SYNC_SELECTION);

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_ops.c	2012-01-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/paint_ops.c	2012-01-04 18:13:49 UTC (rev 43137)
@@ -347,7 +347,7 @@
 	ts->uv_sculpt_tool = RNA_enum_get(op->ptr, "tool");
 	brush = ts->uvsculpt->paint.brush;
 	/* To update toolshelf */
-	WM_main_add_notifier(NC_BRUSH|NA_EDITED, brush);
+	WM_event_add_notifier(C, NC_BRUSH|NA_EDITED, brush);
 
 	return OPERATOR_FINISHED;
 }
@@ -357,19 +357,19 @@
 	/* from rna_scene.c */
 	extern EnumPropertyItem uv_sculpt_tool_items[];
 	/* identifiers */
-	ot->name= "UV Sculpt Tool Set";
-	ot->description= "Set the uv sculpt tool";
-	ot->idname= "BRUSH_OT_uv_sculpt_tool_set";
+	ot->name = "UV Sculpt Tool Set";
+	ot->description = "Set the uv sculpt tool";
+	ot->idname = "BRUSH_OT_uv_sculpt_tool_set";
 
 	/* api callbacks */
 	ot->exec = brush_uv_sculpt_tool_set_exec;
 	ot->poll = uv_sculpt_poll;
 
 	/* flags */
-	ot->flag= 0;
+	ot->flag = 0;
 
 	/* props */
-	ot->prop= RNA_def_enum(ot->srna, "tool", uv_sculpt_tool_items, 0, "Tool", "");
+	ot->prop = RNA_def_enum(ot->srna, "tool", uv_sculpt_tool_items, 0, "Tool", "");
 }
 
 /**************************** registration **********************************/

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/sculpt_uv.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/sculpt_uv.c	2012-01-04 18:06:32 UTC (rev 43136)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/sculpt_paint/sculpt_uv.c	2012-01-04 18:13:49 UTC (rev 43137)
@@ -356,7 +356,7 @@
 }
 
 static int get_uv_element_offset_from_face(UvElementMap *map, EditFace *efa, int index, int island_index, int doIslands){
-	UvElement *element = get_uv_element(map, efa, index);
+	UvElement *element = ED_get_uv_element(map, efa, index);
 	if(!element || (doIslands && element->island != island_index)){
 		return -1;
 	}
@@ -436,9 +436,9 @@
 			UvElement *element;
 			NearestHit hit;
 			Image *ima= CTX_data_edit_image(C);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list