Skip to content

Commit

Permalink
Merged work (1441, qLab#1442, qLab#1438, qLab#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyquest committed May 4, 2024
2 parents 4f38e98 + 059dbbc commit 722c2d1
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 2 deletions.
11 changes: 11 additions & 0 deletions NetworkViewMenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,17 @@ if len(authors)>0:

<separatorItem />

<scriptItem id="pane.wsheet.select_author_me_ql">
<label>All Nodes By Me (Username Only)</label>
<scriptCode><![CDATA[
import qlibutils
sel = hou.selectedNodes()
author = qlibutils.get_current_user_name(username_only=True)
statmsg = "Selecting by author: %s" % author
qlibutils.select_netview_nodes(kwargs, lambda n: qlibutils.has_author(n, [ author ], username_only=True), statMsg=statmsg)
]]></scriptCode>
</scriptItem>

</subMenu>


Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added otls/base/attr_visualize_ql_SOP_3.otl
Binary file not shown.
Binary file removed otls/experimental/volume_vdb_visualize_ql_SOP.hda
Binary file not shown.
Binary file added otls/experimental/volume_vdb_visualize_ql_SOP.otl
Binary file not shown.
21 changes: 19 additions & 2 deletions scripts/python/qlibutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ def houVersionAsFloat():
return float( "%d.%d" % (v[0], v[1], ) )


def get_current_user_name(username_only=False):
"""Get name of the current user.
"""
username = getpass.getuser()
if username_only:
username = username.split("@")[0]
return username


def get_current_host_name():
"""Get the current host (computer) name.
"""
hostname = socket.gethostname() # socket.getfqdn() gives full name
return hostname


def statmsg(msg, warn=False):
""".
"""
Expand Down Expand Up @@ -830,6 +846,7 @@ def add_image_to_netview(image_path, pane, pwd):
nodegraphutils.saveBackgroundImages(pwd, images)



def paste_clipboard_to_netview(kwargs):
"""Paste clipboard contents (text or image) into the network editor.
"""
Expand All @@ -853,8 +870,8 @@ def paste_clipboard_to_netview(kwargs):
# TODO: refactor this into a proper function that can be called from both
date = datetime.datetime.now().replace(second=0, microsecond=0).isoformat(' ')
date = re.sub(":00$", "", date) # strip seconds
username = getpass.getuser()
hostname = socket.gethostname() # socket.getfqdn() gives full name
username = get_current_user_name()
hostname = get_current_host_name()
user = '%s@%s' % (username, hostname, ) if (shift or alt) else username
notename = "%s_%s_1" % (username, re.sub("[^0-9]+", "_", date), )
notetext = "[%s, %s]" % (user, date, )
Expand Down

0 comments on commit 722c2d1

Please sign in to comment.