diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
9 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index b4bd425b038..cff88be70cb 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2986,10 +2986,10 @@ bool draw_armature( draw_ghost_poses(eval_ctx, scene, sl, v3d, ar, base); } if ((dflag & DRAW_SCENESET) == 0) { - if (ob == OBACT_NEW(sl)) + if (ob == OBACT(sl)) arm->flag |= ARM_POSEMODE; - else if (OBACT_NEW(sl) && (OBACT_NEW(sl)->mode & OB_MODE_WEIGHT_PAINT)) { - if (ob == modifiers_isDeformedByArmature(OBACT_NEW(sl))) + else if (OBACT(sl) && (OBACT(sl)->mode & OB_MODE_WEIGHT_PAINT)) { + if (ob == modifiers_isDeformedByArmature(OBACT(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 b2fdc62af3c..ff62578583f 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -320,7 +320,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(sl) && (ob && ob->mode & OB_MODE_WEIGHT_PAINT)) + if (ob == OBACT(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( 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(sl)); + const bool is_obact = (ob == OBACT(sl)); int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0; if (!dm) @@ -4728,7 +4728,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(sl)); + const bool is_obact = (ob == OBACT(sl)); int draw_flags = (is_obact && BKE_paint_select_face_test(ob)) ? DRAW_FACE_SELECT : 0; if (!dm) @@ -4849,7 +4849,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(sl))); + draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl))); } if (draw_glsl_material(scene, sl, ob, v3d, dt) && !(draw_flags & DRAW_MODIFIERS_PREVIEW)) { @@ -4916,7 +4916,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(sl))); + draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl))); } /* materials arent compatible with vertex colors */ @@ -4941,7 +4941,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(sl))); + draw_mesh_object_outline_new(v3d, rv3d, ob, me, (ob == OBACT(sl))); } glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW); @@ -8578,7 +8578,7 @@ void draw_object( 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(sl)); + const bool is_obact = (ob == OBACT(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 d5772a8d592..ac808487dd2 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(sl); + Object *ob = OBACT(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(sl); + Object *ob = OBACT(sl); switch (event) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 13d5f590177..1e273462d52 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1316,7 +1316,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(sl); + Object *ob = OBACT(sl); /* don't draw cursor in paint modes, but with a few exceptions */ if (ob && ob->mode & OB_MODE_ALL_PAINT) { @@ -1847,7 +1847,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(sl); + Object *ob = OBACT(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 e242b2eef33..065e86bb561 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -1285,12 +1285,12 @@ void ED_view3d_draw_select_loop( UI_SetTheme(SPACE_VIEW3D, RGN_TYPE_WINDOW); if (vc->obedit && vc->obedit->type == OB_MBALL) { - draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag); + draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag); } else if ((vc->obedit && vc->obedit->type == OB_ARMATURE)) { /* if not drawing sketch, draw bones */ if (!BDR_drawSketchNames(vc)) { - draw_object(eval_ctx, scene, sl, ar, v3d, BASACT_NEW(sl), dflag); + draw_object(eval_ctx, scene, sl, ar, v3d, BASACT(sl), dflag); } } else { @@ -2070,7 +2070,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(scene_layer); + Object *ob = OBACT(scene_layer); 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 15ac7ec1174..dc6d6382d37 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -625,7 +625,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(sl); + Object *ob_act = OBACT(sl); if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) && /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */ @@ -667,8 +667,8 @@ 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(sl); base; base = base->next) { - if (TESTBASE_NEW(base)) { + for (base = FIRSTBASE(sl); base; base = base->next) { + if (TESTBASE(base)) { /* use the boundbox if we can */ Object *ob = base->object; @@ -3015,7 +3015,7 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in } for (base = sl->object_bases.first; base; base = base->next) { - if (BASE_VISIBLE_NEW(base)) { + if (BASE_VISIBLE(base)) { changed = true; if (skip_camera && base->object == v3d->camera) { @@ -3080,7 +3080,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(sl); + Object *ob = OBACT(sl); Object *obedit = CTX_data_edit_object(C); float min[3], max[3]; bool ok = false, ok_dist = true; @@ -3100,7 +3100,7 @@ static int viewselected_exec(bContext *C, wmOperator *op) /* this is weak code this way, we should make a generic active/selection callback interface once... */ Base *base; for (base = sl->object_bases.first; base; base = base->next) { - if (TESTBASELIB_NEW(base)) { + if (TESTBASELIB(base)) { if (base->object->type == OB_ARMATURE) if (base->object->mode & OB_MODE_POSE) break; @@ -3148,8 +3148,8 @@ static int viewselected_exec(bContext *C, wmOperator *op) } else { Base *base; - for (base = FIRSTBASE_NEW(sl); base; base = base->next) { - if (TESTBASE_NEW(base)) { + for (base = FIRSTBASE(sl); base; base = base->next) { + if (TESTBASE(base)) { if (skip_camera && base->object == v3d->camera) { continue; @@ -3950,7 +3950,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op) /* lastview - */ if (rv3d->persp != RV3D_CAMOB) { - Object *ob = OBACT_NEW(scene_layer); + Object *ob = OBACT(scene_layer); 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 d8599610197..4f322b8519d 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(sl); + Object *ob = OBACT(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 7d4a8820c9a..e8a1b5cea89 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_camera.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_camera.c @@ -295,7 +295,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(sl)) { + if (scene->camera != OBACT(sl)) { return false; } } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 82147f7af4c..9a058598580 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -382,7 +382,7 @@ static void object_deselect_all_visible(SceneLayer *sl) Base *base; for (base = sl->object_bases.first; base; base = base->next) { - if (BASE_SELECTABLE_NEW(base)) { + if (BASE_SELECTABLE(base)) { ED_object_base_select(base, BA_DESELECT); } } @@ -397,7 +397,7 @@ static void do_lasso_select_objects(ViewContext *vc, const int mcords[][2], cons object_deselect_all_visible(vc->scene_layer); for (base = vc->scene_layer->object_bases.first; base; base = base->next) { - if (BASE_SELECTABLE_NEW(base)) { /* use this to avoid un-needed lasso lookups */ + if (BASE_SELECTABLE(base)) { /* use this to avoid un-needed lasso lookups */ if (ED_view3d_project_base(vc->ar, base) == V3D_PROJ_RET_OK) { if (BLI_lasso_is_point_inside(mcords, moves, base->sx, base->sy, IS_CLIPPED)) { @@ -1295,8 +1295,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(sl) && (BASACT_NEW(sl)->flag & BASE_SELECTED) && hits > 1) { - notcol = BASACT_NEW(sl)->object->select_color; + if (BASACT(sl) && (BASACT(sl)->flag & BASE_SELECTED) && hits > 1) { + notcol = BASACT(sl)->object->select_color; } for (a = 0; a < hits; a++) { @@ -1307,9 +1307,9 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, unsigned int *buffer, int } } - base = FIRSTBASE_NEW(sl); + base = FIRSTBASE(sl); while (base) { - if (BASE_SELECTABLE_NEW(base)) { + if (BASE_SELECTABLE(base)) { if (base->object->select_color == selcol) break; } base = base->next; @@ -1324,11 +1324,11 @@ 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(sl); + if (base == NULL) base = FIRSTBASE(sl); if (base == startbase) break; } - if (BASE_SELECTABLE_NEW(base)) { + if (BASE_SELECTABLE(base)) { for (a = 0; a < hits; a++) { if (has_bones) { /* skip non-bone objects */ @@ -1347,7 +1347,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(sl); + if (base == NULL) base = FIRSTBASE(sl); if (base == startbase) break; } } @@ -1429,8 +1429,8 @@ static bool ed_object_select_pick( } /* always start list from basact in wire mode */ - startbase = FIRSTBASE_NEW(sl); - if (BASACT_NEW(sl) && BASACT_NEW(sl)->next) startbase = BASACT_NEW(sl)->next; + startbase = FIRSTBASE(sl); + if (BASACT(sl) && BASACT(sl)->next) startbase = BASACT(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 */ @@ -1443,13 +1443,13 @@ static bool ed_object_select_pick( else { base = startbase; while (base) { - if (BASE_SELECTABLE_NEW(base)) { + if (BASE_SELECTABLE(base)) { float screen_co[2]; if (ED_view3d_project_float_global(ar, base->object->obmat[3], screen_co, 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(sl)) dist_temp += 10.0f; + if (base == BASACT(sl)) dist_temp += 10.0f; if (dist_temp < dist) { dist = dist_temp; basact = base; @@ -1458,7 +1458,7 @@ static bool ed_object_select_pick( } base = base->next; - if (base == NULL) base = FIRSTBASE_NEW(sl); + if (base == NULL) base = FIRSTBASE(sl); if (base == startbase) break; } } @@ -1488,7 +1488,7 @@ static bool ed_object_select_pick( if (has_bones && basact) { if (basact->object->type == OB_CAMERA) { - if (BASACT_NEW(sl) == basact) { + if (BASACT(sl) == basact) { int i, hitresult; bool changed = false; @@ -1558,14 +1558,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(sl) && (BASACT_NEW(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) { + if (BASACT(sl) && (BASACT(sl)->object->mode & OB_MODE_WEIGHT_PAINT)) { /* prevent activating */ basact = NULL; } } /* prevent bone selecting to pass on to object selecting */ - if (basact == BASACT_NEW(sl)) + if (basact == BASACT(sl)) basact = NULL; } } @@ -1581,9 +1581,9 @@ static bool ed_object_select_pick( ED_object_base_select(basact, BA_SELECT); } /* also prevent making it active on mouse selection */ - else if (BASE_SELECTABLE_NEW(basact)) { + else if (BASE_SELECTABLE(basact)) { - oldbasact = BASACT_NEW(sl); + oldbasact = BASACT(sl); if (extend) { ED_object_base_select(basact, BA_SELECT); @@ -2095,7 +2095,7 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, b * we can be sure the order remains the same between both. */ for (base = vc->scene_layer->object_bases.first; base && hits; base = base->next) { - if (BASE_SELECTABLE_NEW(base)) { + if (BASE_SELECTABLE(base)) { while (base->object->select_color == (*col & 0xFFFF)) { /* we got an object */ if (*col & 0xFFFF0000) { /* we got a bone */ bone = get_indexed_bone(base->object, *col & ~(BONESEL_ANY)); @@ -2837,8 +2837,8 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m Base *base; - for (base = FIRSTBASE_NEW(sl); base; base = base->next) { - if (BASE_SELECTABLE_NEW(base) && ((base->flag & BASE_SELECTED) != select_flag)) { + for (base = FIRSTBASE(sl); base; base = base->next) { + if (BASE_SELECTABLE(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, V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == V3D_PROJ_RET_OK) |