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:
authorAntonioya <blendergit@gmail.com>2018-12-14 18:45:57 +0300
committerAntonioya <blendergit@gmail.com>2018-12-14 18:52:12 +0300
commit780f0f646da1aac01dc3164fd7d493426aca9e19 (patch)
tree453cb60e732399e22279e8eee7a1c9725416c427 /source/blender/editors
parenta1c8595b090254c1270bb66118304186a3add913 (diff)
GP: Rename CTX and OB modes
Part of T59335.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c10
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c18
-rw-r--r--source/blender/editors/interface/interface_icons.c2
-rw-r--r--source/blender/editors/object/object_edit.c6
-rw-r--r--source/blender/editors/object/object_modes.c12
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c2
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c6
-rw-r--r--source/blender/editors/undo/ed_undo.c2
12 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 9feea61c672..5ec55d1e98e 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1192,7 +1192,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
- const bool is_weight_mode = ob->mode == OB_MODE_GPENCIL_WEIGHT;
+ const bool is_weight_mode = ob->mode == OB_MODE_WEIGHT_GPENCIL;
/* set the brush using the tool */
#if 0
GP_Sculpt_Settings *gset = &ts->gp_sculpt;
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index a2cb9612e43..51046726e19 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1555,8 +1555,8 @@ static bool gpencil_vertex_group_poll(bContext *C)
if ((ob) && (ob->type == OB_GPENCIL)) {
if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) {
if (ELEM(ob->mode,
- OB_MODE_GPENCIL_EDIT,
- OB_MODE_GPENCIL_SCULPT))
+ OB_MODE_EDIT_GPENCIL,
+ OB_MODE_SCULPT_GPENCIL))
{
return true;
}
@@ -1572,7 +1572,7 @@ static bool gpencil_vertex_group_weight_poll(bContext *C)
if ((ob) && (ob->type == OB_GPENCIL)) {
if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) {
- if (ob->mode == OB_MODE_GPENCIL_WEIGHT) {
+ if (ob->mode == OB_MODE_WEIGHT_GPENCIL) {
return true;
}
}
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 072f4d0e317..916a268dc57 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -172,7 +172,7 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
}
/* set mode */
if (gpd->flag & GP_DATA_STROKE_EDITMODE) {
- mode = OB_MODE_GPENCIL_EDIT;
+ mode = OB_MODE_EDIT_GPENCIL;
}
else {
mode = OB_MODE_OBJECT;
@@ -301,7 +301,7 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
gpd->flag ^= GP_DATA_STROKE_PAINTMODE;
/* set mode */
if (gpd->flag & GP_DATA_STROKE_PAINTMODE) {
- mode = OB_MODE_GPENCIL_PAINT;
+ mode = OB_MODE_PAINT_GPENCIL;
}
else {
mode = OB_MODE_OBJECT;
@@ -316,7 +316,7 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
ob->mode = mode;
}
- if (mode == OB_MODE_GPENCIL_PAINT) {
+ if (mode == OB_MODE_PAINT_GPENCIL) {
/* be sure we have brushes */
BKE_paint_ensure(ts, (Paint **)&ts->gp_paint);
Paint *paint = &ts->gp_paint->paint;
@@ -400,7 +400,7 @@ static int gpencil_sculptmode_toggle_exec(bContext *C, wmOperator *op)
gpd->flag ^= GP_DATA_STROKE_SCULPTMODE;
/* set mode */
if (gpd->flag & GP_DATA_STROKE_SCULPTMODE) {
- mode = OB_MODE_GPENCIL_SCULPT;
+ mode = OB_MODE_SCULPT_GPENCIL;
}
else {
mode = OB_MODE_OBJECT;
@@ -488,7 +488,7 @@ static int gpencil_weightmode_toggle_exec(bContext *C, wmOperator *op)
gpd->flag ^= GP_DATA_STROKE_WEIGHTMODE;
/* set mode */
if (gpd->flag & GP_DATA_STROKE_WEIGHTMODE) {
- mode = OB_MODE_GPENCIL_WEIGHT;
+ mode = OB_MODE_WEIGHT_GPENCIL;
}
else {
mode = OB_MODE_OBJECT;
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index b97e335d081..68d0f6506d0 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1650,7 +1650,7 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts)
Paint *paint = &ts->gp_paint->paint;
Brush *brush_old = paint->brush;
for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) {
- if ((brush->ob_mode == OB_MODE_GPENCIL_PAINT) &&
+ if ((brush->ob_mode == OB_MODE_PAINT_GPENCIL) &&
(brush->gpencil_tool == GPAINT_TOOL_ERASE))
{
/* save first eraser to use later if no default */
@@ -2794,7 +2794,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
p->gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE;
/* set workspace mode */
ob->restore_mode = ob->mode;
- ob->mode = OB_MODE_GPENCIL_PAINT;
+ ob->mode = OB_MODE_PAINT_GPENCIL;
/* redraw mode on screen */
WM_event_add_notifier(C, NC_SCENE | ND_MODE, NULL);
}
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 40c2567f1c0..2ccaea84e6b 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1449,7 +1449,7 @@ static bool gp_check_cursor_region(bContext *C, int mval_i[2])
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) ||
- (!ELEM(ob->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT)))
+ (!ELEM(ob->mode, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL)))
{
return false;
}
@@ -1705,13 +1705,13 @@ static void gpencil_verify_brush_type(bContext *C, int newmode)
GP_Sculpt_Settings *gset = &ts->gp_sculpt;
switch (newmode) {
- case OB_MODE_GPENCIL_SCULPT:
+ case OB_MODE_SCULPT_GPENCIL:
gset->flag &= ~GP_SCULPT_SETT_FLAG_WEIGHT_MODE;
if ((gset->brushtype < 0) || (gset->brushtype >= GP_SCULPT_TYPE_WEIGHT)) {
gset->brushtype = GP_SCULPT_TYPE_PUSH;
}
break;
- case OB_MODE_GPENCIL_WEIGHT:
+ case OB_MODE_WEIGHT_GPENCIL:
gset->flag |= GP_SCULPT_SETT_FLAG_WEIGHT_MODE;
if ((gset->weighttype < GP_SCULPT_TYPE_WEIGHT) || (gset->weighttype >= GP_SCULPT_TYPE_MAX)) {
gset->weighttype = GP_SCULPT_TYPE_WEIGHT;
@@ -1730,34 +1730,34 @@ void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode)
}
switch (newmode) {
- case OB_MODE_GPENCIL_EDIT:
+ case OB_MODE_EDIT_GPENCIL:
gpd->flag |= GP_DATA_STROKE_EDITMODE;
gpd->flag &= ~GP_DATA_STROKE_PAINTMODE;
gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE;
gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE;
ED_gpencil_toggle_brush_cursor(C, false, NULL);
break;
- case OB_MODE_GPENCIL_PAINT:
+ case OB_MODE_PAINT_GPENCIL:
gpd->flag &= ~GP_DATA_STROKE_EDITMODE;
gpd->flag |= GP_DATA_STROKE_PAINTMODE;
gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE;
gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE;
ED_gpencil_toggle_brush_cursor(C, true, NULL);
break;
- case OB_MODE_GPENCIL_SCULPT:
+ case OB_MODE_SCULPT_GPENCIL:
gpd->flag &= ~GP_DATA_STROKE_EDITMODE;
gpd->flag &= ~GP_DATA_STROKE_PAINTMODE;
gpd->flag |= GP_DATA_STROKE_SCULPTMODE;
gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE;
- gpencil_verify_brush_type(C, OB_MODE_GPENCIL_SCULPT);
+ gpencil_verify_brush_type(C, OB_MODE_SCULPT_GPENCIL);
ED_gpencil_toggle_brush_cursor(C, true, NULL);
break;
- case OB_MODE_GPENCIL_WEIGHT:
+ case OB_MODE_WEIGHT_GPENCIL:
gpd->flag &= ~GP_DATA_STROKE_EDITMODE;
gpd->flag &= ~GP_DATA_STROKE_PAINTMODE;
gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE;
gpd->flag |= GP_DATA_STROKE_WEIGHTMODE;
- gpencil_verify_brush_type(C, OB_MODE_GPENCIL_WEIGHT);
+ gpencil_verify_brush_type(C, OB_MODE_WEIGHT_GPENCIL);
ED_gpencil_toggle_brush_cursor(C, true, NULL);
break;
default:
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 36624f475ce..f371bae77c0 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1719,7 +1719,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
/* reset the icon */
if ((ob != NULL) &&
- (ob->mode & OB_MODE_GPENCIL_PAINT) &&
+ (ob->mode & OB_MODE_PAINT_GPENCIL) &&
(br->gpencil_settings != NULL))
{
switch (br->gpencil_settings->icon_id) {
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 676d44e3ea4..59ce42c50a5 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1615,8 +1615,8 @@ static const EnumPropertyItem *object_mode_set_itemsf(
(input->value == OB_MODE_PARTICLE_EDIT && use_mode_particle_edit) ||
(ELEM(input->value, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT,
OB_MODE_WEIGHT_PAINT, OB_MODE_TEXTURE_PAINT) && (ob->type == OB_MESH)) ||
- (ELEM(input->value, OB_MODE_GPENCIL_EDIT, OB_MODE_GPENCIL_PAINT,
- OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT) && (ob->type == OB_GPENCIL)) ||
+ (ELEM(input->value, OB_MODE_EDIT_GPENCIL, OB_MODE_PAINT_GPENCIL,
+ OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL) && (ob->type == OB_GPENCIL)) ||
(input->value == OB_MODE_OBJECT))
{
RNA_enum_item_add(&item, &totitem, input);
@@ -1674,7 +1674,7 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
/* by default the operator assume is a mesh, but if gp object change mode */
if ((ob != NULL) && (ob->type == OB_GPENCIL) && (mode == OB_MODE_EDIT)) {
- mode = OB_MODE_GPENCIL_EDIT;
+ mode = OB_MODE_EDIT_GPENCIL;
}
if (!ob || !ED_object_mode_compat_test(ob, mode))
diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c
index 4c625a4d33c..771bbc5c18c 100644
--- a/source/blender/editors/object/object_modes.c
+++ b/source/blender/editors/object/object_modes.c
@@ -74,13 +74,13 @@ static const char *object_mode_op_string(eObjectMode mode)
return "PARTICLE_OT_particle_edit_toggle";
if (mode == OB_MODE_POSE)
return "OBJECT_OT_posemode_toggle";
- if (mode == OB_MODE_GPENCIL_EDIT)
+ if (mode == OB_MODE_EDIT_GPENCIL)
return "GPENCIL_OT_editmode_toggle";
- if (mode == OB_MODE_GPENCIL_PAINT)
+ if (mode == OB_MODE_PAINT_GPENCIL)
return "GPENCIL_OT_paintmode_toggle";
- if (mode == OB_MODE_GPENCIL_SCULPT)
+ if (mode == OB_MODE_SCULPT_GPENCIL)
return "GPENCIL_OT_sculptmode_toggle";
- if (mode == OB_MODE_GPENCIL_WEIGHT)
+ if (mode == OB_MODE_WEIGHT_GPENCIL)
return "GPENCIL_OT_weightmode_toggle";
return NULL;
}
@@ -119,8 +119,8 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
return true;
break;
case OB_GPENCIL:
- if (mode & (OB_MODE_EDIT | OB_MODE_GPENCIL_EDIT | OB_MODE_GPENCIL_PAINT |
- OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT))
+ if (mode & (OB_MODE_EDIT | OB_MODE_EDIT_GPENCIL | OB_MODE_PAINT_GPENCIL |
+ OB_MODE_SCULPT_GPENCIL | OB_MODE_WEIGHT_GPENCIL))
{
return true;
}
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 11565d665b1..ed40a22bd78 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -118,7 +118,7 @@ static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op))
br = BKE_brush_copy(bmain, br);
}
else {
- br = BKE_brush_add(bmain, "Brush", OB_MODE_GPENCIL_PAINT);
+ br = BKE_brush_add(bmain, "Brush", OB_MODE_PAINT_GPENCIL);
id_us_min(&br->id); /* fake user only */
}
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 4520f837a0a..c9ba5722572 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -258,13 +258,13 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar)
case CTX_MODE_OBJECT:
ARRAY_SET_ITEMS(contexts, ".objectmode");
break;
- case CTX_MODE_GPENCIL_PAINT:
+ case CTX_MODE_PAINT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_paint");
break;
- case CTX_MODE_GPENCIL_SCULPT:
+ case CTX_MODE_SCULPT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt");
break;
- case CTX_MODE_GPENCIL_WEIGHT:
+ case CTX_MODE_WEIGHT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_weight");
break;
}
@@ -290,16 +290,16 @@ static void buttons_main_region_layout_tool(const bContext *C, ARegion *ar)
* workspace->tools_space_type because this value is not available
*/
switch (mode) {
- case CTX_MODE_GPENCIL_PAINT:
+ case CTX_MODE_PAINT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_paint");
break;
- case CTX_MODE_GPENCIL_SCULPT:
+ case CTX_MODE_SCULPT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_sculpt");
break;
- case CTX_MODE_GPENCIL_WEIGHT:
+ case CTX_MODE_WEIGHT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_weight");
break;
- case CTX_MODE_GPENCIL_EDIT:
+ case CTX_MODE_EDIT_GPENCIL:
ARRAY_SET_ITEMS(contexts, ".greasepencil_edit");
break;
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 08d8d168e81..c976803065e 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1849,9 +1849,9 @@ static bool ed_object_select_pick(
{
/* set cursor */
if (ELEM(basact->object->mode,
- OB_MODE_GPENCIL_PAINT,
- OB_MODE_GPENCIL_SCULPT,
- OB_MODE_GPENCIL_WEIGHT))
+ OB_MODE_PAINT_GPENCIL,
+ OB_MODE_SCULPT_GPENCIL,
+ OB_MODE_WEIGHT_GPENCIL))
{
ED_gpencil_toggle_brush_cursor(C, true, NULL);
}
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 8b4292dedbd..dd459749029 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -181,7 +181,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname, ReportList
Object *obact = CTX_data_active_object(C);
if (obact && (obact->type == OB_GPENCIL)) {
/* set cursor */
- if (ELEM(obact->mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT)) {
+ if (ELEM(obact->mode, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT_GPENCIL, OB_MODE_WEIGHT_GPENCIL)) {
ED_gpencil_toggle_brush_cursor(C, true, NULL);
}
else {