def toggleStats(): if nuke.usingPerformanceTimers(): disableStats() else: enableStats()
def resetStats(): if not nuke.usingPerformanceTimers(): enableStats() nuke.resetPerformanceTimers()
m.addCommand( "Proxy Mode", "nuke.toNode(\"root\").knob(\"proxy\").setValue(not nuke.toNode(\"root\").knob(\"proxy\").value())", "^p") m.addCommand("-", "", "") m.addCommand("Render All Write Nodes...", "nukescripts.showRenderDialog([nuke.root()], False)", "F5") m.addCommand("Render Selected Write Nodes...", "nukescripts.showRenderDialog(nuke.selectedNodes(), False)", "F7") m.addCommand("Cancel", "nuke.cancel()", "0xff1b") m.addCommand("-", "", "") m.addCommand("Flipbook Selected", "nukescripts.showFlipbookDialogForSelected()", "#F") # Performance monitor if nuke.usingPerformanceTimers(): m = menubar.addMenu("Performance") m.addCommand("Clear performance timers", "nuke.resetPerformanceTimers()") m.addCommand("Start performance timers", "nuke.startPerformanceTimers()") m.addCommand("Stop performance timers", "nuke.stopPerformanceTimers()") m = menubar.addMenu("Cache") m.addCommand( "Buffer Report", "nuke.display(\"nukescripts.cache_report(str())\", nuke.root(), width = 800)" ) m.addCommand("Clear Buffers", "nukescripts.cache_clear(\"\")", "F12") m.addCommand("Clear Disk Cache", nuke.clearDiskCache) m.addCommand("Clear Playback Cache", nuke.clearRAMCache) m.addCommand("Clear All", nukescripts.clearAllCaches) m.addCommand("-", "", "")