conformtools 0.6.14 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/account-W7Z2MYZU.js +3 -0
- package/dist/{agent-hook-setup-RTQT5JEN.js → agent-hook-setup-JCIZG3Q3.js} +1 -1
- package/dist/{analysis-engine-UWIK7AYB.js → analysis-engine-DCHJHZ7W.js} +1 -1
- package/dist/{bridge-46P34WCD.js → bridge-RH3JRSBN.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/{chunk-CQSNVQQE.js → chunk-4RA57LTJ.js} +1 -1
- package/dist/chunk-63WQRYTJ.js +159 -0
- package/dist/chunk-6KEFHHS6.js +10 -0
- package/dist/{chunk-FXK53VEO.js → chunk-7NGS2BN7.js} +1 -1
- package/dist/{chunk-BO462NEL.js → chunk-B2KCENY6.js} +1 -1
- package/dist/chunk-DLF5AKXT.js +10 -0
- package/dist/chunk-FLLB6UZJ.js +7 -0
- package/dist/chunk-G7CVRPVA.js +5 -0
- package/dist/chunk-HTRW5GX4.js +510 -0
- package/dist/chunk-IBIAW6IW.js +6 -0
- package/dist/{chunk-YKKB27VF.js → chunk-IDJIOKXA.js} +1 -1
- package/dist/chunk-JV7TZDKJ.js +3 -0
- package/dist/chunk-OWWXUNJF.js +7 -0
- package/dist/{chunk-NZLL44HU.js → chunk-QH5DTYSE.js} +1 -1
- package/dist/{chunk-PHAMF4JF.js → chunk-ROGMKTND.js} +2 -2
- package/dist/{chunk-764P7TUD.js → chunk-TBU2XWFD.js} +1 -1
- package/dist/{chunk-6WLSIH2N.js → chunk-UAURERD3.js} +1 -1
- package/dist/{chunk-MOSLNNO5.js → chunk-UKXSKFL3.js} +1 -1
- package/dist/{chunk-L3HRAIDR.js → chunk-VERTA23P.js} +1 -1
- package/dist/{chunk-EP4L2BWV.js → chunk-VETHR2O7.js} +1 -1
- package/dist/chunk-X527E5VI.js +3 -0
- package/dist/{chunk-4BTTR6U3.js → chunk-XVZ7KJRI.js} +5 -5
- package/dist/{claude-setup-NGZ5NDYH.js → claude-setup-CM7G2YSG.js} +8 -8
- package/dist/cli.js +2 -2
- package/dist/demo-engine-WXNT4Y7S.js +3 -0
- package/dist/engine-HXZCA42S.js +5 -0
- package/dist/framing-HVUDKTZG.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-MAUQSLPY.js → h264-MAUVJTR4.js} +1 -1
- package/dist/{h264-mxf-2SZ66MPB.js → h264-mxf-2O4SAUTA.js} +1 -1
- package/dist/hook.js +1 -1
- package/dist/{host-relink-664IB3BC.js → host-relink-RI3JEY4M.js} +1 -1
- package/dist/hosted-2XACQY7J.js +3 -0
- package/dist/hosts-QW64CIJU.js +3 -0
- package/dist/http.js +3 -3
- package/dist/{inspect-ZM7IW23B.js → inspect-NUS3XAJH.js} +2 -2
- package/dist/isobmff-MTMGQKLK.js +3 -0
- package/dist/{mc-video-KMWTRVES.js → mc-video-HRZC7HGH.js} +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{media-MSMXMA6E.js → media-WC4ZVKIL.js} +1 -1
- package/dist/{mxf-GOWHEH4A.js → mxf-J5QHA3VY.js} +1 -1
- package/dist/{ops-FI2NBTYK.js → ops-XIUVNJE2.js} +1 -1
- package/dist/probe-GIAKRPFV.js +3 -0
- package/dist/{r3d-LO5Z6DEX.js → r3d-2PCOFR2Z.js} +1 -1
- package/dist/resolve-bridge.py +116 -146
- package/dist/{sequence-patch-C2QRIT5V.js → sequence-patch-DFGEAJGB.js} +1 -1
- package/dist/{still-6FU7ALUV.js → still-4UR35GZH.js} +1 -1
- package/dist/{store-JNWELX35.js → store-WZHNO43A.js} +1 -1
- package/dist/timeline-NOTHRTAT.js +3 -0
- package/package.json +5 -5
- package/dist/account-F54SG45Q.js +0 -3
- package/dist/chunk-5PTQAFU5.js +0 -158
- package/dist/chunk-BTS3DFPD.js +0 -7
- package/dist/chunk-DP4KJ3KL.js +0 -514
- package/dist/chunk-EKTETRKB.js +0 -6
- package/dist/chunk-J43UCJ6G.js +0 -4
- package/dist/chunk-MJBJI6DV.js +0 -3
- package/dist/chunk-O372NT7V.js +0 -7
- package/dist/chunk-OD445COC.js +0 -7
- package/dist/chunk-P3EOFAZR.js +0 -10
- package/dist/chunk-XI6XF7FQ.js +0 -3
- package/dist/chunk-YYR3FM6A.js +0 -5
- package/dist/engine-6ACEWA4S.js +0 -5
- package/dist/framing-4HAHAG4I.js +0 -3
- package/dist/hosted-L26AGRIY.js +0 -3
- package/dist/hosts-BGWD7BKM.js +0 -3
- package/dist/isobmff-6ZPEXUF4.js +0 -3
- package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +0 -44
- package/dist/nuke/panel/python/conformtools_nuke/__init__.py +0 -10
- package/dist/nuke/panel/python/conformtools_nuke/panel.py +0 -217
- package/dist/nuke/panel/python/conformtools_nuke/verbs.py +0 -837
- package/dist/probe-ZDX6XNRF.js +0 -3
- package/dist/resolve-presets/conform.tools.xml +0 -127
- package/dist/timeline-WVETLJZN.js +0 -3
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
"""The panel's controller (the bridge connection + one preference), the
|
|
2
|
-
dockable status panel, and the menu entries.
|
|
3
|
-
|
|
4
|
-
Every `hiero` call a request makes goes through
|
|
5
|
-
`hiero.core.executeInMainThreadWithResult` (Foundry: methods on objects
|
|
6
|
-
attached to a project throw off the main thread); the bridge client's own
|
|
7
|
-
threads only wait. Requests reach `verbs.NukePeer` methods by exact name
|
|
8
|
-
through `ctpeer.Dispatcher` and nothing else is ever run.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
from __future__ import annotations
|
|
12
|
-
|
|
13
|
-
import json
|
|
14
|
-
import os
|
|
15
|
-
import sys
|
|
16
|
-
from typing import Any, Callable, Dict, List, Optional
|
|
17
|
-
|
|
18
|
-
from ctpeer import BridgeClient
|
|
19
|
-
|
|
20
|
-
from . import __version__
|
|
21
|
-
from .verbs import CAPABILITIES, OPTIONAL_VERBS, NukePeer
|
|
22
|
-
|
|
23
|
-
TITLE = "CONFORM.TOOLS"
|
|
24
|
-
PANEL_ID = "app.conform.tools.panel"
|
|
25
|
-
PREFS_ENV = "CONFORM_TOOLS_NUKE_PREFS"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def prefs_path() -> str:
|
|
29
|
-
return os.environ.get(PREFS_ENV) or os.path.join(os.path.expanduser("~"), ".conformtools", "nuke_panel.json")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def load_prefs(path: Optional[str] = None) -> Dict[str, Any]:
|
|
33
|
-
try:
|
|
34
|
-
with open(path or prefs_path(), "r", encoding="utf-8") as f:
|
|
35
|
-
data = json.load(f)
|
|
36
|
-
return data if isinstance(data, dict) else {}
|
|
37
|
-
except (OSError, ValueError):
|
|
38
|
-
return {}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def save_prefs(prefs: Dict[str, Any], path: Optional[str] = None) -> None:
|
|
42
|
-
path = path or prefs_path()
|
|
43
|
-
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
44
|
-
with open(path, "w", encoding="utf-8") as f:
|
|
45
|
-
json.dump(prefs, f, indent=2)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class Controller:
|
|
49
|
-
def __init__(self, hiero: Any, client_factory: Callable[..., BridgeClient] = BridgeClient,
|
|
50
|
-
prefs_file: Optional[str] = None, read_pairing: Optional[Callable[[], Dict[str, Any]]] = None):
|
|
51
|
-
self.hiero = hiero
|
|
52
|
-
self.client_factory = client_factory
|
|
53
|
-
self.prefs_file = prefs_file
|
|
54
|
-
self.read_pairing = read_pairing
|
|
55
|
-
self.client: Optional[BridgeClient] = None
|
|
56
|
-
self.peer: Optional[NukePeer] = None
|
|
57
|
-
self.lines: List[str] = []
|
|
58
|
-
self.listeners: List[Callable[[str, str], None]] = []
|
|
59
|
-
|
|
60
|
-
@property
|
|
61
|
-
def auto_connect(self) -> bool:
|
|
62
|
-
return bool(load_prefs(self.prefs_file).get("auto_connect", False))
|
|
63
|
-
|
|
64
|
-
def set_auto_connect(self, on: bool) -> None:
|
|
65
|
-
prefs = load_prefs(self.prefs_file)
|
|
66
|
-
prefs["auto_connect"] = bool(on)
|
|
67
|
-
save_prefs(prefs, self.prefs_file)
|
|
68
|
-
|
|
69
|
-
def log(self, line: str) -> None:
|
|
70
|
-
self.lines = (self.lines + [line])[-200:]
|
|
71
|
-
print(f"[{TITLE}] {line}", file=sys.stderr)
|
|
72
|
-
|
|
73
|
-
def _on_state(self, state: str, detail: str) -> None:
|
|
74
|
-
for fn in list(self.listeners):
|
|
75
|
-
try:
|
|
76
|
-
fn(state, detail)
|
|
77
|
-
except Exception:
|
|
78
|
-
pass
|
|
79
|
-
|
|
80
|
-
@property
|
|
81
|
-
def running(self) -> bool:
|
|
82
|
-
return self.client is not None
|
|
83
|
-
|
|
84
|
-
def host_info(self) -> Dict[str, Any]:
|
|
85
|
-
env = getattr(self.hiero.core, "env", {}) or {}
|
|
86
|
-
version = str(env.get("VersionString") or env.get("VersionMajor") or "")
|
|
87
|
-
return {"id": "nuke", "name": "Nuke Studio", "version": version, "platform": sys.platform, "plugin_version": __version__}
|
|
88
|
-
|
|
89
|
-
def run_on_main(self, fn: Callable[[], Any]) -> Any:
|
|
90
|
-
return self.hiero.core.executeInMainThreadWithResult(fn)
|
|
91
|
-
|
|
92
|
-
def connect(self) -> BridgeClient:
|
|
93
|
-
if self.client is not None:
|
|
94
|
-
return self.client
|
|
95
|
-
self.peer = NukePeer(self.hiero)
|
|
96
|
-
kwargs: Dict[str, Any] = {}
|
|
97
|
-
if self.read_pairing is not None:
|
|
98
|
-
kwargs["read_pairing"] = self.read_pairing
|
|
99
|
-
self.client = self.client_factory(
|
|
100
|
-
host=self.host_info(), capabilities=CAPABILITIES, optional_verbs=OPTIONAL_VERBS, verbs=self.peer.verbs(),
|
|
101
|
-
run_on_main=self.run_on_main, log=self.log, on_state=self._on_state, **kwargs)
|
|
102
|
-
self.client.start()
|
|
103
|
-
return self.client
|
|
104
|
-
|
|
105
|
-
def disconnect(self) -> None:
|
|
106
|
-
client, self.client = self.client, None
|
|
107
|
-
if client is not None:
|
|
108
|
-
client.stop()
|
|
109
|
-
self._on_state("stopped", "")
|
|
110
|
-
|
|
111
|
-
def status(self) -> str:
|
|
112
|
-
if self.client is None:
|
|
113
|
-
return "Not connected"
|
|
114
|
-
return {"connected": "Connected to CONFORM.TOOLS", "unpaired": "Waiting for the app - turn on its Host Bridge (Settings)",
|
|
115
|
-
"connecting": "Connecting...", "hello": "Connecting...", "refused": f"Refused by the app ({self.client.detail})",
|
|
116
|
-
"closed": "Waiting for the app"}.get(self.client.state, self.client.state)
|
|
117
|
-
|
|
118
|
-
def project_changed(self) -> None:
|
|
119
|
-
if self.peer is not None:
|
|
120
|
-
self.peer.handles.clear()
|
|
121
|
-
if self.client is not None:
|
|
122
|
-
self.client.event("project_changed", {})
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
# ── Qt: the status panel and the menu ──────────────────────────────────────
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def qt() -> Any:
|
|
129
|
-
"""PySide6 (Nuke 16) or PySide2 (Nuke 15), as one namespace."""
|
|
130
|
-
try:
|
|
131
|
-
from PySide6 import QtCore, QtGui, QtWidgets # type: ignore
|
|
132
|
-
action = QtGui.QAction
|
|
133
|
-
except ImportError:
|
|
134
|
-
from PySide2 import QtCore, QtGui, QtWidgets # type: ignore
|
|
135
|
-
action = QtWidgets.QAction
|
|
136
|
-
ns = type("Qt", (), {})()
|
|
137
|
-
ns.QtCore, ns.QtGui, ns.QtWidgets, ns.QAction = QtCore, QtGui, QtWidgets, action
|
|
138
|
-
return ns
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
def build_panel(ctl: Controller, Q: Any) -> Any:
|
|
142
|
-
"""The dockable panel: status line, Connect / Disconnect, the
|
|
143
|
-
auto-connect checkbox. Polls the controller on a main-thread QTimer, so
|
|
144
|
-
no Qt object is ever touched from the bridge's threads."""
|
|
145
|
-
W = Q.QtWidgets
|
|
146
|
-
widget = W.QWidget()
|
|
147
|
-
widget.setObjectName(PANEL_ID)
|
|
148
|
-
widget.setWindowTitle(TITLE)
|
|
149
|
-
layout = W.QVBoxLayout(widget)
|
|
150
|
-
status = W.QLabel(ctl.status())
|
|
151
|
-
button = W.QPushButton("Connect")
|
|
152
|
-
auto = W.QCheckBox("Connect automatically when Nuke Studio starts")
|
|
153
|
-
auto.setChecked(ctl.auto_connect)
|
|
154
|
-
for w in (status, button, auto):
|
|
155
|
-
layout.addWidget(w)
|
|
156
|
-
|
|
157
|
-
def refresh() -> None:
|
|
158
|
-
status.setText(ctl.status())
|
|
159
|
-
button.setText("Disconnect" if ctl.running else "Connect")
|
|
160
|
-
|
|
161
|
-
def toggle() -> None:
|
|
162
|
-
ctl.disconnect() if ctl.running else ctl.connect()
|
|
163
|
-
refresh()
|
|
164
|
-
|
|
165
|
-
button.clicked.connect(toggle)
|
|
166
|
-
auto.toggled.connect(lambda on: ctl.set_auto_connect(bool(on)))
|
|
167
|
-
timer = Q.QtCore.QTimer(widget)
|
|
168
|
-
timer.timeout.connect(refresh)
|
|
169
|
-
timer.start(500)
|
|
170
|
-
widget._ct_refresh = refresh # kept alive with the widget; used by tests
|
|
171
|
-
widget._ct_timer = timer
|
|
172
|
-
return widget
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
def install_ui(ctl: Controller, hiero: Any, Q: Optional[Any] = None) -> Dict[str, Any]:
|
|
176
|
-
"""Register the panel with Hiero's window manager (Window menu, dockable)
|
|
177
|
-
and add CONFORM.TOOLS > Connect / Disconnect / Show Panel actions."""
|
|
178
|
-
Q = Q or qt()
|
|
179
|
-
ui = hiero.ui
|
|
180
|
-
app_cls = getattr(Q.QtWidgets, "QApplication", None)
|
|
181
|
-
if app_cls is not None and app_cls.instance() is None:
|
|
182
|
-
raise RuntimeError("no Qt application (Nuke Studio running without a GUI)")
|
|
183
|
-
panel = build_panel(ctl, Q)
|
|
184
|
-
try:
|
|
185
|
-
ui.windowManager().addWindow(panel)
|
|
186
|
-
except Exception as e:
|
|
187
|
-
ctl.log(f"panel not docked: {e}")
|
|
188
|
-
actions = {}
|
|
189
|
-
for label, fn in (("Connect", ctl.connect), ("Disconnect", ctl.disconnect),
|
|
190
|
-
("Show Panel", lambda: _show(ui, panel))):
|
|
191
|
-
act = Q.QAction(f"{label}", None)
|
|
192
|
-
act.triggered.connect(lambda checked=False, f=fn: f())
|
|
193
|
-
try:
|
|
194
|
-
ui.addMenuAction(TITLE, act)
|
|
195
|
-
except Exception as e:
|
|
196
|
-
ctl.log(f"menu action {label} not added: {e}")
|
|
197
|
-
actions[label] = act
|
|
198
|
-
return {"panel": panel, "actions": actions}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
def _show(ui: Any, panel: Any) -> None:
|
|
202
|
-
try:
|
|
203
|
-
ui.windowManager().showWindow(panel)
|
|
204
|
-
except Exception:
|
|
205
|
-
panel.show()
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
_controller: Optional[Controller] = None
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def controller(hiero: Any = None) -> Controller:
|
|
212
|
-
global _controller
|
|
213
|
-
if _controller is None:
|
|
214
|
-
if hiero is None:
|
|
215
|
-
import hiero # type: ignore # the real package, inside Nuke Studio only
|
|
216
|
-
_controller = Controller(hiero)
|
|
217
|
-
return _controller
|