[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39377] branches/soc-2011-onion: uv paint brushes

Antony Riakiotakis kalast at gmail.com
Sun Aug 14 02:08:13 CEST 2011


Revision: 39377
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39377
Author:   psy-fi
Date:     2011-08-14 00:08:11 +0000 (Sun, 14 Aug 2011)
Log Message:
-----------
uv paint brushes
=================
-expose tool selection and relaxation method in RNA and GUI

Modified Paths:
--------------
    branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene.c

Modified: branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py	2011-08-13 23:40:25 UTC (rev 39376)
+++ branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py	2011-08-14 00:08:11 UTC (rev 39377)
@@ -826,7 +826,16 @@
         col.prop(context.tool_settings, "uv_paint_pin_edges");
         col.prop(context.tool_settings, "uv_paint_all_islands");
         
+        split = layout.split()
+        col = split.column()
 
+        col.prop(context.tool_settings, "uv_paint_tool");
+        
+        if context.tool_settings.uv_paint_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/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c	2011-08-13 23:40:25 UTC (rev 39376)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c	2011-08-14 00:08:11 UTC (rev 39377)
@@ -5105,6 +5105,9 @@
 {
 	if(!settings->uvpaint){
 		settings->uvpaint = MEM_callocN(sizeof(*settings->uvpaint), "UV Smooth paint");
+		settings->uv_paint_tool = UV_PAINT_TOOL_PINCH;
+		settings->uv_paint_settings = UV_PAINT_PIN_EDGES | UV_PAINT_ALL_ISLANDS;
+		settings->uv_relax_method = UV_PAINT_TOOL_RELAX_HC;
 	}
 	paint_mode_init(
 		wm,

Modified: branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h	2011-08-13 23:40:25 UTC (rev 39376)
+++ branches/soc-2011-onion/source/blender/makesdna/DNA_scene_types.h	2011-08-14 00:08:11 UTC (rev 39377)
@@ -498,9 +498,17 @@
 
 
 /* UV Paint */
-#define UV_PAINT_PIN_EDGES		1
-#define UV_PAINT_ALL_ISLANDS	2
+#define UV_PAINT_PIN_EDGES				1
+#define UV_PAINT_ALL_ISLANDS			2
 
+#define UV_PAINT_TOOL_PINCH				1
+#define UV_PAINT_TOOL_RELAX				2
+
+#define UV_PAINT_TOOL_RELAX_LAPLACIAN	1
+#define UV_PAINT_TOOL_RELAX_HC			2
+
+
+
 typedef struct TimeMarker {
 	struct TimeMarker *next, *prev;
 	int frame;
@@ -732,10 +740,15 @@
 
 	int auto_normalize; /*auto normalizing mode in wpaint*/
 
+	/* Settings for UV painting*/
+	int use_uv_paint;
+	int uv_paint_settings;
+	int uv_paint_tool;
+	int uv_relax_method;
+
+
 	short sculpt_paint_settings; /* user preferences for sculpt and paint */
-	short use_uv_paint;
-	int pad1;
-	int uv_paint_settings;
+	short pad1;
 	int sculpt_paint_unified_size; /* unified radius of brush in pixels */
 	float sculpt_paint_unified_unprojected_radius;/* unified radius of brush in Blender units */
 	float sculpt_paint_unified_alpha; /* unified strength of brush */

Modified: branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene.c	2011-08-13 23:40:25 UTC (rev 39376)
+++ branches/soc-2011-onion/source/blender/makesrna/intern/rna_scene.c	2011-08-14 00:08:11 UTC (rev 39377)
@@ -61,6 +61,17 @@
 
 #include "BLI_threads.h"
 
+EnumPropertyItem uv_paint_relaxation_items[] = {
+	{UV_PAINT_TOOL_RELAX_LAPLACIAN, "LAPLACIAN", 0, "Laplacian", "Use Laplacian method for relaxation"},
+	{UV_PAINT_TOOL_RELAX_HC, "HC", 0, "HC", "Use HC method for relaxation"},
+	{0, NULL, 0, NULL, NULL}};
+
+EnumPropertyItem uv_paint_tool_items[] = {
+	{UV_PAINT_TOOL_PINCH, "PINCH", 0, "Pinch", "Pinch UVs"},
+	{UV_PAINT_TOOL_RELAX, "RELAX", 0, "Relax", "Relax UVs"},
+	{0, NULL, 0, NULL, NULL}};
+
+
 EnumPropertyItem snap_target_items[] = {
 	{SCE_SNAP_TARGET_CLOSEST, "CLOSEST", 0, "Closest", "Snap closest point onto target"},
 	{SCE_SNAP_TARGET_CENTER, "CENTER", 0, "Center", "Snap center onto target"},
@@ -1136,6 +1147,16 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "uv_paint_settings", UV_PAINT_ALL_ISLANDS);
 	RNA_def_property_ui_text(prop, "Paint All Islands", "Brush operates on all islands");
 
+	prop= RNA_def_property(srna, "uv_paint_tool", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "uv_paint_tool");
+	RNA_def_property_enum_items(prop, uv_paint_tool_items);
+	RNA_def_property_ui_text(prop, "UV Brush Tools", "Select Tools for the UV brushes");
+
+	prop= RNA_def_property(srna, "uv_relax_method", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "uv_relax_method");
+	RNA_def_property_enum_items(prop, uv_paint_relaxation_items);
+	RNA_def_property_ui_text(prop, "Relaxation Method", "Algorithm used for UV relaxation");
+
 	/* Transform */
 	prop= RNA_def_property(srna, "proportional_edit", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "proportional");




More information about the Bf-blender-cvs mailing list