Merge branch 'master' into blender2.8
This commit is contained in:
commit
9342f55d12
|
@ -174,7 +174,7 @@ void *get_nearest_bone(bContext *C, const int xy[2], bool findunsel)
|
|||
short hits;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
// rect.xmin = ... mouseco!
|
||||
rect.xmin = rect.xmax = xy[0];
|
||||
|
@ -491,7 +491,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d
|
|||
int selmask;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (BIF_sk_selectStroke(C, mval, extend)) {
|
||||
return true;
|
||||
|
|
|
@ -1932,7 +1932,7 @@ static bool sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], c
|
|||
short hits;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
BLI_rcti_init_pt_radius(&rect, mval, 5);
|
||||
|
||||
|
|
|
@ -4312,7 +4312,7 @@ bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], bool extend,
|
|||
short hand;
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
location[0] = mval[0];
|
||||
location[1] = mval[1];
|
||||
|
@ -4988,7 +4988,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
{
|
||||
ViewContext vc;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (vc.rv3d && !RNA_struct_property_is_set(op->ptr, "location")) {
|
||||
Curve *cu;
|
||||
|
|
|
@ -608,7 +608,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke)
|
|||
cdd->depsgraph = CTX_data_depsgraph(C);
|
||||
|
||||
if (is_invoke) {
|
||||
view3d_set_viewcontext(C, &cdd->vc);
|
||||
ED_view3d_viewcontext_init(C, &cdd->vc);
|
||||
if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) {
|
||||
MEM_freeN(cdd);
|
||||
BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport");
|
||||
|
|
|
@ -559,7 +559,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent
|
|||
const bool select = !RNA_boolean_get(op->ptr, "deselect");
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu, &bezt, &bp, NULL)) {
|
||||
return OPERATOR_CANCELLED;
|
||||
|
@ -1677,7 +1677,7 @@ static int edcu_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
|
|||
}
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu_dst, &bezt_dst, &bp_dst, NULL)) {
|
||||
return OPERATOR_PASS_THROUGH;
|
||||
|
|
|
@ -1857,7 +1857,7 @@ bool ED_curve_editfont_select_pick(bContext *C, const int mval[2], bool extend,
|
|||
const float dist = ED_view3d_select_dist_px();
|
||||
float dist_sq_best = dist * dist;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d);
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ int view3d_opengl_select(
|
|||
|
||||
/* view3d_select.c */
|
||||
float ED_view3d_select_dist_px(void);
|
||||
void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
|
||||
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc);
|
||||
void view3d_operator_needs_opengl(const struct bContext *C);
|
||||
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar);
|
||||
void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, int format, int type, void *data);
|
||||
|
|
|
@ -3413,7 +3413,7 @@ void MESH_OT_select_nth(wmOperatorType *ot)
|
|||
|
||||
void em_setup_viewcontext(bContext *C, ViewContext *vc)
|
||||
{
|
||||
view3d_set_viewcontext(C, vc);
|
||||
ED_view3d_viewcontext_init(C, vc);
|
||||
|
||||
if (vc->obedit) {
|
||||
vc->em = BKE_editmesh_from_object(vc->obedit);
|
||||
|
|
|
@ -1102,7 +1102,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int
|
|||
return false;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (size) {
|
||||
/* sample rect to increase chances of selecting, so that when clicking
|
||||
|
@ -1273,7 +1273,7 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
|
|||
if (!me || me->totvert == 0)
|
||||
return false;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (use_zbuf) {
|
||||
if (size > 0) {
|
||||
|
|
|
@ -598,7 +598,7 @@ bool ED_mball_select_pick(bContext *C, const int mval[2], bool extend, bool dese
|
|||
rcti rect;
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
BLI_rcti_init_pt_radius(&rect, mval, 12);
|
||||
|
||||
|
|
|
@ -883,7 +883,7 @@ bool ED_lattice_select_pick(bContext *C, const int mval[2], bool extend, bool de
|
|||
BPoint *bp = NULL;
|
||||
Lattice *lt;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
lt = ((Lattice *)vc.obedit->data)->editlatt->latt;
|
||||
bp = findnearestLattvert(&vc, mval, true);
|
||||
|
||||
|
|
|
@ -1286,7 +1286,7 @@ static void object_transform_axis_target_cancel(bContext *C, wmOperator *op)
|
|||
static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
ViewContext vc;
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (!object_is_target_compat(vc.obact)) {
|
||||
/* Falls back to texture space transform. */
|
||||
|
|
|
@ -412,7 +412,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
|
|||
{
|
||||
PE_set_data(C, data);
|
||||
|
||||
view3d_set_viewcontext(C, &data->vc);
|
||||
ED_view3d_viewcontext_init(C, &data->vc);
|
||||
|
||||
if (V3D_IS_ZBUF(data->vc.v3d)) {
|
||||
if (data->vc.v3d->flag & V3D_INVALID_BACKBUF) {
|
||||
|
|
|
@ -1033,7 +1033,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
|
|||
/* can't use stroke vc here because this will be called during
|
||||
* mouse over too, not just during a stroke */
|
||||
ViewContext vc;
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
if (vc.rv3d && (vc.rv3d->rflag & RV3D_NAVIGATING)) {
|
||||
return;
|
||||
|
|
|
@ -325,7 +325,7 @@ static void clip_planes_from_rect(bContext *C,
|
|||
BoundBox bb;
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
ED_view3d_clipping_calc(&bb, clip_planes, vc.ar, vc.obact, rect);
|
||||
negate_m4(clip_planes);
|
||||
}
|
||||
|
|
|
@ -760,7 +760,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo
|
|||
PaintOperation *pop = MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */
|
||||
Brush *brush = BKE_paint_brush(&settings->imapaint.paint);
|
||||
int mode = RNA_enum_get(op->ptr, "mode");
|
||||
view3d_set_viewcontext(C, &pop->vc);
|
||||
ED_view3d_viewcontext_init(C, &pop->vc);
|
||||
|
||||
copy_v2_v2(pop->prevmouse, mouse);
|
||||
copy_v2_v2(pop->startmouse, mouse);
|
||||
|
|
|
@ -449,7 +449,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
|
|||
/* Calculations of individual vertices are done in 2D screen space to diminish the amount of
|
||||
* calculations done. Bounding box PBVH collision is not computed against enclosing rectangle
|
||||
* of lasso */
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
/* lasso data calculations */
|
||||
data.vc = &vc;
|
||||
|
|
|
@ -698,7 +698,7 @@ PaintStroke *paint_stroke_new(bContext *C,
|
|||
Brush *br = stroke->brush = BKE_paint_brush(p);
|
||||
float zoomx, zoomy;
|
||||
|
||||
view3d_set_viewcontext(C, &stroke->vc);
|
||||
ED_view3d_viewcontext_init(C, &stroke->vc);
|
||||
|
||||
stroke->get_location = get_location;
|
||||
stroke->test_start = test_start;
|
||||
|
|
|
@ -468,7 +468,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr
|
|||
unsigned int totpoly = me->totpoly;
|
||||
|
||||
if (dm->getLoopDataArray(dm, CD_MLOOPUV)) {
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
view3d_operator_needs_opengl(C);
|
||||
|
||||
|
|
|
@ -1481,7 +1481,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo
|
|||
/* make mode data storage */
|
||||
wpd = MEM_callocN(sizeof(struct WPaintData), "WPaintData");
|
||||
paint_stroke_set_mode_data(stroke, wpd);
|
||||
view3d_set_viewcontext(C, &wpd->vc);
|
||||
ED_view3d_viewcontext_init(C, &wpd->vc);
|
||||
view_angle_limits_init(&wpd->normal_angle_precalc, vp->paint.brush->falloff_angle,
|
||||
(vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0);
|
||||
|
||||
|
@ -2481,7 +2481,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
|
|||
/* make mode data storage */
|
||||
vpd = MEM_callocN(sizeof(*vpd), "VPaintData");
|
||||
paint_stroke_set_mode_data(stroke, vpd);
|
||||
view3d_set_viewcontext(C, &vpd->vc);
|
||||
ED_view3d_viewcontext_init(C, &vpd->vc);
|
||||
view_angle_limits_init(&vpd->normal_angle_precalc, vp->paint.brush->falloff_angle,
|
||||
(vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0);
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
|
|||
Mesh *me;
|
||||
bool changed = false;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
me = BKE_mesh_from_object(vc.obact);
|
||||
|
||||
if (me && me->dvert && vc.v3d && vc.rv3d && (vc.obact->actdef != 0)) {
|
||||
|
@ -298,7 +298,7 @@ static const EnumPropertyItem *weight_paint_sample_enum_itemf(
|
|||
ViewContext vc;
|
||||
Mesh *me;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
me = BKE_mesh_from_object(vc.obact);
|
||||
|
||||
if (me && me->dvert && vc.v3d && vc.rv3d && vc.obact->defbase.first) {
|
||||
|
@ -367,7 +367,7 @@ static int weight_sample_group_exec(bContext *C, wmOperator *op)
|
|||
{
|
||||
int type = RNA_enum_get(op->ptr, "group");
|
||||
ViewContext vc;
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
BLI_assert(type + 1 >= 0);
|
||||
vc.obact->actdef = type + 1;
|
||||
|
|
|
@ -4728,7 +4728,7 @@ bool sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2])
|
|||
bool original;
|
||||
ViewContext vc;
|
||||
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
ob = vc.obact;
|
||||
|
||||
|
@ -5940,7 +5940,7 @@ static void sample_detail(bContext *C, int ss_co[2])
|
|||
float ray_start[3], ray_end[3], ray_normal[3], depth;
|
||||
SculptDetailRaycastData srd;
|
||||
float mouse[2] = {ss_co[0], ss_co[1]};
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
sd = CTX_data_tool_settings(C)->sculpt;
|
||||
ob = vc.obact;
|
||||
|
|
|
@ -106,7 +106,7 @@ float ED_view3d_select_dist_px(void)
|
|||
}
|
||||
|
||||
/* TODO: should return whether there is valid context to continue */
|
||||
void view3d_set_viewcontext(bContext *C, ViewContext *vc)
|
||||
void ED_view3d_viewcontext_init(bContext *C, ViewContext *vc)
|
||||
{
|
||||
memset(vc, 0, sizeof(ViewContext));
|
||||
vc->ar = CTX_wm_region(C);
|
||||
|
@ -872,7 +872,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op)
|
|||
view3d_operator_needs_opengl(C);
|
||||
|
||||
/* setup view context for argument to callbacks */
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
select = !RNA_boolean_get(op->ptr, "deselect");
|
||||
|
@ -1320,7 +1320,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
|
|||
view3d_operator_needs_opengl(C);
|
||||
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
hits = mixed_bones_object_selectbuffer(&eval_ctx, &vc, buffer, mval, false, false, &do_nearest);
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ static bool ed_object_select_pick(
|
|||
|
||||
/* setup view context for argument to callbacks */
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
is_obedit = (vc.obedit != NULL);
|
||||
if (object) {
|
||||
|
@ -2113,7 +2113,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* setup view context for argument to callbacks */
|
||||
CTX_data_eval_ctx(C, &eval_ctx);
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
|
||||
select = !RNA_boolean_get(op->ptr, "deselect");
|
||||
extend = RNA_boolean_get(op->ptr, "extend");
|
||||
|
@ -2813,7 +2813,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m
|
|||
static int view3d_circle_select_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ViewContext vc;
|
||||
view3d_set_viewcontext(C, &vc);
|
||||
ED_view3d_viewcontext_init(C, &vc);
|
||||
Object *obact = vc.obact;
|
||||
Object *obedit = vc.obedit;
|
||||
EvaluationContext eval_ctx;
|
||||
|
|
Loading…
Reference in New Issue