You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a very hacked together ShaderGen and found when I have sourcecode="{0}" where in the output I want to see literally {0}, MaterialX fails.
The problem is in the SourceCodeNode::emitFunctionCall method, which uses _functionSource.find_first_of("{{") to find the first occurrence of the {{. But that's not what find_first_of actually does. It finds the first occurrence of any of the characters in the provided string, so it finds even single {. The code should be using find instead, which finds the exact match. Same goes for the postfix search a bit later.
The text was updated successfully, but these errors were encountered:
This is a great catch, @tomas-davidovic, and I believe this issue goes back to our very first implementation of SourceCodeNode::emitFunctionCall. Would you have the bandwidth to put together a pull request addressing this, where you can validate the results with your local ShaderGen implementation?
I am writing a very hacked together ShaderGen and found when I have
sourcecode="{0}"
where in the output I want to see literally{0}
, MaterialX fails.The problem is in the SourceCodeNode::emitFunctionCall method, which uses
_functionSource.find_first_of("{{")
to find the first occurrence of the{{
. But that's not whatfind_first_of
actually does. It finds the first occurrence of any of the characters in the provided string, so it finds even single{
. The code should be usingfind
instead, which finds the exact match. Same goes for the postfix search a bit later.The text was updated successfully, but these errors were encountered: