Comments (3)
Yes, I believe it's just an oversight that add2.setConnectedNode('in1', None)
doesn't break the connection, and we'll fix this in an upcoming change. My sense is that this call should actually remove the input element from the node, rather than leaving the input with an empty nodename
string.
We don't yet have a high-level method that removes all invalid connections from the document, but this sounds like a good suggestion for a future improvement.
from materialx.
Your description is exactly right, and creating a new node named node1
will neatly replace the original, restoring the connection between node1
and node2
.
From a high level, the philosophy of the MaterialX API is that all document edits are local, so modifying or deleting an element in one place (e.g. node1
) doesn't edit any other elements in the document. If you'd like to remove the input element from node2
, you can delete it in the usual way by calling add2.removeInput('in1')
.
In a future update, I'd like to add support for calling add2.setConnectedNode('in1', None)
, which would perform the same work and make a clearer parallel with add2.setConnectedNode('in1', add1)
.
from materialx.
Oh I see, thank you for taking the time to explain this, the layering paradigm makes perfect sense.
Is there any general way to remove "ghost" references of this kind (or would that basically be, iterating every node, checking if it has a connection string but no connected node and pruning it at such).
I can imagine some sticky problems arising from a unexpected reference popping back into play, due to a lapse in remembering to break connections.
That's interesting that add2.setConnectedNode('in1', None)
doesn't do the equivalent of add2.removeInput('in1')
as add2.getInput('in1').setConnectedNode(None)
does prune the reference.
Would the intention be that add2.setConnectedNode('in1', None)
edits the underlying noderef?
from materialx.
Related Issues (20)
- Unable to create nodes with namespace in MaterialX Graph Editor
- UINAME in nodedefs does not work when namespace is used
- Preserve tile aspect ratio in GLSL UDIM texture atlas by allowing maxU to be any value
- Web Viewer : Crash when loading shaders with unsupported input types
- UDIMs uv_scale and uv_offset shader uniform parameters not exposed for tiledimage and UsdUVTexture nodes
- Ambiguity of nodes with omitted inputs HOT 11
- Incorrect UsdPreviewSurface opacity-metallic interaction HOT 5
- Add temporal antialiasing to MaterialX Viewer
- range node does not work with inverted output when clamp is enabled
- GlslRenderer not working in Python virtual environment HOT 19
- Incorrect implementation of SplitTB, RampTB and Ramp4 node types HOT 2
- Incorrect implementation of Convert_Vector2_Vector3 HOT 2
- MaterialX WebGL Path Tracer HOT 3
- Wrap a mtlx document into a nodedef (through API or graphEditor) HOT 7
- Graph Editor 1.38.10 does not update as 1.38.8
- Specification Query: Can top level outputs be connected to upstream nodegraph?
- Clarify ABI compatibility rules in MaterialX HOT 5
- Suggestion: Add more Global Nodes HOT 3
- Proposal: Apply convert node rules to image edge cases
- Not all math functions are documented in the specification. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from materialx.