From 1e7f5b1e61d457f62207dd931698a9ddd9184134 Mon Sep 17 00:00:00 2001 From: Michael Kowalski Date: Tue, 31 Oct 2023 14:50:47 +0100 Subject: [PATCH 1/3] USD: fix cache reader open error handling. This commit fixes error handling logic implemented in #113524. - No longer calling WM_reportf, which is not thread safe. - Freeing the reader before returning early. Pull Request: https://projects.blender.org/blender/blender/pulls/114298 --- source/blender/io/usd/intern/usd_capi_import.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc index f26c83adcb0..eb4e21a0271 100644 --- a/source/blender/io/usd/intern/usd_capi_import.cc +++ b/source/blender/io/usd/intern/usd_capi_import.cc @@ -551,17 +551,16 @@ CacheReader *CacheReader_open_usd_object(CacheArchiveHandle *handle, return reader; } + if (reader) { + USD_CacheReader_free(reader); + } + pxr::UsdPrim prim = archive->stage()->GetPrimAtPath(pxr::SdfPath(object_path)); if (!prim) { - WM_reportf(RPT_WARNING, "USD Import: unable to open cache reader for object %s", object_path); return nullptr; } - if (reader) { - USD_CacheReader_free(reader); - } - /* TODO(makowalski): The handle does not have the proper import params or settings. */ USDPrimReader *usd_reader = archive->create_reader(prim); From fef222efc3c08b3a73dc220ded96972c5b81df99 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Tue, 31 Oct 2023 14:52:45 +0100 Subject: [PATCH 2/3] Fix: NLA mapping not taken into account when framing FCurves The functionality to frame channels in the Graph Editor did not take into account any NLA mapping, causing the viewport to frame the wrong part. Fix it by mapping the `rctf` x-values I had to remove the `const` on a parameter from the function since `ANIM_nla_mapping_get` doesn't take a `const`. Pull Request: https://projects.blender.org/blender/blender/pulls/114325 --- source/blender/editors/animation/anim_channels_edit.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/animation/anim_channels_edit.cc b/source/blender/editors/animation/anim_channels_edit.cc index 54370669bab..355b698f5cc 100644 --- a/source/blender/editors/animation/anim_channels_edit.cc +++ b/source/blender/editors/animation/anim_channels_edit.cc @@ -63,7 +63,7 @@ static bool get_normalized_fcurve_bounds(FCurve *fcu, bAnimContext *ac, - const bAnimListElem *ale, + bAnimListElem *ale, const bool include_handles, const float range[2], rctf *r_bounds) @@ -91,6 +91,10 @@ static bool get_normalized_fcurve_bounds(FCurve *fcu, r_bounds->ymin -= (min_height - height) / 2; r_bounds->ymax += (min_height - height) / 2; } + AnimData *adt = ANIM_nla_mapping_get(ac, ale); + r_bounds->xmin = BKE_nla_tweakedit_remap(adt, r_bounds->xmin, NLATIME_CONVERT_MAP); + r_bounds->xmax = BKE_nla_tweakedit_remap(adt, r_bounds->xmax, NLATIME_CONVERT_MAP); + return true; } @@ -154,6 +158,7 @@ static void add_region_padding(bContext *C, ARegion *region, rctf *bounds) UI_MARKER_MARGIN_Y; BLI_rctf_pad_y(bounds, region->winy, pad_bottom, pad_top); } + /** \} */ /* -------------------------------------------------------------------- */ From af363a6ba264854f8871747dc4d9c587097c0109 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Tue, 31 Oct 2023 14:56:46 +0100 Subject: [PATCH 3/3] Fix asset shelf can't resized by dragging header edge anymore Regression from 7ec7dac860 (I assume). While the block active state is relevant during drawing to avoid glitches, it should be ignored during handling. Explained further in comment. --- .../blender/editors/interface/interface_button_sections.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_button_sections.cc b/source/blender/editors/interface/interface_button_sections.cc index 82689609bf3..a5787d85973 100644 --- a/source/blender/editors/interface/interface_button_sections.cc +++ b/source/blender/editors/interface/interface_button_sections.cc @@ -60,8 +60,13 @@ static Vector button_section_bounds_calc(const ARegion *region, const bool rcti cur_section_bounds; BLI_rcti_init_minmax(&cur_section_bounds); + /* A bit annoying, but this function is called for both drawing and event handling. When + * drawing, we need to exclude inactive blocks since they mess with the result. However, this + * active state is only useful during drawing and must be ignored for handling (at which point + * #uiBlock::active is false for all blocks). */ + const bool is_drawing = region->do_draw & RGN_DRAWING; LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) { - if (!block->active) { + if (is_drawing && !block->active) { continue; }