@@ -330,12 +330,12 @@ ShaderPtr MdlShaderGenerator::generate(const string& name, ElementPtr element, G
330330 return shader;
331331}
332332
333- ShaderNodeImplPtr MdlShaderGenerator::createShaderNodeImplForNodeGraph (const NodeDef& nodedef ) const
333+ ShaderNodeImplPtr MdlShaderGenerator::createShaderNodeImplForNodeGraph (const NodeGraph& nodegraph ) const
334334{
335- vector<OutputPtr> outputs = nodedef .getActiveOutputs ();
335+ vector<OutputPtr> outputs = nodegraph .getActiveOutputs ();
336336 if (outputs.empty ())
337337 {
338- throw ExceptionShaderGenError (" NodeDef '" + nodedef .getName () + " ' has no outputs defined" );
338+ throw ExceptionShaderGenError (" NodeGraph '" + nodegraph .getName () + " ' has no outputs defined" );
339339 }
340340
341341 const TypeDesc outputType = _typeSystem->getType (outputs[0 ]->getType ());
@@ -349,27 +349,21 @@ ShaderNodeImplPtr MdlShaderGenerator::createShaderNodeImplForNodeGraph(const Nod
349349 return CompoundNodeMdl::create ();
350350}
351351
352- ShaderNodeImplPtr MdlShaderGenerator::createShaderNodeImplForImplementation (const NodeDef& nodedef ) const
352+ ShaderNodeImplPtr MdlShaderGenerator::createShaderNodeImplForImplementation (const Implementation& implElement ) const
353353{
354- InterfaceElementPtr implElement = nodedef.getImplementation (getTarget ());
355- if (!implElement)
356- {
357- return nullptr ;
358- }
359-
360354 // When `file` and `function` are provided we consider this node a user node
361- const string file = implElement-> getTypedAttribute <string>(" file" );
362- const string function = implElement-> getTypedAttribute <string>(" function" );
355+ const string file = implElement. getTypedAttribute <string>(" file" );
356+ const string function = implElement. getTypedAttribute <string>(" function" );
363357 // Or, if `sourcecode` is provided we consider this node a user node with inline implementation
364358 // inline implementations are not supposed to have replacement markers
365- const string sourcecode = implElement-> getTypedAttribute <string>(" sourcecode" );
359+ const string sourcecode = implElement. getTypedAttribute <string>(" sourcecode" );
366360 if ((!file.empty () && !function.empty ()) || (!sourcecode.empty () && sourcecode.find (" {{" ) == string::npos))
367361 {
368362 return CustomCodeNodeMdl::create ();
369363 }
370364 if (file.empty () && sourcecode.empty ())
371365 {
372- throw ExceptionShaderGenError (" No valid MDL implementation found for '" + implElement-> getName () + " '" );
366+ throw ExceptionShaderGenError (" No valid MDL implementation found for '" + implElement. getName () + " '" );
373367 }
374368 return SourceCodeNodeMdl::create ();
375369}
0 commit comments