[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43462] trunk/blender: Onion Uv-Tools take 2.

Antony Riakiotakis kalast at gmail.com
Tue Jan 17 18:02:42 CET 2012


Revision: 43462
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43462
Author:   psy-fi
Date:     2012-01-17 17:02:33 +0000 (Tue, 17 Jan 2012)
Log Message:
-----------
Onion Uv-Tools take 2. It should be fine now.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/source/blender/blenkernel/BKE_mesh.h
    trunk/blender/source/blender/blenkernel/intern/paint.c
    trunk/blender/source/blender/blenkernel/intern/scene.c
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/blenloader/intern/writefile.c
    trunk/blender/source/blender/editors/include/ED_image.h
    trunk/blender/source/blender/editors/include/ED_mesh.h
    trunk/blender/source/blender/editors/include/ED_uvedit.h
    trunk/blender/source/blender/editors/include/ED_view3d.h
    trunk/blender/source/blender/editors/include/UI_resources.h
    trunk/blender/source/blender/editors/interface/resources.c
    trunk/blender/source/blender/editors/mesh/editmesh_lib.c
    trunk/blender/source/blender/editors/object/object_edit.c
    trunk/blender/source/blender/editors/sculpt_paint/CMakeLists.txt
    trunk/blender/source/blender/editors/sculpt_paint/SConscript
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_intern.h
    trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/editors/uvedit/CMakeLists.txt
    trunk/blender/source/blender/editors/uvedit/uvedit_draw.c
    trunk/blender/source/blender/editors/uvedit/uvedit_intern.h
    trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
    trunk/blender/source/blender/editors/uvedit/uvedit_parametrizer.c
    trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
    trunk/blender/source/blender/gpu/intern/gpu_draw.c
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/RNA_access.h
    trunk/blender/source/blender/makesrna/intern/rna_scene.c
    trunk/blender/source/blender/makesrna/intern/rna_sculpt_paint.c
    trunk/blender/source/blender/makesrna/intern/rna_userdef.c
    trunk/blender/source/blender/windowmanager/intern/wm_keymap.c
    trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c

Added Paths:
-----------
    trunk/blender/source/blender/editors/sculpt_paint/sculpt_uv.c
    trunk/blender/source/blender/editors/uvedit/uvedit_smart_stitch.c

Modified: trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/release/scripts/modules/bpy_extras/keyconfig_utils.py	2012-01-17 17:02:33 UTC (rev 43462)
@@ -70,6 +70,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: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-01-17 17:02:33 UTC (rev 43462)
@@ -52,8 +52,9 @@
         layout.prop(sima, "use_realtime_update")
         if show_uvedit:
             layout.prop(toolsettings, "show_uv_local_view")
-            layout.prop(uv, "show_other_objects")
 
+        layout.prop(uv, "show_other_objects")
+
         layout.separator()
 
         layout.operator("image.view_zoom_in")
@@ -146,11 +147,13 @@
                     if ima.source in {'FILE', 'GENERATED'} and ima.type != 'OPEN_EXR_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"
 
@@ -256,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
@@ -267,6 +274,8 @@
         layout.operator("uv.average_islands_scale")
         layout.operator("uv.minimize_stretch")
         layout.operator("uv.stitch")
+        layout.operator("uv.mark_seam")
+        layout.operator("uv.seams_from_islands")
         layout.operator("mesh.faces_mirror_uv")
 
         layout.separator()
@@ -753,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: trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/release/scripts/startup/bl_ui/space_userpref.py	2012-01-17 17:02:33 UTC (rev 43462)
@@ -425,6 +425,7 @@
         col.label(text="OpenGL:")
         col.prop(system, "gl_clip_alpha", slider=True)
         col.prop(system, "use_mipmaps")
+        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: trunk/blender/source/blender/blenkernel/BKE_mesh.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_mesh.h	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/source/blender/blenkernel/BKE_mesh.h	2012-01-17 17:02:33 UTC (rev 43462)
@@ -52,7 +52,10 @@
 struct DerivedMesh;
 struct Scene;
 struct MLoopUV;
-
+struct UvVertMap;
+struct UvMapVert;
+struct UvElementMap;
+struct UvElement;
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -126,6 +129,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: trunk/blender/source/blender/blenkernel/intern/paint.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/paint.c	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/source/blender/blenkernel/intern/paint.c	2012-01-17 17:02:33 UTC (rev 43462)
@@ -66,6 +66,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: trunk/blender/source/blender/blenkernel/intern/scene.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/scene.c	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/source/blender/blenkernel/intern/scene.c	2012-01-17 17:02:33 UTC (rev 43462)
@@ -297,6 +297,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);
+		}
 		free_paint(&sce->toolsettings->imapaint.paint);
 
 		MEM_freeN(sce->toolsettings);

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h	2012-01-17 17:02:33 UTC (rev 43462)
@@ -116,9 +116,10 @@
 
 /*********************************** Length **********************************/
 
+MINLINE float len_squared_v2(const float v[2]);
 MINLINE float len_v2(const float a[2]);
 MINLINE float len_v2v2(const float a[2], const float b[2]);
-MINLINE float len_squared_v2v2(const float a[3], const float b[3]);
+MINLINE float len_squared_v2v2(const float a[2], const float b[2]);
 MINLINE float len_v3(const float a[3]);
 MINLINE float len_v3v3(const float a[3], const float b[3]);
 MINLINE float len_squared_v3v3(const float a[3], const float b[3]);

Modified: trunk/blender/source/blender/blenlib/intern/math_vector_inline.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2012-01-17 16:41:41 UTC (rev 43461)
+++ trunk/blender/source/blender/blenlib/intern/math_vector_inline.c	2012-01-17 17:02:33 UTC (rev 43462)

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list