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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-01-11 16:35:36 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-01-11 16:35:36 +0300
commitc36f4a7f7f370ebb6e944d9893d2677232d3b7f8 (patch)
treec2030541dcaae70b2892c6838e8a3e76e24843e1 /source
parentcc63c8511cb18cc59fb2874dd5a57d89b7123bac (diff)
parentb415ed55a74c51b944cd0682fc7a81679778ac8f (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/intern/blender.c source/blender/makesdna/DNA_ID.h
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/blender.c15
-rw-r--r--source/blender/editors/interface/resources.c2
-rw-r--r--source/blender/editors/screen/area.c4
-rw-r--r--source/blender/editors/transform/transform_orientations.c17
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c11
6 files changed, 46 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 0b368df57ed..d03be79baad 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -262,6 +262,16 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use
SWAP(ListBase, userdef_a->id, userdef_b->id); \
} ((void)0)
+#define FLAG_SWAP(id, ty, flags) { \
+ CHECK_TYPE(&(userdef_a->id), ty *); \
+ const ty f = flags; \
+ const ty a = userdef_a->id; \
+ const ty b = userdef_b->id; \
+ userdef_a->id = (userdef_a->id & ~f) | (b & f); \
+ userdef_b->id = (userdef_b->id & ~f) | (a & f); \
+} ((void)0)
+
+
LIST_SWAP(uistyles);
LIST_SWAP(uifonts);
LIST_SWAP(themes);
@@ -276,9 +286,12 @@ void BKE_blender_userdef_app_template_data_swap(UserDef *userdef_a, UserDef *use
DATA_SWAP(manipulator_flag);
+ FLAG_SWAP(uiflag, int, USER_LOCK_UI_LAYOUT);
+
#undef SWAP_TYPELESS
-#undef LIST_SWAP
#undef DATA_SWAP
+#undef LIST_SWAP
+#undef FLAG_SWAP
}
void BKE_blender_userdef_app_template_data_set(UserDef *userdef)
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 2eae452debb..788c5fb3913 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2923,7 +2923,7 @@ void init_userdef_do_versions(void)
USER_FLAG_DEPRECATED_6 | USER_FLAG_DEPRECATED_7 |
USER_FLAG_DEPRECATED_9 | USER_FLAG_DEPRECATED_10);
U.uiflag &= ~(
- USER_UIFLAG_DEPRECATED_7);
+ USER_LOCK_UI_LAYOUT);
U.transopts &= ~(
USER_TR_DEPRECATED_2 | USER_TR_DEPRECATED_3 | USER_TR_DEPRECATED_4 |
USER_TR_DEPRECATED_6 | USER_TR_DEPRECATED_7);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 08d92dfc9ff..e097cd34eac 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -769,6 +769,10 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea
return;
}
+ if (U.uiflag & USER_LOCK_UI_LAYOUT) {
+ return;
+ }
+
/* can't click on bottom corners on OS X, already used for resizing */
#ifdef __APPLE__
if (!(sa->totrct.xmin == 0 && sa->totrct.ymin == 0) || WM_window_is_fullscreen(win))
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 63cd5291193..f8b11a0bcae 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -735,10 +735,19 @@ int getTransformOrientation_ex(const bContext *C, float normal[3], float plane[3
SWAP(BMVert *, v_pair[0], v_pair[1]);
}
- add_v3_v3v3(normal, v_pair[0]->no, v_pair[1]->no);
- sub_v3_v3v3(plane, v_pair[0]->co, v_pair[1]->co);
- /* flip the plane normal so we point outwards */
- negate_v3(plane);
+ add_v3_v3v3(normal, v_pair[1]->no, v_pair[0]->no);
+ sub_v3_v3v3(plane, v_pair[1]->co, v_pair[0]->co);
+
+ if (normalize_v3(plane) != 0.0f) {
+ /* For edges it'd important the resulting matrix can rotate around the edge,
+ * project onto the plane so we can use a fallback value. */
+ project_plane_normalized_v3_v3v3(normal, normal, plane);
+ if (UNLIKELY(normalize_v3(normal) == 0.0f)) {
+ /* in the case the normal and plane are aligned,
+ * use a fallback normal which is orthogonal to the plane. */
+ ortho_v3_v3(normal, plane);
+ }
+ }
}
result = ORIENTATION_EDGE;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 89761ee6ced..237091e1391 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -679,7 +679,9 @@ typedef enum eUserpref_UI_Flag {
USER_DRAWVIEWINFO = (1 << 4),
USER_PLAINMENUS = (1 << 5),
USER_LOCK_CURSOR_ADJUST = (1 << 6),
- USER_UIFLAG_DEPRECATED_7 = (1 << 7), /* cleared */
+ /* Avoid accidentally adjusting the layout
+ * (exact behavior may change based on whats considered reasonable to lock down). */
+ USER_LOCK_UI_LAYOUT = (1 << 7),
USER_ALLWINCODECS = (1 << 8),
USER_MENUOPENAUTO = (1 << 9),
USER_ZBUF_CURSOR = (1 << 10),
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 25ce04229ed..e2a0769490d 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -147,6 +147,12 @@ static void rna_userdef_dpi_update(Main *bmain, Scene *UNUSED(scene), PointerRNA
WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */
}
+static void rna_userdef_update_ui(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+{
+ WM_main_add_notifier(NC_WINDOW, NULL);
+ WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */
+}
+
static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
{
BLF_cache_clear();
@@ -3393,6 +3399,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE);
RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup");
+ prop = RNA_def_property(srna, "show_layout_ui", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_LOCK_UI_LAYOUT);
+ RNA_def_property_ui_text(prop, "Show Layout Widgets", "Show screen layout editing UI");
+ RNA_def_property_update(prop, 0, "rna_userdef_update_ui");
+
prop = RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS);
RNA_def_property_ui_text(prop, "Show Playback FPS",