forked from bartvdbraak/blender
move pivot point and cursor out of UV rna into image space since both mask and uvedit use them.
This commit is contained in:
parent
4c4973350e
commit
75a188272e
@ -383,11 +383,17 @@ class IMAGE_HT_header(Header):
|
||||
|
||||
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 @@ class IMAGE_HT_header(Header):
|
||||
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 @@ class IMAGE_PT_view_properties(Panel):
|
||||
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 @@ class IMAGE_PT_view_properties(Panel):
|
||||
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:")
|
||||
|
@ -318,6 +318,19 @@ static void image_keymap(struct wmKeyConfig *keyconf)
|
||||
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 */
|
||||
|
@ -3788,19 +3788,6 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
|
||||
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);
|
||||
|
||||
|
@ -1165,13 +1165,6 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
|
||||
{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 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
|
||||
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 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
|
||||
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 @@ static void rna_def_space_image(BlenderRNA *brna)
|
||||
{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 @@ static void rna_def_space_image(BlenderRNA *brna)
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user