[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39669] branches/soc-2011-onion-uv-tools: Merged UV tools part of onion

Antony Riakiotakis kalast at gmail.com
Wed Aug 24 04:56:03 CEST 2011


Revision: 39669
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39669
Author:   psy-fi
Date:     2011-08-24 02:56:02 +0000 (Wed, 24 Aug 2011)
Log Message:
-----------
Merged UV tools part of onion

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/release/scripts/startup/bl_ui/space_userpref_keymap.py
    branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2011-onion-uv-tools/source/blender/blenkernel/BKE_mesh.h
    branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/paint.c
    branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/scene.c
    branches/soc-2011-onion-uv-tools/source/blender/blenlib/BLI_math_vector.h
    branches/soc-2011-onion-uv-tools/source/blender/blenlib/intern/math_vector_inline.c
    branches/soc-2011-onion-uv-tools/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-onion-uv-tools/source/blender/blenloader/intern/writefile.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_image.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-onion-uv-tools/source/blender/editors/include/ED_screen.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/include/UI_resources.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/SConscript
    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/paint_ops.c
    branches/soc-2011-onion-uv-tools/source/blender/editors/space_image/image_ops.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_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/divers.c
    branches/soc-2011-onion-uv-tools/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-onion-uv-tools/source/blender/makesdna/DNA_space_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_space.c
    branches/soc-2011-onion-uv-tools/source/blender/makesrna/intern/rna_userdef.c
    branches/soc-2011-onion-uv-tools/source/blender/windowmanager/intern/wm_keymap.c
    branches/soc-2011-onion-uv-tools/source/blenderplayer/bad_level_call_stubs/stubs.c

Added Paths:
-----------
    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_island_manager.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	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_image.py	2011-08-24 02:56:02 UTC (rev 39669)
@@ -147,11 +147,13 @@
                     if ima.source in {'FILE', 'GENERATED'} and ima.type != 'MULTILAYER':
                         layout.operator("image.pack", text="Pack As PNG").as_png = True
 
+            if not context.tool_settings.use_uv_sculpt:
+                layout.separator()
+                layout.prop(sima, "use_image_paint")
+
             layout.separator()
 
-            layout.prop(sima, "use_image_paint")
 
-
 class IMAGE_MT_image_invert(Menu):
     bl_label = "Invert"
 
@@ -258,6 +260,7 @@
         layout.separator()
 
         layout.prop(uv, "use_live_unwrap")
+        layout.prop(uv, "use_island_manager")
         layout.operator("uv.unwrap")
         layout.operator("uv.pin", text="Unpin").clear = True
         layout.operator("uv.pin")
@@ -268,6 +271,8 @@
         layout.operator("uv.average_islands_scale")
         layout.operator("uv.minimize_stretch")
         layout.operator("uv.stitch")
+        layout.operator("uv.mark_seam_uv")
+        layout.operator("uv.seams_from_islands")
         layout.operator("mesh.faces_mirror_uv")
 
         layout.separator()
@@ -285,6 +290,9 @@
         layout.separator()
 
         layout.menu("IMAGE_MT_uvs_showhide")
+        layout.separator()
+        layout.prop(toolsettings, "use_uv_sculpt")
+        layout.separator()
 
 
 class IMAGE_MT_uvs_select_mode(Menu):
@@ -754,5 +762,80 @@
         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
 
+
+class IMAGE_UV_sculpt_curve(bpy.types.Panel):
+    bl_space_type = 'IMAGE_EDITOR'
+    bl_region_type = 'UI'
+    bl_label = "UV Sculpt Curve"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        sima = context.space_data
+        toolsettings = context.tool_settings.image_paint
+        return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush)
+
+    def draw(self, context):
+        layout = self.layout
+
+        toolsettings = context.tool_settings.uv_sculpt
+        brush = toolsettings.brush
+
+        layout.template_curve_mapping(brush, "curve")
+
+        row = layout.row(align=True)
+        row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
+        row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
+        row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
+        row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
+        row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
+        row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
+
+
+class IMAGE_UV_sculpt(bpy.types.Panel):
+    bl_space_type = 'IMAGE_EDITOR'
+    bl_region_type = 'UI'
+    bl_label = "UV Sculpt"
+
+    @classmethod
+    def poll(cls, context):
+        sima = context.space_data
+        toolsettings = context.tool_settings.image_paint
+        return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush)
+
+    def draw(self, context):
+        layout = self.layout
+
+        toolsettings = context.tool_settings.uv_sculpt
+        brush = toolsettings.brush
+
+        if brush:
+            col = layout.column()
+
+            row = col.row(align=True)
+            row.prop(brush, "size", slider=True)
+            row.prop(brush, "use_pressure_size", toggle=True, text="")
+
+            row = col.row(align=True)
+            row.prop(brush, "strength", slider=True)
+            row.prop(brush, "use_pressure_strength", toggle=True, text="")
+
+        split = layout.split()
+        col = split.column()
+
+        col.prop(context.tool_settings, "uv_sculpt_lock_borders");
+        col.prop(context.tool_settings, "uv_sculpt_all_islands");
+        
+        split = layout.split()
+        col = split.column()
+
+        col.prop(context.tool_settings, "uv_sculpt_tool");
+        
+        if context.tool_settings.uv_sculpt_tool == 'RELAX':
+            col.prop(context.tool_settings, "uv_relax_method");
+ 
+        
+
+
 if __name__ == "__main__":  # only for live edit.
     bpy.utils.register_module(__name__)

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	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref.py	2011-08-24 02:56:02 UTC (rev 39669)
@@ -439,6 +439,7 @@
         col.label(text="OpenGL:")
         col.prop(system, "gl_clip_alpha", slider=True)
         col.prop(system, "use_mipmaps")
