Skip to content

Commit e2f8fb6

Browse files
committed
Merged work (#324, #822, #820, #821)
2 parents 83de859 + 9e2e326 commit e2f8fb6

9 files changed

Lines changed: 40 additions & 1 deletion

OPmenu.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,29 @@
4949
<menuDocument>
5050

5151
<menu>
52-
<subMenu id="comment_submenu_ql">
52+
<subMenu id="opmenu.actions_menu">
53+
<scriptItem id="opmenu.select_node_same_type_ql">
54+
<modifyItem><insertAfter>opmenu.select_node</insertAfter></modifyItem>
55+
<label>Select All of Same Type [qL]</label>
56+
<scriptCode><![CDATA[
57+
import qlibutils;
58+
sel = qlibutils.find_same_nodes([kwargs['node']])
59+
for s in sel:
60+
s.setSelected(True)
61+
]]></scriptCode>
62+
</scriptItem>
63+
64+
<separatorItem id="opmenu.select_node_same_type_sep_ql">
65+
<modifyItem><insertAfter>opmenu.select_node_same_type_ql</insertAfter></modifyItem>
66+
</separatorItem>
67+
</subMenu>
68+
69+
<separatorItem id="comment_submenu_sep_ql">
5370
<modifyItem><insertAfter>opmenu.actions_menu</insertAfter></modifyItem>
71+
</separatorItem>
72+
73+
<subMenu id="comment_submenu_ql">
74+
<modifyItem><insertAfter>comment_submenu_sep_ql</insertAfter></modifyItem>
5475
<label>Comment [qL]</label>
5576

5677
<!-- steal original "edit comment" item TODO: replace with own -->
868 Bytes
Binary file not shown.
870 Bytes
Binary file not shown.
870 Bytes
Binary file not shown.
872 Bytes
Binary file not shown.
-22 Bytes
Binary file not shown.
3.41 KB
Binary file not shown.

otls/future/velocity_ql_SOP.otl

325 KB
Binary file not shown.

scripts/python/qlibutils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,21 @@ def remove_embedded_hdas():
383383

384384
if do_it==0:
385385
hou.hda.uninstallFile("Embedded")
386+
387+
388+
def find_same_nodes(nodes):
389+
"""Find the same node types in a network.
390+
"""
391+
392+
def type_name(n):
393+
"""Build a (not exactly correct) full typename (but without the asset version)."""
394+
return "::".join(n.type().nameComponents()[0:-1])
395+
396+
r = []
397+
types = set()
398+
for n in nodes:
399+
types.add(type_name(n))
400+
401+
all = nodes[0].parent().children()
402+
r = [ n for n in all if type_name(n) in types ]
403+
return r

0 commit comments

Comments
 (0)