diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
7 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index a8df5c02881..791ece14cb9 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -987,6 +987,11 @@ static void draw_mesh_textured_old(Scene *scene, View3D *v3d, RegionView3D *rv3d dm_draw_flag |= DM_DRAW_USE_COLORS; } } + else { + if ((ob->mode & OB_MODE_TEXTURE_PAINT) == 0) { + dm_draw_flag |= DM_DRAW_USE_COLORS; + } + } userData.mpoly = DM_get_poly_data_layer(dm, CD_MPOLY); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 3b1ce5f8ab0..9699b2d05d0 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1399,8 +1399,8 @@ static void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, float blend = z_abs * (1.0f - pow2f(la->spotblend)); /* hide line if it is zero size or overlaps with outer border, - * previously it adjusted to always to show it but that seems - * confusing because it doesn't show the actual blend size */ + * previously it adjusted to always to show it but that seems + * confusing because it doesn't show the actual blend size */ if (blend != 0.0f && blend != z_abs) { circ(0.0f, 0.0f, blend); } @@ -6221,7 +6221,7 @@ static void draw_object_wire_color(Scene *scene, Base *base, unsigned char r_ob_ } else { /* Sets the 'colindex' */ - if (ob->id.lib) { + if (ID_IS_LINKED_DATABLOCK(ob)) { colindex = (base->flag & (SELECT + BA_WAS_SEL)) ? 2 : 1; } /* Sets the 'theme_id' or fallback to wire */ @@ -6903,7 +6903,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short !(G.f & G_RENDER_OGL)) { /* check > 0 otherwise grease pencil can draw into the circle select which is annoying. */ - drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ob->id.lib || ob->id.us > 1); + drawcentercircle(v3d, rv3d, ob->obmat[3], do_draw_center, ID_IS_LINKED_DATABLOCK(ob) || ob->id.us > 1); } } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index dcab05c80d6..3fa95315eba 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2594,6 +2594,7 @@ static void gpu_update_lamps_shadows_world(Scene *scene, View3D *v3d) GPU_mist_update_values(world->mistype, world->miststa, world->mistdist, world->misi, &world->horr); GPU_horizon_update_color(&world->horr); GPU_ambient_update_color(&world->ambr); + GPU_zenith_update_color(&world->zenr); } } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index afbf791b33a..2b0bd7690e2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -109,7 +109,7 @@ static bool view3d_operator_offset_lock_check(bContext *C, wmOperator *op) bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d) { return ((v3d->camera) && - (v3d->camera->id.lib == NULL) && + (!ID_IS_LINKED_DATABLOCK(v3d->camera)) && (v3d->flag2 & V3D_LOCK_CAMERA) && (rv3d->persp == RV3D_CAMOB)); } @@ -3430,12 +3430,8 @@ static int render_border_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL); } - /* drawing a border surrounding the entire camera view switches off border rendering - * or the border covers no pixels */ - if ((border.xmin <= 0.0f && border.xmax >= 1.0f && - border.ymin <= 0.0f && border.ymax >= 1.0f) || - (border.xmin == border.xmax || border.ymin == border.ymax)) - { + /* drawing a border outside the camera view switches off border rendering */ + if ((border.xmin == border.xmax || border.ymin == border.ymax)) { if (rv3d->persp == RV3D_CAMOB) scene->r.mode &= ~R_BORDER; else diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 8418cf0980c..31377d0fce8 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -346,7 +346,7 @@ static bool initFlyInfo(bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent fly->rv3d->persp = RV3D_PERSP; } - if (fly->rv3d->persp == RV3D_CAMOB && fly->v3d->camera->id.lib) { + if (fly->rv3d->persp == RV3D_CAMOB && ID_IS_LINKED_DATABLOCK(fly->v3d->camera)) { BKE_report(op->reports, RPT_ERROR, "Cannot fly a camera from an external library"); return false; } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index c35646b9e92..bc7a9989c72 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -221,7 +221,7 @@ void ED_view3d_smooth_view_ex( copy_v3_v3(sms.dyn_ofs, sview->dyn_ofs); sms.use_dyn_ofs = true; - /* calcualte the final destination offset */ + /* calculate the final destination offset */ view3d_orbit_apply_dyn_ofs(sms.dst.ofs, sms.src.ofs, sms.src.quat, sms.dst.quat, sms.dyn_ofs); } @@ -507,7 +507,7 @@ static int view3d_camera_to_view_poll(bContext *C) if (ED_view3d_context_user_region(C, &v3d, &ar)) { RegionView3D *rv3d = ar->regiondata; - if (v3d && v3d->camera && v3d->camera->id.lib == NULL) { + if (v3d && v3d->camera && !ID_IS_LINKED_DATABLOCK(v3d->camera)) { if (rv3d && (rv3d->viewlock & RV3D_LOCKED) == 0) { if (rv3d->persp != RV3D_CAMOB) { return 1; diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 384da277612..c9e4bb301b8 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -505,7 +505,7 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op) walk->rv3d->persp = RV3D_PERSP; } - if (walk->rv3d->persp == RV3D_CAMOB && walk->v3d->camera->id.lib) { + if (walk->rv3d->persp == RV3D_CAMOB && ID_IS_LINKED_DATABLOCK(walk->v3d->camera)) { BKE_report(op->reports, RPT_ERROR, "Cannot navigate a camera from an external library"); return false; } @@ -924,8 +924,7 @@ static void walkEvent(bContext *C, wmOperator *op, WalkInfo *walk, const wmEvent copy_v3_v3(teleport->origin, walk->rv3d->viewinv[3]); /* stop the camera from a distance (camera height) */ - normalize_v3(nor); - mul_v3_fl(nor, walk->view_height); + normalize_v3_length(nor, walk->view_height); add_v3_v3(loc, nor); sub_v3_v3v3(teleport->direction, loc, teleport->origin); |