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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-08-15 16:59:38 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-08-15 16:59:38 +0300
commit77497175fa1f2f3aacf4ab966df9d7223d4034cc (patch)
tree34e143b88d2f9857e6926a1d156b8d8c3243d7b2 /source/blender/editors/space_view3d
parent90d80ddaa28908048e428fd08c4c771c015a0d66 (diff)
Cleanup/refactor: no new general arg-less macros enforcing var names please!
We do have an history of those pieces of evil in our code, would be nice to get fully rid of it, but at the very least let's not add more of them in new code. :)
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c6
-rw-r--r--source/blender/editors/space_view3d/drawobject.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_manipulator_camera.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c28
9 files changed, 38 insertions, 38 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 191dfed01bf..b4e968226f4 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -2982,10 +2982,10 @@ bool draw_armature(const bContext *C, Scene *scene, SceneLayer *sl, View3D *v3d,
draw_ghost_poses(C, scene, sl, v3d, ar, base);
}
if ((dflag & DRAW_SCENESET) == 0) {
- if (ob == OBACT_NEW)
+ if (ob == OBACT_NEW(sl))
arm->flag |= ARM_POSEMODE;
- else if (OBACT_NEW && (OBACT_NEW->mode & OB_MODE_WEIGHT_PAINT)) {
- if (ob == modifiers_isDeformedByArmature(OBACT_NEW))
+ else if (OBACT_NEW(sl) && (OBACT_NEW(sl)->mode & OB_MODE_WEIGHT_PAINT)) {
+ if (ob == modifiers_isDeformedByArmature(OBACT_NEW(sl)))
arm->flag |= ARM_POSEMODE;
}
draw_pose_paths(scene, v3d, ar, ob);
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 166a5cbbd17..1490ad6288f 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -318,7 +318,7 @@ bool draw_glsl_material(Scene *scene, SceneLayer *sl, Object *ob, View3D *v3d, c
return false;
if (!check_object_draw_texture(scene, v3d, dt))
return false;
- if (ob == OBACT_NEW && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
+ if (ob == OBACT_NEW(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT))
return false;
if (v3d->flag2 & V3D_SHOW_SOLID_MATCAP)
@@ -4312,7 +4312,7 @@ static void draw_mesh_fancy(EvaluationContext *eval_ctx, Scene *scene, SceneLaye
eWireDrawMode draw_wire = OBDRAW_WIRE_OFF;
bool /* no_verts,*/ no_edges, no_faces;
DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
- const bool is_obact = (ob == OBACT_NEW);
+ const bool is_obact = (ob == OBACT_NEW(sl));
int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
if (!dm)
@@ -4730,7 +4730,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
eWireDrawMode draw_wire = OBDRAW_WIRE_OFF; /* could be bool draw_wire_overlay */
bool no_edges, no_faces;
DerivedMesh *dm = mesh_get_derived_final(eval_ctx, scene, ob, scene->customdata_mask);
- const bool is_obact = (ob == OBACT_NEW);
+ const bool is_obact = (ob == OBACT_NEW(sl));
int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0;
if (!dm)
@@ -4851,7 +4851,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
!(G.f & G_PICKSEL || (draw_flags & DRAW_FACE_SELECT)) &&
(draw_wire == OBDRAW_WIRE_OFF))
{
- draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW));
+ draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
}
if (draw_glsl_material(scene, sl, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) {
@@ -4918,7 +4918,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
(draw_wire == OBDRAW_WIRE_OFF) &&
(ob->sculpt == NULL))
{
- draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW));
+ draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
}
/* materials arent compatible with vertex colors */
@@ -4943,7 +4943,7 @@ static void draw_mesh_fancy_new(EvaluationContext *eval_ctx, Scene *scene, Scene
(ob->sculpt == NULL))
{
/* TODO: move this into a separate pass */
- draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW));
+ draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT_NEW(sl)));
}
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
@@ -8575,7 +8575,7 @@ void draw_object(const bContext *C, Scene *scene, SceneLayer *sl, ARegion *ar, V
unsigned char _ob_wire_col[4]; /* dont initialize this */
const unsigned char *ob_wire_col = NULL; /* dont initialize this, use NULL crashes as a way to find invalid use */
bool zbufoff = false, is_paint = false, empty_object = false;
- const bool is_obact = (ob == OBACT_NEW);
+ const bool is_obact = (ob == OBACT_NEW(sl));
const bool render_override = (v3d->flag2 & V3D_RENDER_OVERRIDE) != 0;
const bool is_picking = (G.f & G_PICKSEL) != 0;
const bool has_particles = (ob->particlesystem.first != NULL);
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index a8e5e1ad536..ddb87d96ec1 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -788,7 +788,7 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
{
SceneLayer *sl = CTX_data_scene_layer(C);
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
if (ob && (BKE_object_is_in_editmode_vgroup(ob) ||
BKE_object_is_in_wpaint_select_vert(ob)))
{
@@ -1099,7 +1099,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
{
SceneLayer *sl = CTX_data_scene_layer(C);
View3D *v3d = CTX_wm_view3d(C);
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
switch (event) {
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 04cc77ddd9c..037e3b26b9f 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1313,7 +1313,7 @@ float ED_view3d_grid_scale(Scene *scene, View3D *v3d, const char **grid_unit)
static bool is_cursor_visible(Scene *scene, SceneLayer *sl)
{
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
/* don't draw cursor in paint modes, but with a few exceptions */
if (ob && ob->mode & OB_MODE_ALL_PAINT) {
@@ -1844,7 +1844,7 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar, const int offset)
if (U.uiflag & USER_DRAWVIEWINFO) {
SceneLayer *sl = CTX_data_scene_layer(C);
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
draw_selected_name(scene, ob, &rect);
}
#if 0 /* TODO */
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index fe388ef8cdd..c458539be3e 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -1290,12 +1290,12 @@ void ED_view3d_draw_select_loop(
const short dflag = DRAW_PICKING | DRAW_CONSTCOLOR;
if (vc->obedit && vc->obedit->type == OB_MBALL) {
- draw_object(C, scene, sl, ar, v3d, BASACT_NEW, dflag);
+ draw_object(C, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
}
else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) {
/* if not drawing sketch, draw bones */
if (!BDR_drawSketchNames(vc)) {
- draw_object(C, scene, sl, ar, v3d, BASACT_NEW, dflag);
+ draw_object(C, scene, sl, ar, v3d, BASACT_NEW(sl), dflag);
}
}
else {
@@ -2054,7 +2054,7 @@ static void view3d_main_region_draw_info(const bContext *C, Scene *scene,
draw_view_icon(rv3d, &rect);
if (U.uiflag & USER_DRAWVIEWINFO) {
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
VP_legacy_draw_selected_name(scene, ob, &rect);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index eb7da6ca544..eef0710b59c 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -623,7 +623,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
Scene *scene = CTX_data_scene(C);
SceneLayer *sl = CTX_data_scene_layer(C);
- Object *ob_act = OBACT_NEW;
+ Object *ob_act = OBACT_NEW(sl);
if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) &&
/* with weight-paint + pose-mode, fall through to using calculateTransformCenter */
@@ -665,7 +665,7 @@ static bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3])
float select_center[3];
zero_v3(select_center);
- for (base = FIRSTBASE_NEW; base; base = base->next) {
+ for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (TESTBASE_NEW(base)) {
/* use the boundbox if we can */
Object *ob = base->object;
@@ -3071,7 +3071,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
const bool is_gp_edit = ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
const bool is_face_map = ((is_gp_edit == false) && ar->manipulator_map &&
WM_manipulatormap_is_any_selected(ar->manipulator_map));
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
Object *obedit = CTX_data_edit_object(C);
float min[3], max[3];
bool ok = false, ok_dist = true;
@@ -3139,7 +3139,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
}
else {
Base *base;
- for (base = FIRSTBASE_NEW; base; base = base->next) {
+ for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (TESTBASE_NEW(base)) {
if (skip_camera && base->object == v3d->camera) {
@@ -3937,7 +3937,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
/* lastview - */
if (rv3d->persp != RV3D_CAMOB) {
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
if (!rv3d->smooth_timer) {
/* store settings of current view before allowing overwriting with camera view
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index bb86b0a991f..b6deabdb447 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -283,7 +283,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
SceneLayer *sl = CTX_data_scene_layer(C);
ToolSettings *ts = CTX_data_tool_settings(C);
PointerRNA v3dptr, toolsptr, sceneptr;
- Object *ob = OBACT_NEW;
+ Object *ob = OBACT_NEW(sl);
Object *obedit = CTX_data_edit_object(C);
bGPdata *gpd = CTX_data_gpencil_data(C);
uiBlock *block;
diff --git a/source/blender/editors/space_view3d/view3d_manipulator_camera.c b/source/blender/editors/space_view3d/view3d_manipulator_camera.c
index 10f1684b6cb..a1ad45ae6b6 100644
--- a/source/blender/editors/space_view3d/view3d_manipulator_camera.c
+++ b/source/blender/editors/space_view3d/view3d_manipulator_camera.c
@@ -306,7 +306,7 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmManipulatorGroupTy
* We could change the rules for when to show. */
{
SceneLayer *sl = CTX_data_scene_layer(C);
- if (scene->camera != OBACT_NEW) {
+ if (scene->camera != OBACT_NEW(sl)) {
return false;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index d49262bc5d7..526d0b979e2 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1286,8 +1286,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
}
else {
/* only exclude active object when it is selected... */
- if (BASACT_NEW && (BASACT_NEW->flag & BASE_SELECTED) && hits > 1) {
- notcol = BASACT_NEW->object->select_color;
+ if (BASACT_NEW(sl) && (BASACT_NEW(sl)->flag & BASE_SELECTED) && hits > 1) {
+ notcol = BASACT_NEW(sl)->object->select_color;
}
for (a = 0; a < hits; a++) {
@@ -1298,7 +1298,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
}
}
- base = FIRSTBASE_NEW;
+ base = FIRSTBASE_NEW(sl);
while (base) {
if (BASE_SELECTABLE_NEW(base)) {
if (base->object->select_color == selcol) break;
@@ -1315,7 +1315,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
* with an un-selectable choice */
if ((base->flag & BASE_SELECTABLED) == 0) {
base = base->next;
- if (base == NULL) base = FIRSTBASE_NEW;
+ if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == startbase) break;
}
@@ -1338,7 +1338,7 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int
if (basact) break;
base = base->next;
- if (base == NULL) base = FIRSTBASE_NEW;
+ if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == startbase) break;
}
}
@@ -1415,8 +1415,8 @@ static bool ed_object_select_pick(
}
/* always start list from basact in wire mode */
- startbase = FIRSTBASE_NEW;
- if (BASACT_NEW && BASACT_NEW->next) startbase = BASACT_NEW->next;
+ startbase = FIRSTBASE_NEW(sl);
+ if (BASACT_NEW(sl) && BASACT_NEW(sl)->next) startbase = BASACT_NEW(sl)->next;
/* This block uses the control key to make the object selected by its center point rather than its contents */
/* in editmode do not activate */
@@ -1435,7 +1435,7 @@ static bool ed_object_select_pick(
V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK)
{
float dist_temp = len_manhattan_v2v2(mval_fl, screen_co);
- if (base == BASACT_NEW) dist_temp += 10.0f;
+ if (base == BASACT_NEW(sl)) dist_temp += 10.0f;
if (dist_temp < dist) {
dist = dist_temp;
basact = base;
@@ -1444,7 +1444,7 @@ static bool ed_object_select_pick(
}
base = base->next;
- if (base == NULL) base = FIRSTBASE_NEW;
+ if (base == NULL) base = FIRSTBASE_NEW(sl);
if (base == startbase) break;
}
}
@@ -1474,7 +1474,7 @@ static bool ed_object_select_pick(
if (has_bones && basact) {
if (basact->object->type == OB_CAMERA) {
- if (BASACT_NEW == basact) {
+ if (BASACT_NEW(sl) == basact) {
int i, hitresult;
bool changed = false;
@@ -1544,14 +1544,14 @@ static bool ed_object_select_pick(
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
/* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
- if (BASACT_NEW && (BASACT_NEW->object->mode & OB_MODE_WEIGHT_PAINT)) {
+ if (BASACT_NEW(sl) && (BASACT_NEW(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) {
/* prevent activating */
basact = NULL;
}
}
/* prevent bone selecting to pass on to object selecting */
- if (basact == BASACT_NEW)
+ if (basact == BASACT_NEW(sl))
basact = NULL;
}
}
@@ -1569,7 +1569,7 @@ static bool ed_object_select_pick(
/* also prevent making it active on mouse selection */
else if (BASE_SELECTABLE_NEW(basact)) {
- oldbasact = BASACT_NEW;
+ oldbasact = BASACT_NEW(sl);
if (extend) {
ED_object_base_select(basact, BA_SELECT);
@@ -2811,7 +2811,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
Base *base;
- for (base = FIRSTBASE_NEW; base; base = base->next) {
+ for (base = FIRSTBASE_NEW(sl); base; base = base->next) {
if (BASE_SELECTABLE_NEW(base) && ((base->flag & BASE_SELECTED) != select_flag)) {
float screen_co[2];
if (ED_view3d_project_float_global(vc->ar, base->object->obmat[3], screen_co,