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)
- Web Viewer: When loading file that contains both surfacematerial and a nodegraph with single output, only one material is displayed HOT 3
- ESSL Shader generation COMPLETE and REDUCED options under/over expose uniforms
- SUG: Make Web Viewer more known publicly HOT 3
- WebViewer: Drag+Drop of materials with image dependencies does not work
- SUG: Add limits to standard library nodes for UI HOT 2
- MaterialX Node Editor Suggestion: Handle Nodegraph Implementations in Non-Library files.
- Add API call to convert channels attributes to nodes
- Add a default value input for geomcolor HOT 4
- Attribute `space` is ignored for `viewdirection` node HOT 1
- Versioning Numerics Of Some bxdf Nodes Incompatable With USD 23.08 HOT 4
- Names defined in MaterialX documents displace library names and cause strange behavior HOT 2
- Graph Editor: Deleting a node with multiple output does not update down-nodes properly
- Update UsdUVTexture to single-output signatures in 1.39
- Add support for disabled nodes in shader generation HOT 1
- Suggestion: Add way to determine MaterialX release used for shipped library / nodes HOT 2
- Suggestion: Publish MaterialX Core Javascript package
- 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
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.