Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ dmypy.json

# Intermediate Markdown generated from the README for the User Guide PDF
docs/.build/

# Local profiling harness (lives on the profiling-harness branch)
.profiling/
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,9 @@ If this bothers you, enable **Always Show All Labels** in the preferences. Nodes

## Performance

Labelmaker has been used on production scripts of substantial size without issue. The autolabel routine runs as a low-priority idle process. If you do encounter performance problems, please open a GitHub issue and include the approximate node count and any node class that seems to be the culprit.
Labelmaker has been used on production scripts of substantial size without issue. Two things keep it responsive on large scripts:

- Nuke periodically asks for every node's label again even though nothing changed (after connecting a Viewer, for example). Labelmaker answers those passes from a cache instead of rebuilding each label.
- Every time a node's label text changes, Nuke re-lays out the whole Node Graph, which on a 10 000-node script takes a noticeable fraction of a second. Labelmaker therefore never updates label text *while* you are dragging a slider or scrubbing the timeline: the readouts catch up once you pause (about half a second; a little longer on very large scripts). Labels that were answered from the cache are re-checked in the background afterwards, so anything else that changes many labels at once — a script or tool editing every selected node, say — is caught up the same way. Nodes you edit indirectly (through an expression link, or by wiring a mask input) update the next time Nuke asks for their label.

If you do encounter performance problems, please open a GitHub issue and include the approximate node count and any node class that seems to be the culprit.
Binary file modified docs/user-guide.pdf
Binary file not shown.
327 changes: 313 additions & 14 deletions labelmaker.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions labelmaker_config_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ def _on_save(self):
labelmaker.autolabeller_singleton.config = (
labelmaker_config.composed_config_singleton
)
labelmaker.autolabeller_singleton.refresh_all_labels()

saved_layer_name = self._layer_name
saved_class = self._current_class
Expand Down
13 changes: 10 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ class _StubMenuItem:
_nuke_stub.warning = lambda msg: None
_nuke_stub.addAutolabel = lambda fn: None
_nuke_stub.removeAutolabel = lambda fn: None
_nuke_stub.allNodes = lambda: []
_nuke_stub.allNodes = lambda recurseGroups=False: []
_nuke_stub.thisNode = lambda: None
_nuke_stub.expression = lambda expr: 0
_nuke_stub.toNode = lambda name: None
_nuke_stub.frame = lambda: 1
_nuke_stub.activeViewer = lambda: None
_nuke_stub.addOnCreate = lambda fn: None
_nuke_stub.removeOnCreate = lambda fn: None
_nuke_stub.addOnDestroy = lambda fn: None
_nuke_stub.removeOnDestroy = lambda fn: None
_nuke_stub.expression = lambda expr: 0.0
_nuke_stub.numvalue = lambda knob, default=0: default
_nuke_stub.knob = lambda path, value=None: None
_nuke_stub.value = lambda path, default="": default
Expand Down Expand Up @@ -99,7 +106,7 @@ def setSingleShot(self, value):
def setInterval(self, value):
pass

def start(self):
def start(self, interval=None):
pass


Expand Down
9 changes: 9 additions & 0 deletions tests/stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ def getValue(self):
def Class(self):
return self._class

def setValue(self, value):
self._value = value


class StubNode:
def __init__(self, class_name, knobs=None, xpos=0, ypos=0, width=80, height=28):
Expand Down Expand Up @@ -62,5 +65,11 @@ def name(self):
return name_knob.value()
return self._class

def fullName(self):
return self.name()

def knob(self, knob_name):
return self._knobs.get(knob_name)

def setYpos(self, value):
self._ypos = value
Loading
Loading