thanks man these are nice. he is using polycut, nice use case for this node
Anyone know the nodegraphtitle.py trick? I searched here but there is no mention of it. If you override this file in your user directory, you can have custom stats on the network editor like this (top left).
I use this code:
“`python from __future__ import print_function import hou import nodegraphprefs as prefs
def networkEditorTitleLeft(editor): try: title = ‘\n’
#title += “Viewport\n\n”
selectedNodes = hou.selectedNodes() if len(selectedNodes) == 1 and hou.ui.updateMode() == hou.updateMode.AutoUpdate: currentNode = selectedNodes[0] nodePath = currentNode.path()
#title += str(len(currentNode.geometry().points())) ptcount = int(hou.hscriptExpression(“npoints(\”” + nodePath + “\”)”)) primcount = int(hou.hscriptExpression(“nprims(\”” + nodePath + “\”)”))
title += str(f'{ptcount:,}’) + ” points\n” title += str(f'{primcount:,}’) + ” prims\n\n”
opinfo = hou.hscript(“opinfo -n ” + nodePath)[0]
if “Memory: ” in opinfo: memory = opinfo.split(“Memory: “)[1].split(“\n”)[0] if ‘;’ in memory: # Split the text at the first ‘;’ occurrence parts = memory.split(‘;’, 1) # Rejoin with the second part encapsulated in parentheses memory = f”{parts[0]} ({parts[1].strip()})” title += memory + “\n”
cooktime = opinfo.split(“Last Cook Time: “)[1].split(“\n”)[0] title += cooktime + “\n\n”
screenbounds = editor.screenBounds() # Figure out how much we need to scale the current bounds to get to # a zoom level of 100 pixels per network editor unit. bounds = editor.visibleBounds() currentzoom = editor.screenBounds().size().x() / bounds.size().x() title += “{:0.2f}%\n”.format(currentzoom)
“`
“`python pwd = editor.pwd() playerparm = pwd.parm(‘isplayer’) if playerparm is not None and playerparm.evalAsInt() != 0: title += ‘Network in Playback Mode\n’ if prefs.showPerfStats(editor): profile = hou.perfMon.activeProfile() if profile is not None: profiletitle = profile.title() if not profiletitle: profiletitle = ‘Profile ‘ + str(profile.id()) title += profiletitle + ‘: ‘ + prefs.perfStatName(editor)
except: title = ”
return title
def networkEditorTitleRight(editor): try: title = ” pwd = editor.pwd() title += pwd.childTypeCategory().label()
except: title = ”
return title “`
Attachments in this post:
http://fx-td.com/houdiniandchill/wp-content/uploads/discord/20251010/18/25/image.png