Fix #108591: Handle null material adding paint slot #108592

Merged
YimingWu merged 5 commits from ChengduLittleA/blender:fix-108591 into blender-v3.6-release 2023-06-06 04:13:08 +02:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit ee6de70bdc - Show all commits

View File

@ -6641,7 +6641,7 @@ static void default_paint_slot_color_get(int layer_type, Material *ma, float col
if (ma && ma->nodetree) {
ma->nodetree->ensure_topology_cache();
const blender::Span<bNode *> nodes = ma->nodetree->nodes_by_type("ShaderNodeBsdfPrincipled");
nodes.is_empty() ? nullptr : nodes.first();
in_node = nodes.is_empty() ? nullptr : nodes.first();
ChengduLittleA marked this conversation as resolved Outdated

Am I missing something? nodes.is_empty() ? nullptr : nodes.first(); doesn't seem to do anything

Am I missing something? `nodes.is_empty() ? nullptr : nodes.first();` doesn't seem to do anything
}
if (!in_node) {
/* An existing material or Principled BSDF node could not be found.