Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'baked' suffix from TextureBaker names #1744

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions source/MaterialXRender/TextureBaker.inl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace

const string SRGB_TEXTURE = "srgb_texture";
const string LIN_REC709 = "lin_rec709";
const string BAKED_POSTFIX = "_baked";
const string SHADER_PREFIX = "SR_";
const string DEFAULT_UDIM_PREFIX = "_";

Expand Down Expand Up @@ -352,13 +351,13 @@ DocumentPtr TextureBaker<Renderer, ShaderGen>::generateNewDocumentFromShader(Nod
}

// Create a shader node.
NodePtr bakedShader = _bakedTextureDoc->addNode(shader->getCategory(), shader->getName() + BAKED_POSTFIX, shader->getType());
NodePtr bakedShader = _bakedTextureDoc->addNode(shader->getCategory(), shader->getName(), shader->getType());

// Optionally create a material node, connecting it to the new shader node.
if (_material)
{
string materialName = (_texTemplateOverrides.count("$MATERIAL")) ? _texTemplateOverrides["$MATERIAL"] : _material->getName();
NodePtr bakedMaterial = _bakedTextureDoc->addNode(_material->getCategory(), materialName + BAKED_POSTFIX, _material->getType());
NodePtr bakedMaterial = _bakedTextureDoc->addNode(_material->getCategory(), materialName, _material->getType());
for (auto sourceMaterialInput : _material->getInputs())
{
const string& sourceMaterialInputName = sourceMaterialInput->getName();
Expand Down Expand Up @@ -421,7 +420,7 @@ DocumentPtr TextureBaker<Renderer, ShaderGen>::generateNewDocumentFromShader(Nod
if (!_bakedImageMap.empty())
{
// Add the image node.
NodePtr bakedImage = bakedNodeGraph->addNode("image", sourceName + BAKED_POSTFIX, sourceType);
NodePtr bakedImage = bakedNodeGraph->addNode("image", sourceName, sourceType);
InputPtr input = bakedImage->addInput("file", "filename");
StringMap filenameTemplateMap = initializeFileTemplateMap(bakedInput, shader, udimSet.empty() ? EMPTY_STRING : UDIM_TOKEN);
input->setValueString(generateTextureFilename(filenameTemplateMap));
Expand All @@ -433,7 +432,7 @@ DocumentPtr TextureBaker<Renderer, ShaderGen>::generateNewDocumentFromShader(Nod
NodePtr origWorldSpaceNode = worldSpacePair->second;
if (origWorldSpaceNode)
{
NodePtr newWorldSpaceNode = bakedNodeGraph->addNode(origWorldSpaceNode->getCategory(), sourceName + BAKED_POSTFIX + "_map", sourceType);
NodePtr newWorldSpaceNode = bakedNodeGraph->addNode(origWorldSpaceNode->getCategory(), sourceName + "_map", sourceType);
newWorldSpaceNode->copyContentFrom(origWorldSpaceNode);
InputPtr mapInput = newWorldSpaceNode->getInput("in");
if (mapInput)
Expand Down