ShaderNode: Add automatic variables

This commit is contained in:
Lynix
2020-05-26 20:30:24 +02:00
parent 09e08255fb
commit d96bc9db6e
12 changed files with 143 additions and 19 deletions

View File

@@ -13,6 +13,13 @@ ShaderNode(graph)
UpdatePreview();
});
if (graph.GetInputCount() > 0)
{
auto& firstInput = graph.GetInput(0);
m_currentInputIndex = 0;
m_currentInputText = firstInput.name;
}
UpdatePreview();
}

View File

@@ -14,6 +14,15 @@ ShaderNode(graph)
if (m_currentTextureIndex == textureIndex)
UpdatePreview();
});
if (graph.GetTextureCount() > 0)
{
auto& firstInput = graph.GetTexture(0);
m_currentTextureIndex = 0;
m_currentTextureText = firstInput.name;
}
UpdateOutput();
}
unsigned int SampleTexture::nPorts(QtNodes::PortType portType) const