Skip to content

Commit

Permalink
Improve validation in graph editor
Browse files Browse the repository at this point in the history
This changelist improves the document validation step in the graph editor, importing the standard libraries to allow validation of node interfaces as well as document syntax.
  • Loading branch information
jstone-lucasfilm committed Aug 20, 2023
1 parent 42bb654 commit 2d12c16
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions source/MaterialXGraphEditor/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Graph::Graph(const std::string& materialFilename,
_geomFilter.push_back(".gltf");

_graphDoc = loadDocument(materialFilename);
_graphDoc->importLibrary(_stdLib);

_initial = true;
createNodeUIList(_stdLib);
Expand Down Expand Up @@ -177,6 +176,7 @@ mx::DocumentPtr Graph::loadDocument(mx::FilePath filename)
if (!filename.isEmpty())
{
mx::readFromXmlFile(doc, filename, _searchPath, &readOptions);
doc->importLibrary(_stdLib);
std::string message;
if (!doc->validate(&message))
{
Expand Down Expand Up @@ -4057,7 +4057,6 @@ void Graph::drawGraph(ImVec2 mousePos)
std::string graphName = fileName.getBaseName();
_currGraphName.push_back(graphName.substr(0, graphName.length() - 5));
_graphDoc = loadDocument(fileName);
_graphDoc->importLibrary(_stdLib);

_initial = true;
buildUiBaseGraph(_graphDoc);
Expand Down

0 comments on commit 2d12c16

Please sign in to comment.