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-06-20 12:11:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-20 12:12:18 +0300
commit6d21450a61a91b633b7cadd7a8f12fbfec6b9f93 (patch)
tree78ce68dff4f62f17b25eac4cbb8448df12d97061
parent109dbab593b183b17e474d3f92468b06c86684f2 (diff)
Revert "UI: fix "Edit Source" operator"
This reverts commit 109dbab593b183b17e474d3f92468b06c86684f2. Accidental changes applied
-rw-r--r--source/blender/editors/interface/interface_ops.c1
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c47
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h3
-rw-r--r--source/blender/makesdna/DNA_object_enums.h4
4 files changed, 6 insertions, 49 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index aad48d13277..6fcede58737 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1004,7 +1004,6 @@ static int editsource_exec(bContext *C, wmOperator *op)
ui_editsource_active_but_set(but);
/* redraw and get active button python info */
- ED_region_do_layout(C, ar);
ED_region_do_draw(C, ar);
ar->do_draw = false;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index b23ba83408c..e4f551b0004 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -264,24 +264,6 @@ static void restrictbutton_gp_layer_flag_cb(bContext *C, void *UNUSED(poin), voi
WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL);
}
-static void restrictbutton_object_mode_cb(bContext *C, void *poin, void *poin2)
-{
- eObjectMode object_mode_toggle = (eObjectMode)(intptr_t)poin;
- Object *ob = poin2;
- /* WEAK, restore original value! Switch is an operator. */
- ob->mode = object_mode_toggle;
-
- printf("HELLO %s\n", ob->id.name);
- ViewLayer *view_layer = CTX_data_view_layer(C);
- Base *base = BKE_view_layer_base_find(view_layer, ob);
- if (base == NULL) {
- return;
- }
-
- Scene *scene = CTX_data_scene(C);
- outliner_object_mode_toggle(C, scene, view_layer, base);
-}
-
static void restrictbutton_id_user_toggle(bContext *UNUSED(C), void *poin, void *UNUSED(poin2))
{
ID *id = (ID *)poin;
@@ -453,8 +435,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
}
static void outliner_draw_restrictbuts(
- uiBlock *block, Scene *scene, const Object *obact, const eObjectMode object_mode_toggle,
- ARegion *ar, SpaceOops *soops, ListBase *lb)
+ uiBlock *block, Scene *scene, ARegion *ar, SpaceOops *soops, ListBase *lb)
{
uiBut *bt;
@@ -563,20 +544,6 @@ static void outliner_draw_restrictbuts(
/* TODO: visibility in renders */
}
- else if ((tselem->type == 0) && (te->idcode == ID_OB)) {
- if (object_mode_toggle != OB_MODE_OBJECT) {
- Object *ob = (Object *)tselem->id;
- if (ob->type == obact->type) {
- bt = uiDefIconButBitI(
- block, UI_BTYPE_ICON_TOGGLE, object_mode_toggle, 0, ICON_CHECKBOX_DEHLT,
- (int)(ar->v2d.cur.xmax - OL_TOG_OBJECT_MODE), te->ys, UI_UNIT_X,
- UI_UNIT_Y, &ob->mode, 0, 0, 0, 0,
- TIP_("Restrict/Allow editing of strokes and keyframes in this layer"));
- UI_but_func_set(bt, restrictbutton_object_mode_cb, (void *)(intptr_t)ob->mode, ob);
- UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK);
- }
- }
- }
else if (outliner_is_collection_tree_element(te)) {
LayerCollection *lc = (tselem->type == TSE_LAYER_COLLECTION) ? te->directdata : NULL;
Collection *collection = outliner_collection_from_tree_element(te);
@@ -609,7 +576,7 @@ static void outliner_draw_restrictbuts(
}
if (TSELEM_OPEN(tselem, soops)) {
- outliner_draw_restrictbuts(block, scene, obact, object_mode_toggle, ar, soops, &te->subtree);
+ outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree);
}
}
}
@@ -1926,7 +1893,7 @@ static void outliner_draw_restrictcols(ARegion *ar)
unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_I32, 2, GWN_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColorShadeAlpha(TH_BACK, -15, -200);
- immBegin(GWN_PRIM_LINES, 8);
+ immBegin(GWN_PRIM_LINES, 6);
immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)ar->v2d.cur.ymax);
immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)ar->v2d.cur.ymin);
@@ -1937,9 +1904,6 @@ static void outliner_draw_restrictcols(ARegion *ar)
immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), (int)ar->v2d.cur.ymax);
immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_RENDERX), (int)ar->v2d.cur.ymin);
- immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_OBJECT_MODE), (int)ar->v2d.cur.ymax);
- immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_OBJECT_MODE), (int)ar->v2d.cur.ymin);
-
immEnd();
immUnbindProgram();
}
@@ -2032,11 +1996,10 @@ void draw_outliner(const bContext *C)
outliner_draw_userbuts(block, ar, soops, &soops->tree);
}
else if (has_restrict_icons) {
- const Object *obact = OBACT(view_layer);
- const eObjectMode object_mode_toggle = obact ? (obact->mode & OB_MODE_ALL_MULTI) : OB_MODE_OBJECT;
/* draw restriction columns */
outliner_draw_restrictcols(ar);
- outliner_draw_restrictbuts(block, scene, obact, object_mode_toggle, ar, soops, &soops->tree);
+
+ outliner_draw_restrictbuts(block, scene, ar, soops, &soops->tree);
}
/* draw edit buttons if nessecery */
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index ac5c5906b3b..aa3c0a52f70 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -151,12 +151,11 @@ typedef enum {
/* size constants */
#define OL_Y_OFFSET 2
-#define OL_TOG_OBJECT_MODE (UI_UNIT_X * 4.0f)
#define OL_TOG_RESTRICT_SELECTX (UI_UNIT_X * 3.0f)
#define OL_TOG_RESTRICT_VIEWX (UI_UNIT_X * 2.0f)
#define OL_TOG_RESTRICT_RENDERX UI_UNIT_X
-#define OL_TOGW OL_TOG_OBJECT_MODE
+#define OL_TOGW OL_TOG_RESTRICT_SELECTX
#define OL_RNA_COLX (UI_UNIT_X * 15)
#define OL_RNA_COL_SIZEX (UI_UNIT_X * 7.5f)
diff --git a/source/blender/makesdna/DNA_object_enums.h b/source/blender/makesdna/DNA_object_enums.h
index 4462c939032..802ca6c7d0d 100644
--- a/source/blender/makesdna/DNA_object_enums.h
+++ b/source/blender/makesdna/DNA_object_enums.h
@@ -50,8 +50,4 @@ typedef enum eObjectMode {
#define OB_MODE_ALL_MODE_DATA \
(OB_MODE_EDIT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_SCULPT | OB_MODE_POSE)
-/* Any mode that supports multiple objects at once. */
-#define OB_MODE_ALL_MULTI \
- (OB_MODE_EDIT | OB_MODE_POSE)
-
#endif /* __DNA_OBJECT_ENUMS_H__ */