blender-v3.6-release backports #112328

Merged
Philipp Oeser merged 7 commits from lichtwerk/blender:blender-v3.6-release into blender-v3.6-release 2023-09-13 16:31:54 +02:00
7 changed files with 78 additions and 31 deletions

View File

@ -151,7 +151,13 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
# if defined(WITH_GHOST_X11)
/* #GHOST_SystemX11. */
oxr_binding.egl.type = XR_TYPE_GRAPHICS_BINDING_EGL_MNDX;
oxr_binding.egl.getProcAddress = eglGetProcAddress;
# if XR_CURRENT_API_VERSION >= XR_MAKE_VERSION(1, 0, 29)
oxr_binding.egl.getProcAddress = reinterpret_cast<PFN_xrEglGetProcAddressMNDX>(
eglGetProcAddress);
# else
oxr_binding.egl.getProcAddress = reinterpret_cast<PFNEGLGETPROCADDRESSPROC>(
eglGetProcAddress);
# endif
oxr_binding.egl.display = ctx_egl.getDisplay();
oxr_binding.egl.config = ctx_egl.getConfig();
oxr_binding.egl.context = ctx_egl.getContext();

View File

@ -79,7 +79,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag))
BLI_assert_msg(0, "IDType Missing IDTypeInfo");
}
void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_idtag)
static int id_free(Main *bmain, void *idv, int flag, const bool use_flag_from_idtag)
{
ID *id = idv;
@ -127,7 +127,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
}
if ((flag & LIB_ID_FREE_NO_MAIN) == 0 && key != NULL) {
BKE_id_free_ex(bmain, &key->id, flag, use_flag_from_idtag);
id_free(bmain, &key->id, flag, use_flag_from_idtag);
}
BKE_libblock_free_datablock(id, flag);
@ -167,6 +167,23 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i
if ((flag & LIB_ID_FREE_NOT_ALLOCATED) == 0) {
MEM_freeN(id);
}
return flag;
}
void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_idtag)
{
/* ViewLayer resync needs to be delayed during Scene freeing, since internal relationships
* between the Scene's master collection and its view_layers become invalid (due to remapping .
*/
BKE_layer_collection_resync_forbid();
flag = id_free(bmain, idv, flag, use_flag_from_idtag);
BKE_layer_collection_resync_allow();
if (bmain && (flag & LIB_ID_FREE_NO_MAIN) == 0) {
BKE_main_collection_sync_remap(bmain);
}
}
void BKE_id_free(Main *bmain, void *idv)
@ -336,6 +353,11 @@ static size_t id_delete(Main *bmain,
BKE_main_unlock(bmain);
/* ViewLayer resync needs to be delayed during Scene freeing, since internal relationships
* between the Scene's master collection and its view_layers become invalid (due to remapping .
*/
BKE_layer_collection_resync_forbid();
/* In usual reversed order, such that all usage of a given ID, even 'never NULL' ones,
* have been already cleared when we reach it
* (e.g. Objects being processed before meshes, they'll have already released their 'reference'
@ -357,12 +379,15 @@ static size_t id_delete(Main *bmain,
ID_REAL_USERS(id),
(id->tag & LIB_TAG_EXTRAUSER_SET) != 0 ? 1 : 0);
}
BKE_id_free_ex(bmain, id, free_flag, !do_tagged_deletion);
id_free(bmain, id, free_flag, !do_tagged_deletion);
++num_datablocks_deleted;
}
}
}
BKE_layer_collection_resync_allow();
BKE_main_collection_sync_remap(bmain);
bmain->is_memfile_undo_written = false;
return num_datablocks_deleted;
}

View File

@ -2919,8 +2919,12 @@ static void box_select_anim_channels(bAnimContext *ac, rcti *rect, short selectm
UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax - 2, &rectf.xmax, &rectf.ymax);
/* filter data */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS |
ANIMFILTER_FCURVESONLY);
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
if (!ANIM_animdata_can_have_greasepencil(ac->datatype)) {
filter |= ANIMFILTER_FCURVESONLY;
}
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
float ymax;

View File

