-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.html
157 lines (155 loc) · 8.18 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html>
<head>
<title>README.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
<script>
mermaid.initialize({
startOnLoad: true,
theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
? 'dark'
: 'default'
});
</script>
<h1 id="1-profile-inspector">1. Profile Inspector</h1>
<p>A Nuke plugin that lets you visualize the profiling information in a more convenient and user-friendly manner.</p>
<ul>
<li><a href="#1-profile-inspector">1. Profile Inspector</a>
<ul>
<li><a href="#11-note">1.1. NOTE</a></li>
<li><a href="#12-installation">1.2. Installation</a></li>
<li><a href="#13-usage">1.3. Usage</a>
<ul>
<li><a href="#131-dag-tab">1.3.1. Dag tab</a></li>
<li><a href="#132-xml-report">1.3.2. XML Report</a></li>
<li><a href="#133-nuke-launcher">1.3.3. Nuke Launcher</a></li>
</ul>
</li>
<li><a href="#14-extras">1.4. Extras</a>
<ul>
<li><a href="#141-live-update">1.4.1. Live Update</a></li>
<li><a href="#142-dock-windows">1.4.2. Dock <strong>Windows</strong></a></li>
</ul>
</li>
<li><a href="#15-compatibility">1.5. Compatibility</a></li>
<li><a href="#16-test-plugin-locally">1.6. Test plugin locally</a></li>
</ul>
</li>
</ul>
<hr>
<h2 id="11-note">1.1. NOTE</h2>
<p>The plugin is mainly a case study for PySide2 and is still in early development. Also, documentation is not present, as things could change.</p>
<hr>
<h2 id="12-installation">1.2. Installation</h2>
<ol>
<li>Download the repository via the releases page or by cloning it from GitHub.</li>
<li>Move the folder inside your <em>~/.nuke</em> directory or into a custom one.</li>
<li>Write <code>import ProfileInspector</code> into your <em>menu.py</em>.</li>
</ol>
<p>NOTES</p>
<ul>
<li>If you use a custom plugin path, add the path in your <code>init.py</code>: <code>nuke.pluginAddPath('custom/path')</code></li>
<li>The folder name must be <strong>ProfileInspector</strong>.</li>
</ul>
<h2 id="13-usage">1.3. Usage</h2>
<h3 id="131-dag-tab">1.3.1. Dag tab</h3>
<p>You can use the DAG tab for two reasons:</p>
<ol>
<li>To quickly navigate between the nodes.</li>
<li>To inspect the node's profiling information.</li>
</ol>
<p>Navigate the DAG</p>
<ul>
<li>You can live filter the nodes using a regex pattern.</li>
<li>Searching a node from the table will automatically center the DAG view on the first node that matches the search.</li>
<li>You can click on a node name inside the table to open its property panel.</li>
</ul>
<p><img src="https://raw.githubusercontent.com/sisoe24/ProfileInspector/main/images/dag_navigation.gif" alt="DagNavigation"></p>
<p>Inspect profiling information.</p>
<p>The basic idea is that you can take a snapshot of the current node's timings by refreshing the table. So each time there is a change in the timings, you need to do a new refresh.</p>
<ol>
<li>Activate the profiling section by clicking on the <strong>Activate Profile Section</strong> checkbox. This action will enable some subsections and show the node's profiling timings which are likely to be at 0 if it's the first run.</li>
<li>Now you can start the profiling by clicking on the Start Profiling button.
You can update the timers with the shortcut <strong>U</strong> which will trigger the image recalculation or by adjusting some node parameters.</li>
<li>Now you can refresh the table again and save a snapshot of the current timings (timings will stay in the table even if you stop the profiling listener).</li>
<li>Bonus. Enable <a href="#172-live-update">Live update</a> and find a node to tweak. Once done, retake a snapshot by refreshing the table.</li>
</ol>
<blockquote>
<p>When Nuke starts, if the table is empty, you can refresh it by clicking the <strong>Refresh Table</strong> button. This action will take a snapshot of the current nodes present in the graph.</p>
</blockquote>
<p><img src="https://raw.githubusercontent.com/sisoe24/ProfileInspector/main/images/profiling.gif" alt="Profiling"></p>
<h3 id="132-xml-report">1.3.2. XML Report</h3>
<p>The <strong>XML Report</strong> tab can import a Nuke-created XML profile file generated from the <code>nuke -Pf</code> CLI arguments.</p>
<p>Like the DAG table, you can filter nodes, change the profiling timings, etc.</p>
<p>Usage</p>
<ol>
<li>Open a valid XML file created by Nuke.</li>
<li>Use the table to analyze the information.</li>
</ol>
<blockquote>
<p>The window can also be un-docked (see <a href="#dock-windows">dock windows</a> for more info).</p>
</blockquote>
<p><img src="https://raw.githubusercontent.com/sisoe24/ProfileInspector/main/images/xml_report.gif" alt="XmlReport"></p>
<h3 id="133-nuke-launcher">1.3.3. Nuke Launcher</h3>
<p>The <strong>Other</strong> tab offers a convenient way to launch a new Nuke instance with the profiler listener activated.</p>
<p>This method is equivalent to launching Nuke via the terminal:</p>
<pre class="hljs"><code><div>nuke.exec -Pf file.xml project.nk
</div></code></pre>
<p>Some of the options available are:</p>
<ul>
<li>Specify the Nuke executable (by default, it will use the one currently running the instance)</li>
<li>Specify the Nuke composition to launch.</li>
<li>Specify the mode in which to launch Nuke (NukeX, NukeStudio, etc.)</li>
<li>Capture the new instance output in a dockable window. (see <a href="#dock-windows">dock windows</a> for more info).</li>
<li>Add optional arguments to the execution.</li>
</ul>
<h2 id="14-extras">1.4. Extras</h2>
<h3 id="141-live-update">1.4.1. Live Update</h3>
<p>Based on my experience with other software, when I work on a single frame, I use the profiling to understand how "heavy" something is with the current parameters settings.</p>
<p>But Nuke doesn't work in that way. It keeps accumulating the timings even if the settings are turned to 0, i.e., just by moving the knob parameters up and down, the timers will increment regardless if you are using 100% or 1% of a specific parameter.</p>
<p>So the idea behind the live update is that; at each node parameter change, a callback will be triggered (via either <code>updateUI</code> or <code>knobChanged</code>), and the profiling timers will reset. Theoretically, in this way, you should see what the node is actually "consuming" with the current parameters settings.</p>
<p>If you have some insights, please let me know.</p>
<p><img src="https://raw.githubusercontent.com/sisoe24/ProfileInspector/main/images/live_update.gif" alt="LiveUpdate"></p>
<h3 id="142-dock-windows">1.4.2. Dock <strong>Windows</strong></h3>
<blockquote>
<p>This feature is a leftover prototype, and I might remove it in future updates.</p>
</blockquote>
<p>Much like the floating panel in Nuke, certain windows can be undocked for convenience.</p>
<p>To dock/un-dock simply double click on the window titlebar, drag the window or use the apposite buttons.</p>
<p><img src="https://raw.githubusercontent.com/sisoe24/ProfileInspector/main/images/dock_window.jpg" alt="DockWindow"></p>
<h2 id="15-compatibility">1.5. Compatibility</h2>
<p>Nuke version: 11,12, 13.</p>
<blockquote>
<p>Because Nuke 11 uses an early version of PySide2, future compatibility is not a guarantee.</p>
</blockquote>
<p>While it should work the same on all platforms, I have tested the plugin only on:</p>
<ul>
<li>Linux:
<ul>
<li>CentOS 8</li>
</ul>
</li>
<li>macOS:
<ul>
<li>Mojave 10.14.06</li>
<li>Catalina 10.15.07</li>
</ul>
</li>
<li>Windows 10</li>
</ul>
<h2 id="16-test-plugin-locally">1.6. Test plugin locally</h2>
<blockquote>
<p>This works only on Linux and Mac. Probably Windows WSL, but I did not try.</p>
</blockquote>
<p>While limited in some functionality, the plugin work outside the Nuke environment.</p>
<ol>
<li>Clone the GitHub repo into your machine.</li>
<li><code>pipenv install --ignore-pipfile</code> for a regular installation or <code>pipenv install --ignore-pipfile --dev -e .</code> if you want to test the code with <code>pytest</code> (Currently, no tests are present)</li>
<li>Launch the app via terminal <code>python -m tests.run_app</code> or vscode task: <code>RunApp</code>.</li>
</ol>
<p>Also, the plugin offers a simple emulation of the Nuke's internal modules inside <em>ProfileInspector/src/_nuke/fake_nuke.py</em>.</p>
</body>
</html>