Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-12 22:56:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-12 23:04:45 +0300
commit1422c0650c951f21bee2555e4e7f03bb8c64cace (patch)
tree372c5500708c4a573bcacf09eb09bac4b555dd04 /source/blender/makesrna/intern/rna_space.c
parente0a561be1f83e94ea976166cf4ff6d5ecd16f990 (diff)
UI: move pivot to the topbar
Pivot variables are now stored in scene toolsettings.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c54
1 files changed, 2 insertions, 52 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index d8c3fdd7a64..306c659fbf6 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -136,18 +136,6 @@ static const EnumPropertyItem stereo3d_eye_items[] = {
};
#endif
-static const EnumPropertyItem pivot_items_full[] = {
- {V3D_AROUND_CENTER_BOUNDS, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center",
- "Pivot around bounding box center of selected object(s)"},
- {V3D_AROUND_CURSOR, "CURSOR", ICON_CURSOR, "3D Cursor", "Pivot around the 3D cursor"},
- {V3D_AROUND_LOCAL_ORIGINS, "INDIVIDUAL_ORIGINS", ICON_ROTATECOLLECTION,
- "Individual Origins", "Pivot around each object's own origin"},
- {V3D_AROUND_CENTER_MEAN, "MEDIAN_POINT", ICON_ROTATECENTER, "Median Point",
- "Pivot around the median point of selected objects"},
- {V3D_AROUND_ACTIVE, "ACTIVE_ELEMENT", ICON_ROTACTIVE, "Active Element", "Pivot around active object"},
- {0, NULL, 0, NULL, NULL}
-};
-
static const EnumPropertyItem draw_channels_items[] = {
{SI_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha",
"Draw image with RGB colors and alpha transparency"},
@@ -549,32 +537,6 @@ static void rna_SpaceView3D_matcap_enable(Main *UNUSED(bmain), Scene *UNUSED(sce
}
}
-static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
-{
- if (U.uiflag & USER_LOCKAROUND) {
- View3D *v3d_act = (View3D *)(ptr->data);
-
- /* TODO, space looper */
- bScreen *screen;
- for (screen = bmain->screen.first; screen; screen = screen->id.next) {
- ScrArea *sa;
- for (sa = screen->areabase.first; sa; sa = sa->next) {
- SpaceLink *sl;
- for (sl = sa->spacedata.first; sl; sl = sl->next) {
- if (sl->spacetype == SPACE_VIEW3D) {
- View3D *v3d = (View3D *)sl;
- if (v3d != v3d_act) {
- v3d->around = v3d_act->around;
- v3d->flag = (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN);
- ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER);
- }
- }
- }
- }
- }
- }
-}
-
static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr)
{
View3D *v3d = (View3D *)(ptr->data);
@@ -1031,7 +993,7 @@ static const EnumPropertyItem *rna_SpaceImageEditor_pivot_itemf(
SpaceImage *sima = (SpaceImage *)ptr->data;
if (sima->mode == SI_MODE_PAINT)
- return pivot_items_full;
+ return rna_enum_transform_pivot_items_full;
else
return pivot_items;
}
@@ -2622,18 +2584,6 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_ORTHO, 0);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, 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_full);
- RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
-
- prop = RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN);
- RNA_def_property_ui_text(prop, "Align", "Manipulate center points (object, pose and weight paint mode only)");
- RNA_def_property_ui_icon(prop, ICON_ALIGN, 0);
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update");
-
prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_MANIPULATOR_DRAW);
RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms");
@@ -3044,7 +2994,7 @@ static void rna_def_space_image(BlenderRNA *brna)
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_full);
+ RNA_def_property_enum_items(prop, rna_enum_transform_pivot_items_full);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_pivot_itemf");
RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);