From 99b845b1fb779b2398f9e3a6cfeea5dca75f1f84 Mon Sep 17 00:00:00 2001 From: Michael Kowalski Date: Wed, 20 Mar 2024 13:59:00 +0100 Subject: [PATCH 1/2] Fix: USD import: point instancer invalid modifier uid Initializing the uid of the geom nodes modifier created by the point instancer reader to prevent an assertion failure (in a call to to BKE_modifiers_persistent_uids_are_valid()) when reading any USD point instancers in debug builds. Pull Request: https://projects.blender.org/blender/blender/pulls/119683 --- source/blender/io/usd/intern/usd_reader_pointinstancer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/io/usd/intern/usd_reader_pointinstancer.cc b/source/blender/io/usd/intern/usd_reader_pointinstancer.cc index e1209f88ad5..65372c2201c 100644 --- a/source/blender/io/usd/intern/usd_reader_pointinstancer.cc +++ b/source/blender/io/usd/intern/usd_reader_pointinstancer.cc @@ -157,6 +157,8 @@ void USDPointInstancerReader::read_object_data(Main *bmain, const double motionS ModifierData *md = BKE_modifier_new(eModifierType_Nodes); BLI_addtail(&object_->modifiers, md); + BKE_modifiers_persistent_uid_init(*object_, *md); + NodesModifierData &nmd = *reinterpret_cast(md); nmd.node_group = ntreeAddTree(bmain, "Instances", "GeometryNodeTree"); From 03c7191286dedf9c2bab168ec4f5e63725bdd156 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 20 Mar 2024 14:38:23 +0100 Subject: [PATCH 2/2] Fix #119560: Wanderer Demo Crash in 4.1 and 4.2 Add a null pointer check around CPU processor, matching the rest of the processor access. This solves crash in cases when the OCIO configuration exists but is invalid: i.e. by removing a lookup table. It could lead to an invalid render result, but is better than a crash. The original issue with running Blender from within .zip archive might still need investigation, as there might be a way to make it work. Pull Request: https://projects.blender.org/blender/blender/pulls/119693 --- source/blender/imbuf/intern/colormanagement.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/blender/imbuf/intern/colormanagement.cc b/source/blender/imbuf/intern/colormanagement.cc index e2c6c6c1c60..713411ad7d1 100644 --- a/source/blender/imbuf/intern/colormanagement.cc +++ b/source/blender/imbuf/intern/colormanagement.cc @@ -3953,6 +3953,19 @@ bool IMB_colormanagement_processor_is_noop(ColormanageProcessor *cm_processor) return false; } + if (!cm_processor->cpu_processor) { + /* The CPU processor might have failed to be created, for example when the requested color + * space does not exist in the configuration, or if there is a missing lookup table, or the + * configuration is invalid due to other reasons. + * + * The actual processing checks for the cpu_processor not being null pointer, and it if is then + * processing does not apply it. However, processing could still apply curve mapping. + * + * Hence a null-pointer here, which happens after the curve mapping check, but before accessing + * cpu_processor. */ + return true; + } + return OCIO_cpuProcessorIsNoOp(cm_processor->cpu_processor); }