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>2019-11-01 19:11:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-11-01 20:32:50 +0300
commit0dd9e55d211453a6571fb5d3838c7d736434c8ee (patch)
tree11a03a054fd6fa0bb96e67dfd88c1d1d1c2cf113 /source/blender/editors/space_outliner/outliner_intern.h
parent5840c17970a0ff746663069b46663e3f55dcc162 (diff)
Fix T71247: Outliner pose toggle looses bone selection
The outliner didn't account for weight-paint + pose-mode, making it consider all pose bones unselected. When syncing selection, bones were unselected. This adds a context argument to passed to drawing functions since finding the weight-paint pose-object in the drawing loop isn't efficient.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_intern.h')
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index ec85d05a1ff..23c883c0db3 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -200,6 +200,25 @@ typedef enum {
#define TSELEM_OPEN(telm, sv) \
((telm->flag & TSE_CLOSED) == 0 || (SEARCHING_OUTLINER(sv) && (telm->flag & TSE_CHILDSEARCH)))
+/**
+ * Container to avoid passing around these variables to many functions.
+ * Also so we can have one place to assing these variables.
+ */
+typedef struct TreeViewContext {
+ /* Scene level. */
+ struct Scene *scene;
+ struct ViewLayer *view_layer;
+
+ /* Object level. */
+ /** Avoid OBACT macro everywhere. */
+ Object *obact;
+ Object *ob_edit;
+ /**
+ * The pose object may not be the active object (when in weight paint mode).
+ * Checking this in draw loops isn't efficient, so set only once. */
+ Object *ob_pose;
+} TreeViewContext;
+
/* outliner_tree.c ----------------------------------------------- */
void outliner_free_tree(ListBase *tree);
@@ -237,16 +256,14 @@ int tree_element_id_type_to_index(TreeElement *te);
/* outliner_select.c -------------------------------------------- */
eOLDrawState tree_element_type_active(struct bContext *C,
- struct Scene *scene,
- struct ViewLayer *view_layer,
+ const TreeViewContext *tvc,
struct SpaceOutliner *soops,
TreeElement *te,
TreeStoreElem *tselem,
const eOLSetState set,
bool recursive);
eOLDrawState tree_element_active(struct bContext *C,
- struct Scene *scene,
- struct ViewLayer *view_layer,
+ const TreeViewContext *tvc,
SpaceOutliner *soops,
TreeElement *te,
const eOLSetState set,
@@ -458,6 +475,8 @@ void OUTLINER_OT_unhide_all(struct wmOperatorType *ot);
/* outliner_utils.c ---------------------------------------------- */
+void outliner_viewcontext_init(const struct bContext *C, TreeViewContext *tvc);
+
TreeElement *outliner_find_item_at_y(const SpaceOutliner *soops,
const ListBase *tree,
float view_co_y);