message: Improvements to findRenderableElements
  Only search for graph outputs when no material nodes are present.
  Simplify search logic for graph outputs.
diff: @@ -379,68 +379,42 @@ void findRenderableMaterialNodes(ConstDocumentPtr doc,
  void findRenderableElements(ConstDocumentPtr doc, vector<TypedElementPtr>& elements, bool includeReferencedGraphs)
  {
  std::unordered_set<ElementPtr> processedSources;
  -
  findRenderableMaterialNodes(doc, elements, includeReferencedGraphs, processedSources);
  -
  - // Find node graph outputs. Skip any light shaders
  - vector<OutputPtr> testOutputs;
  - for (NodeGraphPtr nodeGraph : doc->getNodeGraphs())
  - {
  - // Skip anything from an include file including libraries.
  - // Skip any nodegraph which is a definition
  - if (!nodeGraph->hasSourceUri() && !nodeGraph->hasAttribute(InterfaceElement::NODE_DEF_ATTRIBUTE))
  - {
  - for (auto graphOutput : nodeGraph->getOutputs())
  + if (!elements.empty())
  {
  - testOutputs.push_back(graphOutput);
  - }
  - }
  + return;
  }
  - // Add in all top-level outputs not already processed.
  - auto docOutputs = doc->getOutputs();
  - for (auto docOutput : docOutputs)
  + // Find all node graph outputs in the content document.
  + vector<OutputPtr> graphOutputs;
  + for (OutputPtr output : doc->getOutputs())
  {
  - if (!docOutput->hasSourceUri())
  + if (output->getActiveSourceUri() == doc->getActiveSourceUri())
  {
  - testOutputs.push_back(docOutput);
  + graphOutputs.push_back(output);
  }
  }
  -
  - for (OutputPtr output : testOutputs)
  - {
  - if (processedSources.count(output))
  + for (NodeGraphPtr graph : doc->getNodeGraphs())
  {
  - continue;
  - }
  - NodePtr node = output->getConnectedNode();
  - if (node && node->getType() != LIGHT_SHADER_TYPE_STRING)
  + for (OutputPtr output : graph->getOutputs())
  {
  - NodeDefPtr nodeDef = node->getNodeDef();
  - if (!nodeDef)
  + if (output->getActiveSourceUri() == doc->getActiveSourceUri())
  {
  - throw ExceptionShaderGenError("Could not find a nodedef for node '" + node->getNamePath() + "'");
  + graphOutputs.push_back(output);
  }
  - if (requiresImplementation(nodeDef))
  - {
  - if (node->getType() == MATERIAL_TYPE_STRING)
  - {
  - if (processedSources.count(node))
  - {
  - continue;
  }
  - elements.push_back(node);
  - processedSources.insert(node);
  }
  - else
  +
  + // Add renderable graph outputs to the return vector.
  + for (OutputPtr output : graphOutputs)
  + {
  + NodePtr node = output->getConnectedNode();
  + if (node && node->getType() != LIGHT_SHADER_TYPE_STRING)
  {
  elements.push_back(output);
  }
  }
  }
  - processedSources.insert(output);
  - }
  -}
  InputPtr getNodeDefInput(InputPtr nodeInput, const string& target)
  {
  