@ -277,12 +277,12 @@ static void ui_selectcontext_apply(bContext *C,
const double value_orig);
/**
* Only respond to events which are expected to be used for multi button editing,
* e.g. ALT is also used for button array pasting, see #108096.
*/
# define IS_ALLSELECT_EVENT(event) \
(((event)->modifier & KM_ALT) != 0 && \
(ISMOUSE((event)->type) || ELEM((event)->type, EVT_RETKEY, EVT_PADENTER)))
* Ideally we would only respond to events which are expected to be used for multi button editing
* (additionally checking if this is a mouse[wheel] or returnkey event to avoid the ALT conflict
* with button array pasting, see #108096, but unfortunately wheel events are not part of
* win->eventstate with modifiers held down. Instead, the conflict is avoided by specifically
* filtering out CTRL ALT V in ui_apply_but(). */
# define IS_ALLSELECT_EVENT(event) (((event)->modifier & KM_ALT) != 0)
/** just show a tinted color so users know its activated */
# define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE
@ -2254,10 +2254,17 @@ static void ui_apply_but(
if (data->select_others.elems_len == 0)
{
wmWindow *win = CTX_wm_window(C);
/* may have been enabled before activating */
if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(win->eventstate)) {
ui_selectcontext_begin(C, but, &data->select_others);
data->select_others.is_enabled = true;
wmEvent *event = win->eventstate;
/* May have been enabled before activating, dont do for array pasting. */
if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(event)) {
/* See comment for IS_ALLSELECT_EVENT why this needs to be filtered here. */
const bool is_array_paste = (event->val == KM_PRESS) &&
(event->modifier & (KM_CTRL | KM_OSKEY)) &&
(event->modifier & KM_SHIFT) == 0 && (event->type == EVT_VKEY);
if (!is_array_paste) {
ui_selectcontext_begin(C, but, &data->select_others);
data->select_others.is_enabled = true;
}
}
}
if (data->select_others.elems_len == 0) {

View File

@ -173,11 +173,11 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
}
else if (ELEM(obedit->type, OB_SURF, OB_CURVES_LEGACY)) {
ListBase *editnurb = object_editcurve_get(obedit);
int curr_index = 0;
for (Nurb *nu = editnurb->first; nu != NULL; nu = nu->next) {
if (nu->type == CU_BEZIER) {
BezTriple *bezt = nu->bezt;
for (int curr_index = 0; curr_index < nu->pntsu; curr_index++, bezt++) {
for (int nurb_index = 0; nurb_index < nu->pntsu; nurb_index++, bezt++, curr_index++) {
if (BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt)) {
if (par1 == INDEX_UNSET) {
par1 = curr_index;
@ -200,7 +200,7 @@ static int vertex_parent_set_exec(bContext *C, wmOperator *op)
else {
BPoint *bp = nu->bp;
const int num_points = nu->pntsu * nu->pntsv;
for (int curr_index = 0; curr_index < num_points; curr_index++, bp++) {
for (int nurb_index = 0; nurb_index < num_points; nurb_index++, bp++, curr_index++) {
if (bp->f1 & SELECT) {
if (par1 == INDEX_UNSET) {
par1 = curr_index;

View File

@ -4389,12 +4389,14 @@ static void smooth_brush_toggle_on(const bContext *C, Paint *paint, StrokeCache
if (cur_brush->sculpt_tool == SCULPT_TOOL_MASK) {
cache->saved_mask_brush_tool = cur_brush->mask_tool;
cur_brush->mask_tool = BRUSH_MASK_SMOOTH;
return;
}
else if (ELEM(cur_brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
if (ELEM(cur_brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
{
/* Do nothing, this tool has its own smooth mode. */
return;
@ -4425,14 +4427,17 @@ static void smooth_brush_toggle_off(const bContext *C, Paint *paint, StrokeCache
if (brush->sculpt_tool == SCULPT_TOOL_MASK) {
brush->mask_tool = cache->saved_mask_brush_tool;
return;
}
else if (ELEM(brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
if (ELEM(brush->sculpt_tool,
SCULPT_TOOL_SLIDE_RELAX,
SCULPT_TOOL_DRAW_FACE_SETS,
SCULPT_TOOL_PAINT,
SCULPT_TOOL_SMEAR))
{
/* Do nothing. */
return;
}
/* If saved_active_brush_name is not set, brush was not switched/affected in

View File

@ -475,9 +475,9 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu)
UI_GetThemeColor3ubv(basecol + bezt->h2, col);
col[3] = fcurve_display_alpha(fcu) * 255;
immAttr4ubv(color, col);
immVertex2fv(pos, bezt->vec[0]);
immAttr4ubv(color, col);
immVertex2fv(pos, bezt->vec[1]);
immAttr4ubv(color, col);
immVertex2fv(pos, bezt->vec[2]);
}
}
}