[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49611] trunk/blender: move pivot point and cursor out of UV rna into image space since both mask and uvedit use them .

Campbell Barton ideasman42 at gmail.com
Mon Aug 6 14:12:46 CEST 2012


Revision: 49611
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49611
Author:   campbellbarton
Date:     2012-08-06 12:12:45 +0000 (Mon, 06 Aug 2012)
Log Message:
-----------
move pivot point and cursor out of UV rna into image space since both mask and uvedit use them.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-08-06 11:55:52 UTC (rev 49610)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2012-08-06 12:12:45 UTC (rev 49611)
@@ -383,11 +383,17 @@
 
         layout.prop(sima, "mode", text="")
 
+        if show_maskedit:
+            row = layout.row()
+            row.template_ID(sima, "mask", new="mask.new")
+
+        if show_uvedit or show_maskedit:
+            layout.prop(sima, "pivot_point", text="", icon_only=True)
+
         # uv editing
         if show_uvedit:
             uvedit = sima.uv_editor
 
-            layout.prop(uvedit, "pivot_point", text="", icon_only=True)
             layout.prop(toolsettings, "use_uv_select_sync", text="")
 
             if toolsettings.use_uv_select_sync:
@@ -408,14 +414,6 @@
             mesh = context.edit_object.data
             layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="")
 
-        if show_maskedit:
-            row = layout.row()
-            row.template_ID(sima, "mask", new="mask.new")
-
-            # reused for mask
-            uvedit = sima.uv_editor
-            layout.prop(uvedit, "pivot_point", text="", icon_only=True)
-
         if ima:
             # layers
             layout.template_image_layers(ima, iuser)
@@ -617,6 +615,7 @@
         sima = context.space_data
         ima = sima.image
         show_uvedit = sima.show_uvedit
+        show_maskedit = sima.show_maskedit
         uvedit = sima.uv_editor
 
         split = layout.split()
@@ -635,12 +634,12 @@
             col.label(text="Coordinates:")
             col.prop(uvedit, "show_normalized_coords", text="Normalized")
 
-        if show_uvedit:
-
+        if show_uvedit or show_maskedit:
             col = layout.column()
             col.label("Cursor Location:")
-            col.row().prop(uvedit, "cursor_location", text="")
+            col.row().prop(sima, "cursor_location", text="")
 
+        if show_uvedit:
             col.separator()
 
             col.label(text="UVs:")

Modified: trunk/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/space_image.c	2012-08-06 11:55:52 UTC (rev 49610)
+++ trunk/blender/source/blender/editors/space_image/space_image.c	2012-08-06 12:12:45 UTC (rev 49611)
@@ -318,6 +318,19 @@
 		RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot");
 		RNA_int_set(kmi->ptr, "value", i);
 	}
+
+	/* pivot */
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
+	RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
+	RNA_string_set(kmi->ptr, "value", "CENTER");
+
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0);
+	RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
+	RNA_string_set(kmi->ptr, "value", "MEDIAN");
+
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
+	RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
+	RNA_string_set(kmi->ptr, "value", "CURSOR");
 }
 
 /* dropboxes */

Modified: trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- trunk/blender/source/blender/editors/uvedit/uvedit_ops.c	2012-08-06 11:55:52 UTC (rev 49610)
+++ trunk/blender/source/blender/editors/uvedit/uvedit_ops.c	2012-08-06 12:12:45 UTC (rev 49611)
@@ -3788,19 +3788,6 @@
 	WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
 	WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_select_mode", TABKEY, KM_PRESS, KM_CTRL, 0);
 
-	/* pivot */
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
-	RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
-	RNA_string_set(kmi->ptr, "value", "CENTER");
-
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0);
-	RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
-	RNA_string_set(kmi->ptr, "value", "MEDIAN");
-
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
-	RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
-	RNA_string_set(kmi->ptr, "value", "CURSOR");
-
 	ED_keymap_proportional_cycle(keyconf, keymap);
 	ED_keymap_proportional_editmode(keyconf, keymap, FALSE);
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-08-06 11:55:52 UTC (rev 49610)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-08-06 12:12:45 UTC (rev 49611)
@@ -1165,13 +1165,6 @@
 		{0, NULL, 0, NULL, NULL}
 	};
 
-	static EnumPropertyItem pivot_items[] = {
-		{V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
-		{V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
-		{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
-		{0, NULL, 0, NULL, NULL}
-	};
-
 	srna = RNA_def_struct(brna, "SpaceUVEditor", NULL);
 	RNA_def_struct_sdna(srna, "SpaceImage");
 	RNA_def_struct_nested(brna, srna, "SpaceImageEditor");
@@ -1231,13 +1224,6 @@
 	RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
 
-	prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
-	RNA_def_property_array(prop, 2);
-	RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
-	                             "rna_SpaceImageEditor_cursor_location_set", NULL);
-	RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
-
 	/* todo: move edge and face drawing options here from G.f */
 
 	prop = RNA_def_property(srna, "use_snap_to_pixels", PROP_BOOLEAN, PROP_NONE);
@@ -1256,12 +1242,6 @@
 	RNA_def_property_ui_text(prop, "Live Unwrap",
 	                         "Continuously unwrap the selected UV island while transforming pinned vertices");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
-
-	prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
-	RNA_def_property_enum_sdna(prop, NULL, "around");
-	RNA_def_property_enum_items(prop, pivot_items);
-	RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
-	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
 }
 
 static void rna_def_space_outliner(BlenderRNA *brna)
@@ -1977,6 +1957,13 @@
 		{0, NULL, 0, NULL, NULL}
 	};
 
+	static EnumPropertyItem pivot_items[] = {
+		{V3D_CENTER, "CENTER", ICON_ROTATE, "Bounding Box Center", ""},
+		{V3D_CENTROID, "MEDIAN", ICON_ROTATECENTER, "Median Point", ""},
+		{V3D_CURSOR, "CURSOR", ICON_CURSOR, "2D Cursor", ""},
+		{0, NULL, 0, NULL, NULL}
+	};
+
 	StructRNA *srna;
 	PropertyRNA *prop;
 
@@ -2053,6 +2040,20 @@
 	RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, "rna_SpaceImageEditor_mode_update");
 
+	/* transform */
+	prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ);
+	RNA_def_property_array(prop, 2);
+	RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get",
+	                             "rna_SpaceImageEditor_cursor_location_set", NULL);
+	RNA_def_property_ui_text(prop, "2D Cursor Location", "2D cursor location for this view");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
+
+	prop = RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "around");
+	RNA_def_property_enum_items(prop, pivot_items);
+	RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
+
 	/* grease pencil */
 	prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "gpd");




More information about the Bf-blender-cvs mailing list