Skip to content

Commit

Permalink
Add filename resolve.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb committed Sep 5, 2023
1 parent dc6d0c0 commit 4532d42
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/MaterialXRender/GltfMaterialHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void writeColor3Input(const NodePtr pbrNode, const string& inputName,
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
if (filename.empty())
{
imageNode = nullptr;
Expand Down Expand Up @@ -185,7 +185,7 @@ void writeFloatInput(const NodePtr pbrNode, const string& inputName,
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
if (filename.empty())
{
imageNode = nullptr;
Expand Down Expand Up @@ -575,7 +575,7 @@ bool GltfMaterialHandler::save(const FilePath& filePath, StringVec& logger)
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
if (filename.empty())
imageNode = nullptr;
}
Expand Down Expand Up @@ -677,7 +677,7 @@ bool GltfMaterialHandler::save(const FilePath& filePath, StringVec& logger)
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
filenames[e] = filename;
imageNamePaths[e] = imageNode->getNamePath();
}
Expand Down Expand Up @@ -852,7 +852,7 @@ bool GltfMaterialHandler::save(const FilePath& filePath, StringVec& logger)
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
if (filename.empty())
imageNode = nullptr;
}
Expand Down Expand Up @@ -931,7 +931,7 @@ bool GltfMaterialHandler::save(const FilePath& filePath, StringVec& logger)
{
InputPtr fileInput = thicknessNode->getInput(Implementation::FILE_ATTRIBUTE);
thicknessFileName = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;

cgltf_texture* texture = &(textureList[imageIndex]);
iridescence.iridescence_thickness_texture.texture = texture;
Expand Down Expand Up @@ -989,7 +989,7 @@ bool GltfMaterialHandler::save(const FilePath& filePath, StringVec& logger)
{
InputPtr fileInput = imageNode->getInput(Implementation::FILE_ATTRIBUTE);
filename = fileInput && fileInput->getAttribute(TypedElement::TYPE_ATTRIBUTE) == FILENAME_TYPE_STRING ?
fileInput->getValueString() : EMPTY_STRING;
fileInput->getResolvedValueString() : EMPTY_STRING;
if (filename.empty())
imageNode = nullptr;
}
Expand Down

0 comments on commit 4532d42

Please sign in to comment.