-
Notifications
You must be signed in to change notification settings - Fork 398
Function NodeDef Prototype #2401
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
base: main
Are you sure you want to change the base?
Function NodeDef Prototype #2401
Conversation
// So append them to the end of the implementation list assocaited | ||
// with any existing nodedef entry (or create a new one if does not exist). | ||
// | ||
for (const auto& [nodedefKey, appendImplementations] : nonFuncNodeDefMap) |
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.
Search order is strictly set here for definitions: functional defs first, all others after. Usage priority is decided elsewhere but generally it's a "first found" logic (per target).
For this initial check-in, we only look for child nodegraphs. Child implementations could be added if / when desired.
@@ -719,7 +719,14 @@ void NodeGraph::modifyInterfaceName(const string& inputPath, const string& inter | |||
|
|||
NodeDefPtr NodeGraph::getNodeDef() const | |||
{ | |||
NodeDefPtr nodedef = resolveNameReference<NodeDef>(getNodeDefString()); | |||
ElementPtr parent = getSelfNonConst()->getParent(); |
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.
"Backwards" search looks for parent definitions now.
@@ -156,6 +156,12 @@ void Implementation::setNodeDef(ConstNodeDefPtr nodeDef) | |||
|
|||
NodeDefPtr Implementation::getNodeDef() const | |||
{ | |||
ElementPtr parent = getSelfNonConst()->getParent(); |
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.
"Backwards" search looks for parent definitions now.
@@ -2148,56 +2148,263 @@ | |||
<input name="in1" type="float" value="0.0" /> | |||
<input name="in2" type="float" value="1.0" /> | |||
<output name="out" type="float" defaultinput="in1" /> | |||
|
|||
<nodegraph name="NG_safepower_float"> |
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.
Any / or all graphs could reside here. Both new and old mechanism still work.
Draft Implementation
This are the basic changes to handle the current "functional nodedef" proposal: #2355
Changes
DefintionOptions
options class to which contains the option to add as child or not. Default is false. Additional arguments can be added here vs a list of args in the previous interface.Documeent::addNodeDefFromGraph()
interface to takeDefinitionsOptions
as an optional argument.Tests
math_operators.mtlx
unit test file tests this definitionDefinitionOptions
.Unit Test Results
Definition Created with Sibling Reference
Definition Created with Child
Graph Editor : Std Library Definition Using Child Nodegraph
func_nodedef_safepower.mp4
Graph Editor: Created Definition Using Child Nodegraph