[Bf-blender-cvs] [a8777f90584] blender2.8: Merge branch 'master' into blender2.8
Campbell Barton
noreply at git.blender.org
Mon Nov 20 10:34:30 CET 2017
Commit: a8777f905846f80385fc90135e000c3169bbefc6
Author: Campbell Barton
Date: Mon Nov 20 20:45:03 2017 +1100
Branches: blender2.8
https://developer.blender.org/rBa8777f905846f80385fc90135e000c3169bbefc6
Merge branch 'master' into blender2.8
===================================================================
===================================================================
diff --cc source/blender/blenkernel/CMakeLists.txt
index 6063c068909,96c653dee23..24b0adb1adb
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -304,8 -292,6 +304,7 @@@ set(SR
BKE_texture.h
BKE_tracking.h
BKE_unit.h
- BKE_utildefines.h
+ BKE_workspace.h
BKE_world.h
BKE_writeavi.h
BKE_writeframeserver.h
diff --cc source/blender/editors/armature/pose_transform.c
index 948c7803420,3707b914ecb..18d6408f026
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@@ -542,8 -541,15 +548,15 @@@ static int pose_paste_exec(bContext *C
}
}
BKE_main_free(tmp_bmain);
+
/* Update event for pose and deformation children. */
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+
+ /* Recalculate paths if any of the bones have paths... */
+ if ((ob->pose->avs.path_bakeflag & MOTIONPATH_BAKE_HAS_PATHS)) {
- ED_pose_recalculate_paths(scene, ob);
++ ED_pose_recalculate_paths(C, scene, ob);
+ }
+
/* Notifiers for updates, */
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
diff --cc source/blender/editors/metaball/mball_edit.c
index 175b40d72ff,5b4078b98b7..935f1a5ea4a
--- a/source/blender/editors/metaball/mball_edit.c
+++ b/source/blender/editors/metaball/mball_edit.c
@@@ -547,17 -546,19 +547,19 @@@ static int reveal_metaelems_exec(bConte
{
Object *obedit = CTX_data_edit_object(C);
MetaBall *mb = (MetaBall *)obedit->data;
- MetaElem *ml;
-
- ml = mb->editelems->first;
+ const bool select = RNA_boolean_get(op->ptr, "select");
+ bool changed = false;
- if (ml) {
- while (ml) {
+ for (MetaElem *ml = mb->editelems->first; ml; ml = ml->next) {
+ if (ml->flag & MB_HIDE) {
+ SET_FLAG_FROM_TEST(ml->flag, select, SELECT);
ml->flag &= ~MB_HIDE;
- ml = ml->next;
+ changed = true;
}
+ }
+ if (changed) {
WM_event_add_notifier(C, NC_GEOM | ND_DATA, mb);
- DAG_id_tag_update(obedit->data, 0);
+ DEG_id_tag_update(obedit->data, 0);
}
return OPERATOR_FINISHED;
diff --cc source/blender/editors/object/object_lattice.c
index 557e0a0eccf,57053ddc020..b2f9bee27ff
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@@ -56,10 -57,7 +56,9 @@@
#include "BKE_lattice.h"
#include "BKE_deform.h"
#include "BKE_report.h"
- #include "BKE_utildefines.h"
+#include "DEG_depsgraph.h"
+
#include "ED_lattice.h"
#include "ED_object.h"
#include "ED_screen.h"
diff --cc source/blender/editors/physics/particle_edit.c
index a46425a937e,da66ec44235..8986ebd26e9
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@@ -1977,8 -1954,8 +1977,9 @@@ static int reveal_exec(bContext *C, wmO
{
Object *ob= CTX_data_active_object(C);
Scene *scene= CTX_data_scene(C);
- PTCacheEdit *edit = PE_get_current(scene, ob);
+ SceneLayer *sl = CTX_data_scene_layer(C);
+ PTCacheEdit *edit= PE_get_current(scene, sl, ob);
+ const bool select = RNA_boolean_get(op->ptr, "select");
POINT_P; KEY_K;
LOOP_POINTS {
diff --cc source/blender/editors/space_outliner/outliner_intern.h
index 8d93f6bca55,ca7dbe4f73c..1edb3c88396
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@@ -192,11 -146,17 +192,17 @@@ void restrictbutton_gr_restrict_flag(vo
/* outliner_select.c -------------------------------------------- */
eOLDrawState tree_element_type_active(
- struct bContext *C, struct Scene *scene, struct SpaceOops *soops,
+ struct bContext *C, struct Scene *scene, struct SceneLayer *sl, struct SpaceOops *soops,
TreeElement *te, TreeStoreElem *tselem, const eOLSetState set, bool recursive);
-eOLDrawState tree_element_active(struct bContext *C, struct Scene *scene, SpaceOops *soops,
+eOLDrawState tree_element_active(struct bContext *C, struct Scene *scene, struct SceneLayer *sl, SpaceOops *soops,
TreeElement *te, const eOLSetState set, const bool handle_all_types);
- int outliner_item_activate_or_toggle_closed(struct bContext *C, int x, int y, bool extend, bool recursive);
+
+ void outliner_item_do_activate_from_tree_element(
+ struct bContext *C, TreeElement *te, TreeStoreElem *tselem,
+ bool extend, bool recursive);
+ int outliner_item_do_activate_from_cursor(
+ struct bContext *C, const int mval[2],
+ bool extend, bool recursive);
/* outliner_edit.c ---------------------------------------------- */
typedef void (*outliner_operation_cb)(
diff --cc source/blender/editors/space_outliner/outliner_select.c
index 606cc2fd14a,9f79b575966..670be7611e4
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@@ -876,21 -892,25 +876,25 @@@ eOLDrawState tree_element_type_active
/* ================================================ */
- static void outliner_item_activate(
- bContext *C, SpaceOops *soops, TreeElement *te,
+ /**
+ * Action when clicking to activate an item (typically under the mouse cursor),
+ * but don't do any cursor intersection checks.
+ *
+ * Needed to run from operators accessed from a menu.
+ */
+ static void do_outliner_item_activate_tree_element(
- bContext *C, Scene *scene, SpaceOops *soops,
++ bContext *C, Scene *scene, SceneLayer *sl, SpaceOops *soops,
+ TreeElement *te, TreeStoreElem *tselem,
- bool extend, bool recursive)
+ const bool extend, const bool recursive)
{
- Scene *scene = CTX_data_scene(C);
- SceneLayer *sl = CTX_data_scene_layer(C);
- TreeStoreElem *tselem = TREESTORE(te);
-
/* always makes active object, except for some specific types.
* Note about TSE_EBONE: In case of a same ID_AR datablock shared among several objects, we do not want
* to switch out of edit mode (see T48328 for details). */
- if (!ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, TSE_EBONE)) {
+ if (!ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, TSE_EBONE, TSE_LAYER_COLLECTION)) {
- tree_element_set_active_object(C, scene, sl, soops, te,
- (extend && tselem->type == 0) ? OL_SETSEL_EXTEND : OL_SETSEL_NORMAL,
- recursive && tselem->type == 0);
+ tree_element_set_active_object(
- C, scene, soops, te,
++ C, scene, sl, soops, te,
+ (extend && tselem->type == 0) ? OL_SETSEL_EXTEND : OL_SETSEL_NORMAL,
+ recursive && tselem->type == 0);
}
if (tselem->type == 0) { // the lib blocks
@@@ -949,85 -965,126 +953,115 @@@
}
/**
- * Activates tree items, also handles clicking on arrows.
+ * \param extend: Don't deselect other items, only modify \a te.
+ * \param toggle: Select \a te when not selected, deselect when selected.
*/
-static bool do_outliner_item_activate_from_cursor(
- bContext *C, Scene *scene, ARegion *ar, SpaceOops *soops,
- TreeElement *te, bool extend, bool recursive, const float mval[2])
+static void outliner_item_select(SpaceOops *soops, const TreeElement *te, const bool extend, const bool toggle)
{
- if (mval[1] > te->ys && mval[1] < te->ys + UI_UNIT_Y) {
- TreeStoreElem *tselem = TREESTORE(te);
- bool openclose = false;
-
- /* open close icon */
- if ((te->flag & TE_ICONROW) == 0) { // hidden icon, no open/close
- if (mval[0] > te->xs && mval[0] < te->xs + UI_UNIT_X)
- openclose = true;
- }
-
- if (openclose) {
- /* all below close/open? */
- if (extend) {
- tselem->flag &= ~TSE_CLOSED;
- outliner_set_flag(&te->subtree, TSE_CLOSED, !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1));
- }
- else {
- if (tselem->flag & TSE_CLOSED) tselem->flag &= ~TSE_CLOSED;
- else tselem->flag |= TSE_CLOSED;
-
- }
-
- return true;
- }
- /* name and first icon */
- else if (mval[0] > te->xs + UI_UNIT_X && mval[0] < te->xend) {
- do_outliner_item_activate_tree_element(
- C, scene, soops,
- te, tselem,
- extend, recursive);
- return true;
- }
+ TreeStoreElem *tselem = TREESTORE(te);
+ const short new_flag = toggle ? (tselem->flag ^ TSE_SELECTED) : (tselem->flag | TSE_SELECTED);
+
+ if (extend == false) {
+ outliner_set_flag(&soops->tree, TSE_SELECTED, false);
}
-
- for (te = te->subtree.first; te; te = te->next) {
- if (do_outliner_item_activate_from_cursor(C, scene, ar, soops, te, extend, recursive, mval)) {
- return true;
- }
+ tselem->flag = new_flag;
+}
+
+static void outliner_item_toggle_closed(TreeElement *te, const bool toggle_children)
+{
+ TreeStoreElem *tselem = TREESTORE(te);
+ if (toggle_children) {
+ tselem->flag &= ~TSE_CLOSED;
+
+ const bool all_opened = !outliner_has_one_flag(&te->subtree, TSE_CLOSED, 1);
+ outliner_set_flag(&te->subtree, TSE_CLOSED, all_opened);
}
- return false;
+ else {
+ tselem->flag ^= TSE_CLOSED;
+ }
+}
+
+static bool outliner_item_is_co_within_close_toggle(TreeElement *te, float view_co_x)
+{
+ return ((te->flag & TE_ICONROW) == 0) && (view_co_x > te->xs) && (view_co_x < te->xs + UI_UNIT_X);
+}
+
+static bool outliner_is_co_within_restrict_columns(const SpaceOops *soops, const ARegion *ar, float view_co_x)
+{
+ return (!ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF) &&
+ !(soops->flag & SO_HIDE_RESTRICTCOLS) &&
+ (view_co_x > ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX));
}
- int outliner_item_activate_or_toggle_closed(bContext *C, int x, int y, bool extend, bool recursive)
+ /**
+ * A version of #outliner_item_do_acticate_from_cursor that takes the tree element directly.
+ * and doesn't depend on the pointer position.
+ *
+ * This allows us to simulate clicking on an item without dealing with the mouse cursor.
+ */
+ void outliner_item_do_activate_from_tree_element(
+ bContext *C, TreeElement *te, TreeStoreElem *tselem,
+ bool extend, bool recursive)
+ {
+ Scene *scene = CTX_data_scene(C);
++ Scen
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list