+        col.prop(system, "use_highres_tex")
         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/release/scripts/startup/bl_ui/space_userpref_keymap.py
===================================================================
--- branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref_keymap.py	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_userpref_keymap.py	2011-08-24 02:56:02 UTC (rev 39669)
@@ -74,6 +74,7 @@
     ('Image', 'IMAGE_EDITOR', 'WINDOW', [
         ('UV Editor', 'EMPTY', 'WINDOW', []),  # image (reverse order, UVEdit before Image
         ('Image Paint', 'EMPTY', 'WINDOW', []),  # image and view3d
+        ('UV Sculpt', 'EMPTY', 'WINDOW', []),
         ('Image Generic', 'IMAGE_EDITOR', 'WINDOW', [])
         ]),
 

Modified: branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-08-24 02:56:02 UTC (rev 39669)
@@ -1055,6 +1055,11 @@
         col.operator("object.vertex_group_invert", text="Invert")
         col.operator("object.vertex_group_clean", text="Clean")
         col.operator("object.vertex_group_levels", text="Levels")
+        col.operator("paint.weight_layers_images_from_view", text="Save Weight Projected Images")
+        col.operator("paint.weight_layers_to_uv_images", text="Save Weight UV Images")
+	#lazy stuff, but maybe not so, export size should be unified. Maybe add better description to rna?
+        row = col.row(align=True)
+        row.prop(ipaint, "screen_grab_size", text="")
 
 
 class VIEW3D_PT_tools_weightpaint_options(View3DPanel, Panel):

Modified: branches/soc-2011-onion-uv-tools/source/blender/blenkernel/BKE_mesh.h
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/blenkernel/BKE_mesh.h	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/source/blender/blenkernel/BKE_mesh.h	2011-08-24 02:56:02 UTC (rev 39669)
@@ -53,6 +53,10 @@
 struct CustomData;
 struct DerivedMesh;
 struct Scene;
+struct UvVertMap;
+struct UvMapVert;
+struct UvElementMap;
+struct UvElement;
 
 #ifdef __cplusplus
 extern "C" {
@@ -122,6 +126,39 @@
 	unsigned char tfindex, separate, flag;
 } UvMapVert;
 
+typedef struct UvElementMap {
+	/* address UvElements by their vertex */
+	struct UvElement **vert;
+	/* UvElement Store */
+	struct UvElement *buf;
+	/* Total number of UVs in the layer. Useful to know */
+	int totalUVs;
+	/* Number of Islands in the mesh */
+	int totalIslands;
+	/* Stores the starting index in buf where each island begins */
+	int *islandIndices;
+} UvElementMap;
+
+typedef struct UvElement {
+	/* Next UvElement corresponding to same vertex */
+	struct UvElement *next;
+	/* Face the element belongs to */
+	struct EditFace *face;
+	/* Index in the editFace of the uv */
+	unsigned char tfindex;
+	/* Whether this element is the first of coincident elements */
+	unsigned char separate;
+	/* general use flag */
+	unsigned char flag;
+	/* If generating element map with island sorting, this stores the island index */
+	unsigned short island;
+} UvElement;
+
+/* invalid island index is max short. If any one has the patience
+ * to make that many islands, he can bite me :p */
+#define INVALID_ISLAND 0xFFFF
+
+
 UvVertMap *make_uv_vert_map(struct MFace *mface, struct MTFace *tface, unsigned int totface, unsigned int totvert, int selected, float *limit);
 UvMapVert *get_uv_map_vert(UvVertMap *vmap, unsigned int v);
 void free_uv_vert_map(UvVertMap *vmap);

Modified: branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/paint.c	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/paint.c	2011-08-24 02:56:02 UTC (rev 39669)
@@ -68,6 +68,11 @@
 				return &ts->wpaint->paint;
 			case OB_MODE_TEXTURE_PAINT:
 				return &ts->imapaint.paint;
+			case OB_MODE_EDIT:
+				if(ts->use_uv_sculpt)
+					return &ts->uvsculpt->paint;
+				else
+					return &ts->imapaint.paint;
 			}
 		}
 

Modified: branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/scene.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/scene.c	2011-08-24 02:44:26 UTC (rev 39668)
+++ branches/soc-2011-onion-uv-tools/source/blender/blenkernel/intern/scene.c	2011-08-24 02:56:02 UTC (rev 39669)
@@ -299,6 +299,10 @@
 			free_paint(&sce->toolsettings->sculpt->paint);
 			MEM_freeN(sce->toolsettings->sculpt);
 		}
+		if(sce->toolsettings->uvsculpt) {
+			free_paint(&sce->toolsettings->uvsculpt->paint);
+			MEM_freeN(sce->toolsettings->uvsculpt);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list