diff --git a/source/blender/io/usd/intern/usd_light_convert.cc b/source/blender/io/usd/intern/usd_light_convert.cc index 544d786fb05..91a84c38a1f 100644 --- a/source/blender/io/usd/intern/usd_light_convert.cc +++ b/source/blender/io/usd/intern/usd_light_convert.cc @@ -235,10 +235,16 @@ void world_material_to_dome_light(const USDExportParams ¶ms, if (scene->world->use_nodes && scene->world->nodetree) { /* Find the world output. */ + bNode *output = nullptr; const bNodeTree *ntree = scene->world->nodetree; ntree->ensure_topology_cache(); const Span bsdf_nodes = ntree->nodes_by_type("ShaderNodeOutputWorld"); - const bNode *output = bsdf_nodes.is_empty() ? nullptr : bsdf_nodes.first(); + for (const bNode *node : bsdf_nodes) { + if (node->flag & NODE_DO_OUTPUT) { + output = const_cast(node); + break; + } + } if (!output) { /* No output, no valid network to convert. */