-
Notifications
You must be signed in to change notification settings - Fork 352
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
Node Definition Creation in Graph Editor #1404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only files in MaterialXGraphEditor are new. Rest are from the other PR.
@@ -50,18 +51,57 @@ std::string getNodeDefId(const std::string& val) | |||
|
|||
} // anonymous namespace | |||
|
|||
bool NodeDefParameters::generateIdentifiers(mx::NodeGraphPtr nodeGraph) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node identifier creator.
_initial(false), | ||
_delete(false), | ||
_fileDialogSave(FileDialog::EnterNewFilename), | ||
_fileDialogCreateDefinition(FileDialog::EnterNewFilename), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New dialog for definition save.
@@ -130,8 +175,24 @@ void Graph::loadStandardLibraries() | |||
// Initialize the standard library. | |||
try | |||
{ | |||
// Emit the folders and search path if custom libraries are specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check for default "user library" definitions.
std::vector<mx::OutputPtr> outputs = nodeGraph->getOutputs(); | ||
if (doc && !outputs.empty()) | ||
{ | ||
parameters.generateIdentifiers(nodeGraph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI value extraction and cleanup before calling creator.
} | ||
} | ||
|
||
void Graph::addCreateDefinitionPopup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the main UI.
- Version and namespace are optionally enabled UI
- "Custom" library location enabling allows for a file dialog to be used to specific a specific custom location (vs the default user location).
static std::string fileName; | ||
static bool useExplicitFile = false; | ||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0)); | ||
ImGui::Checkbox("Custom Location", &useExplicitFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Custom save location UI.
@@ -3365,6 +3744,18 @@ void Graph::propertyEditor() | |||
ImGui::SetWindowFontScale(1.0f); | |||
ImGui::EndPopup(); | |||
} | |||
|
|||
if (_currUiNode->getNodeGraph() != nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exposure of definition creation for nodegraphs in property editor.
@@ -32,13 +32,64 @@ struct Link | |||
} | |||
}; | |||
|
|||
class NodeDefParameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block of possible creation parameters filled in the ui and passed to the method to perform creation and save.
@@ -126,6 +127,10 @@ int main(int argc, char* const argv[]) | |||
{ | |||
libraryFolders.push_back(nextToken); | |||
} | |||
else if (token == "--userLibrary") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow for custom default location of "user library" on startup.
Integration
nodedef
creation has been hooked up into "create definition" workflow in node editor.category
and a compound node graph is required with all other arguments being optional.Publishing_V1.mp4
@lfl-eholthouser: leaving ping as your the gate-keeper for this. It's the same change from an older PR but extracted out. Only the GraphEditor changes are new. The rest are inherited from #1403.