Merge branch 'blender-v3.0-release'

This commit is contained in:
Philipp Oeser 2021-11-22 13:49:37 +01:00
commit 7e8f9213e9
2 changed files with 17 additions and 15 deletions

View File

@ -2036,15 +2036,6 @@ static void constraint_reorder(bContext *C, Panel *panel, int new_index)
PointerRNA *con_ptr = UI_panel_custom_data_get(panel);
bConstraint *con = (bConstraint *)con_ptr->data;
/* Ensure called operator does have a context with the expected "constraint" member. */
ListBase contexts = {NULL};
bContextStore *previous_context_store = CTX_store_get(C);
if (previous_context_store != NULL) {
BLI_addtail(&contexts, previous_context_store);
}
bContextStore *constraint_context_store = CTX_store_add(&contexts, "constraint", con_ptr);
CTX_store_set(C, constraint_context_store);
PointerRNA props_ptr;
wmOperatorType *ot = WM_operatortype_find("CONSTRAINT_OT_move_to_index", false);
WM_operator_properties_create_ptr(&props_ptr, ot);
@ -2054,12 +2045,6 @@ static void constraint_reorder(bContext *C, Panel *panel, int new_index)
RNA_enum_set(&props_ptr, "owner", constraint_from_bone ? 1 : 0);
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &props_ptr);
WM_operator_properties_free(&props_ptr);
/* Cleanup modified context. */
CTX_store_set(C, previous_context_store);
if (previous_context_store != constraint_context_store) {
CTX_store_free(constraint_context_store);
}
}
/**

View File

@ -3059,6 +3059,23 @@ static int viewselected_exec(bContext *C, wmOperator *op)
if ((gps->flag & GP_STROKE_SELECT) && (gps->flag & GP_STROKE_3DSPACE)) {
ok |= BKE_gpencil_stroke_minmax(gps, true, min, max);
}
if (gps->editcurve != NULL) {
for (int i = 0; i < gps->editcurve->tot_curve_points; i++) {
BezTriple *bezt = &gps->editcurve->curve_points[i].bezt;
if ((bezt->f1 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[0]);
ok = true;
}
if ((bezt->f2 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[1]);
ok = true;
}
if ((bezt->f3 & SELECT)) {
minmax_v3v3_v3(min, max, bezt->vec[2]);
ok = true;
}
}
}
}
CTX_DATA_END;