SideFX Houdini customization package
git clone https://git.lucas.co/hou-control.git
hc: make Set Node Shapes selection-only, like Set Node Colors
The fallback to the whole network was the last thing separating it from
its siblings, and with no status message it rewrote every node silently.
All three now read the same: the selection, or a warning that there is
none.
Co-Authored-By: Claude Opus 5 <[email protected]>
python3.13libs/hc/hcnetworkeditor.py | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/python3.13libs/hc/hcnetworkeditor.py b/python3.13libs/hc/hcnetworkeditor.py
index 4e8a341..e429aa2 100644
--- a/python3.13libs/hc/hcnetworkeditor.py
+++ b/python3.13libs/hc/hcnetworkeditor.py
@@ -1274,22 +1274,20 @@ class HCNetworkEditor(HCPathTab):
@command("Set Node Shapes")
def setNodeShapes(self):
- """Apply the configured node shape to the selection, or to the whole
- network when nothing is selected.
+ """Apply the configured node shape to the selected nodes.
- This used to take children() unconditionally, so there was no way to
- reshape a few nodes: invoking it always rewrote every node in the
- network, including the ones you had deliberately left alone. Its
- sibling Set Node Colors has always honoured the selection.
+ This used to take pwd().children() unconditionally: there was no way to
+ reshape a few nodes, and invoking it rewrote every node in the network,
+ including the ones you had deliberately left alone. It now behaves
+ exactly like its sibling Set Node Colors -- the selection, or nothing.
"""
- network = self.hou_tab.pwd()
- nodes = list(network.selectedChildren()) or list(network.children())
+ nodes = list(self.hou_tab.pwd().selectedChildren())
if not nodes:
- hou.ui.setStatusMessage("No nodes to shape",
+ hou.ui.setStatusMessage("No selected nodes to shape",
hou.severityType.Warning)
return
shape = HCSettings().nodeShape()
- # One undo for the whole batch, not one per node.
+ # One undo for the whole selection, not one per node.
with hou.undos.group("Set Node Shapes"):
for node in nodes:
node.setUserData("nodeshape", shape)