Skip to content

Commit e563fb7

Browse files
Experiment : ShaderNetwork : Allow escaped string substitutions to work correctly
1 parent 356ed76 commit e563fb7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/IECoreScene/ShaderNetwork.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,16 @@ class ShaderNetwork::Implementation
447447
h.append( 0 );
448448
}
449449
}
450+
451+
if( m_parmsNeedingSubstitution.size() && !m_neededSubstitutions.size() )
452+
{
453+
// If we don't rely on any attributes, but do require substitutions ( for example,
454+
// because some parameters have escaped substitutions, and need the escape characters
455+
// removed ), then our hash won't vary with the attributes, but we do still need to
456+
// do something to the hash, so that Gaffer won't skip running substitutions on this
457+
// shader.
458+
h.append( true );
459+
}
450460
}
451461

452462
void applySubstitutions( const CompoundObject *attributes )

0 commit comments

Comments
 (0)