-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Description
Description
Related issues: #25074 #25240 (comment) #25498
The new nodes chaining format can cause some problems, which aren't very severe but still exist:
- Doesn't allow autocompletion (an IDE doesn't know there exists ShaderNodeObject.add() or ShadedNodeObject.sub() method)
- It can break type checking (types also don't know there exist such methods)
- It can break if a needed file is not imported before the one using. This is solvable in the internal Nodes system (just by exporting some files first) and isn't really a problem in "external" Nodes system -- i.e., for user. But it can break if a compiler/minifier decide to tree-shake a file.
The first two problems can be solved by 1) not adding very much node methods to node chaning and 2) adding such node methods to the TS types of ShaderNodeObject -- but this only resolves these problems for built-in nodes (such that their types can be added to TS) and not user-added nodes.
Possibly, then, user must create a new class that node-chaining user-defined-methods will be added to (user also manages TS types for it) -- so possibly we should add another argument to addNodeElement -- the class that a node must extend so that it can use passed method.
Solution
This is just an issue for discussing these problems.
Alternatives
N/A
Additional context
/ping @sunag @epreston @three-types