conformtools 0.6.5 → 0.6.7
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 +18 -13
- package/dist/account-DJTD3KYK.js +3 -0
- package/dist/arriraw-YIJ3BYNN.js +525 -0
- package/dist/avid-panel/MANIFEST.json +11 -0
- package/dist/avid-panel/avid-manifest.json +46 -0
- package/dist/avid-panel/icon.svg +4 -0
- package/dist/avid-panel/icons/conformtools.svg +4 -0
- package/dist/avid-panel/index.html +26 -0
- package/dist/avid-panel/panel.css +12 -0
- package/dist/avid-panel/panel.js +7 -0
- package/dist/bridge-JQF4V3V2.js +3 -0
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/chunk-2BPR6LK6.js +3 -0
- package/dist/chunk-3D3Z4TBR.js +3 -0
- package/dist/chunk-55BKURYP.js +378 -0
- package/dist/chunk-5WEZRGXG.js +39 -0
- package/dist/chunk-6V4OEOOX.js +3 -0
- package/dist/chunk-7D7H6VFW.js +3 -0
- package/dist/chunk-A7FNR3T5.js +3 -0
- package/dist/chunk-AACY2V3L.js +3 -0
- package/dist/chunk-AMRJXYL4.js +3 -0
- package/dist/chunk-C2ESM27Z.js +3 -0
- package/dist/chunk-D4WPRRBT.js +3 -0
- package/dist/chunk-D6YDLKSA.js +3 -0
- package/dist/chunk-DKGGJM6Z.js +3 -0
- package/dist/chunk-EUBXH67N.js +7 -0
- package/dist/chunk-GK4YYKJ6.js +19 -0
- package/dist/chunk-GM6QKY7W.js +3 -0
- package/dist/chunk-J2JXLEAI.js +3 -0
- package/dist/chunk-JV7TZDKJ.js +3 -0
- package/dist/chunk-NAFLOZER.js +9 -0
- package/dist/chunk-NFJHWZJX.js +3 -0
- package/dist/chunk-NU3X7P4N.js +3 -0
- package/dist/chunk-P2LL3JMC.js +20 -0
- package/dist/chunk-PFISREY4.js +3 -0
- package/dist/chunk-PFZVET7S.js +3 -0
- package/dist/chunk-PHAMF4JF.js +4 -0
- package/dist/chunk-PLRB2YXJ.js +3 -0
- package/dist/chunk-PSANHDZM.js +3 -0
- package/dist/chunk-RGMTLNMF.js +3 -0
- package/dist/chunk-RJ6JA2LZ.js +3 -0
- package/dist/chunk-S5JDS5PQ.js +5 -0
- package/dist/chunk-SGLQY53R.js +3 -0
- package/dist/chunk-SKFMOLUO.js +8 -0
- package/dist/chunk-SNTAZJ5A.js +6 -0
- package/dist/chunk-TK55FA56.js +3 -0
- package/dist/chunk-TXQR2HI2.js +4 -0
- package/dist/chunk-VIBEEWPC.js +10 -0
- package/dist/chunk-WN53ARHJ.js +3 -0
- package/dist/chunk-XLEINKFL.js +5 -0
- package/dist/claude-setup-IIWUB4CE.js +5 -0
- package/dist/cli.js +17 -0
- package/dist/clip-state-B6JOX3JE.js +3 -0
- package/dist/conformtools-analyze +0 -0
- package/dist/conformtools-decode +0 -0
- package/dist/cr3-wasm-HLJWEV2S.js +3 -0
- package/dist/dng-wasm-CQDLPM5V.js +3 -0
- package/dist/dpx-wasm-TLGMM7BO.js +3 -0
- package/dist/engine-P6H5P6HP.js +5 -0
- package/dist/esm-SFFBP7PS.js +3 -0
- package/dist/exr-wasm-2NPKPTVB.js +3 -0
- package/dist/flame/hook/conformtools_flame/__init__.py +10 -0
- package/dist/flame/hook/conformtools_flame/building.py +191 -0
- package/dist/flame/hook/conformtools_flame/hook.py +177 -0
- package/dist/flame/hook/conformtools_flame/render.py +622 -0
- package/dist/flame/hook/conformtools_flame/util.py +33 -0
- package/dist/flame/hook/conformtools_flame/verbs.py +1037 -0
- package/dist/flame/hook/conformtools_flame_hook.py +42 -0
- package/dist/fonts/gfx/BarlowCondensed-Bold.ttf +0 -0
- package/dist/fonts/gfx/BarlowCondensed-Regular.ttf +0 -0
- package/dist/fonts/gfx/InstrumentSerif-Regular.ttf +0 -0
- package/dist/fonts/gfx/Inter-Bold.ttf +0 -0
- package/dist/fonts/gfx/Inter-Regular.ttf +0 -0
- package/dist/fonts/gfx/JetBrainsMono-Bold.ttf +0 -0
- package/dist/fonts/gfx/JetBrainsMono-Regular.ttf +0 -0
- package/dist/fonts/gfx/OFL.txt +100 -0
- package/dist/framing-SWOD4CWB.js +3 -0
- package/dist/gfx-worker.js +3 -0
- package/dist/h264-JJMZSUWW.js +3 -0
- package/dist/h264-mxf-DCUOGLDU.js +3 -0
- package/dist/host-relink-TWAF6WIG.js +10 -0
- package/dist/hosts-Z666EF7V.js +3 -0
- package/dist/http.js +5 -0
- package/dist/i2o-transfer +0 -0
- package/dist/inspect-FJKYPEXL.js +68 -0
- package/dist/isobmff-VJOWP4MH.js +3 -0
- package/dist/mc-video-5MGGOQN4.js +3 -0
- package/dist/mcp.js +13 -0
- package/dist/media-NZYVREUF.js +3 -0
- package/dist/media_core-YZ3PABEG.js +9 -0
- package/dist/media_core_bg-FDL7GJZP.js +3 -0
- package/dist/media_core_bg-XRBVKQZH.js +3 -0
- package/dist/mxf-FJSRFLJC.js +3 -0
- package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +44 -0
- package/dist/nuke/panel/python/conformtools_nuke/__init__.py +10 -0
- package/dist/nuke/panel/python/conformtools_nuke/panel.py +217 -0
- package/dist/nuke/panel/python/conformtools_nuke/verbs.py +837 -0
- package/dist/ops-X7NAREC4.js +3 -0
- package/dist/peer-kit/ctpeer/__init__.py +21 -0
- package/dist/peer-kit/ctpeer/client.py +247 -0
- package/dist/peer-kit/ctpeer/neutral.py +178 -0
- package/dist/peer-kit/ctpeer/pairing.py +139 -0
- package/dist/peer-kit/ctpeer/protocol.py +209 -0
- package/dist/peer-kit/ctpeer/websocket.py +289 -0
- package/dist/premiere-uxp/icons/panel.png +0 -0
- package/dist/premiere-uxp/icons/panel@2x.png +0 -0
- package/dist/premiere-uxp/icons/plugin.png +0 -0
- package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
- package/dist/premiere-uxp/index.html +38 -0
- package/dist/premiere-uxp/index.js +93 -0
- package/dist/premiere-uxp/lib/clipmeta.js +170 -0
- package/dist/premiere-uxp/lib/ctx.js +68 -0
- package/dist/premiere-uxp/lib/edit.js +516 -0
- package/dist/premiere-uxp/lib/handles.js +57 -0
- package/dist/premiere-uxp/lib/markers.js +198 -0
- package/dist/premiere-uxp/lib/pairing.js +67 -0
- package/dist/premiere-uxp/lib/premiere.js +91 -0
- package/dist/premiere-uxp/lib/probe.js +452 -0
- package/dist/premiere-uxp/lib/protocol.js +165 -0
- package/dist/premiere-uxp/lib/render.js +45 -0
- package/dist/premiere-uxp/lib/session.js +85 -0
- package/dist/premiere-uxp/lib/sizing.js +325 -0
- package/dist/premiere-uxp/lib/time.js +88 -0
- package/dist/premiere-uxp/lib/timeline.js +336 -0
- package/dist/premiere-uxp/lib/verbs.js +21 -0
- package/dist/premiere-uxp/lib/write.js +97 -0
- package/dist/premiere-uxp/manifest.json +102 -0
- package/dist/probe-F7WQHMIA.js +3 -0
- package/dist/prores-RIG37OIH.js +526 -0
- package/dist/r3d-CXUNG6VS.js +1025 -0
- package/dist/r3d-T5O6IIZZ.js +3 -0
- package/dist/resolve-bridge.py +2286 -0
- package/dist/resolve-presets/conform.tools.xml +127 -0
- package/dist/source-QGWWLMME.js +3 -0
- package/dist/statusline-GMMCFMOA.js +4 -0
- package/dist/statusline.js +3 -0
- package/dist/still-P4JJNTEO.js +3 -0
- package/dist/still-wasm-DN5LPASS.js +3 -0
- package/dist/store-7IOEBOZY.js +3 -0
- package/dist/tiff-wasm-BPRDR6EB.js +3 -0
- package/dist/timeline-DQG6TVPF.js +3 -0
- package/dist/timeline_core-IOENXK4Z.js +3 -0
- package/dist/timeline_core_bg-JW42YM3G.js +3 -0
- package/dist/udf_bg-B37GKRIH.js +3 -0
- package/dist/wasm/media_core_bg.wasm +0 -0
- package/dist/wasm/udf_bg.wasm +0 -0
- package/dist/wasm-threads/media_core_bg.wasm +0 -0
- package/dist/wav-64SC6P7U.js +3 -0
- package/package.json +6 -4
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"""The hook's controller: the bridge connection, Flame's main menu entry, and
|
|
2
|
+
the one preference (connect automatically when a project opens).
|
|
3
|
+
|
|
4
|
+
All Flame API calls go through `flame.schedule_idle_event` (Autodesk: an idle
|
|
5
|
+
event runs "in the main application thread" and must be quick); the bridge
|
|
6
|
+
client's own threads only wait. Nothing here runs a command, opens a path or
|
|
7
|
+
evaluates anything the app sends: requests reach `verbs.FlamePeer` methods by
|
|
8
|
+
exact name through `ctpeer.Dispatcher`, and nothing else.
|
|
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, idle_marshaller
|
|
19
|
+
|
|
20
|
+
from . import __version__
|
|
21
|
+
from .verbs import CAPABILITIES, OPTIONAL_VERBS, FlamePeer
|
|
22
|
+
|
|
23
|
+
MENU = "CONFORM.TOOLS"
|
|
24
|
+
PREFS_ENV = "CONFORM_TOOLS_FLAME_PREFS"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def prefs_path() -> str:
|
|
28
|
+
return os.environ.get(PREFS_ENV) or os.path.join(os.path.expanduser("~"), ".conformtools", "flame_hook.json")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def load_prefs(path: Optional[str] = None) -> Dict[str, Any]:
|
|
32
|
+
try:
|
|
33
|
+
with open(path or prefs_path(), "r", encoding="utf-8") as f:
|
|
34
|
+
data = json.load(f)
|
|
35
|
+
return data if isinstance(data, dict) else {}
|
|
36
|
+
except (OSError, ValueError):
|
|
37
|
+
return {}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def save_prefs(prefs: Dict[str, Any], path: Optional[str] = None) -> None:
|
|
41
|
+
path = path or prefs_path()
|
|
42
|
+
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
43
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
44
|
+
json.dump(prefs, f, indent=2)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Controller:
|
|
48
|
+
def __init__(self, flame: Any, client_factory: Callable[..., BridgeClient] = BridgeClient,
|
|
49
|
+
prefs_file: Optional[str] = None, read_pairing: Optional[Callable[[], Dict[str, Any]]] = None):
|
|
50
|
+
self.flame = flame
|
|
51
|
+
self.client_factory = client_factory
|
|
52
|
+
self.prefs_file = prefs_file
|
|
53
|
+
self.read_pairing = read_pairing
|
|
54
|
+
self.client: Optional[BridgeClient] = None
|
|
55
|
+
self.peer: Optional[FlamePeer] = None
|
|
56
|
+
self.lines: List[str] = []
|
|
57
|
+
|
|
58
|
+
# -- preferences ---------------------------------------------------------
|
|
59
|
+
@property
|
|
60
|
+
def auto_connect(self) -> bool:
|
|
61
|
+
return bool(load_prefs(self.prefs_file).get("auto_connect", False))
|
|
62
|
+
|
|
63
|
+
def set_auto_connect(self, on: bool) -> None:
|
|
64
|
+
prefs = load_prefs(self.prefs_file)
|
|
65
|
+
prefs["auto_connect"] = bool(on)
|
|
66
|
+
save_prefs(prefs, self.prefs_file)
|
|
67
|
+
|
|
68
|
+
# -- logging -------------------------------------------------------------
|
|
69
|
+
def log(self, line: str) -> None:
|
|
70
|
+
self.lines = (self.lines + [line])[-200:]
|
|
71
|
+
print(f"[{MENU}] {line}", file=sys.stderr)
|
|
72
|
+
|
|
73
|
+
def _console(self, message: str, kind: str = "info") -> None:
|
|
74
|
+
"""Flame's message bar, on the main thread."""
|
|
75
|
+
def show() -> None:
|
|
76
|
+
try:
|
|
77
|
+
self.flame.messages.show_in_console(f"{MENU}: {message}", kind, 6)
|
|
78
|
+
except Exception:
|
|
79
|
+
pass
|
|
80
|
+
try:
|
|
81
|
+
self.flame.schedule_idle_event(show)
|
|
82
|
+
except Exception:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
def _on_state(self, state: str, detail: str) -> None:
|
|
86
|
+
if state == "connected":
|
|
87
|
+
self._console("connected to the app")
|
|
88
|
+
elif state == "refused":
|
|
89
|
+
self._console(f"the app refused the connection ({detail})", "warning")
|
|
90
|
+
elif state == "unpaired" and self.client is not None and self.client.attempt == 0:
|
|
91
|
+
self._console("turn on the Host Bridge in CONFORM.TOOLS (Settings)", "warning")
|
|
92
|
+
|
|
93
|
+
# -- connection ----------------------------------------------------------
|
|
94
|
+
@property
|
|
95
|
+
def running(self) -> bool:
|
|
96
|
+
return self.client is not None
|
|
97
|
+
|
|
98
|
+
def host_info(self) -> Dict[str, Any]:
|
|
99
|
+
try:
|
|
100
|
+
version = str(self.flame.get_version())
|
|
101
|
+
except Exception:
|
|
102
|
+
version = ""
|
|
103
|
+
return {"id": "flame", "name": "Flame", "version": version, "platform": sys.platform, "plugin_version": __version__}
|
|
104
|
+
|
|
105
|
+
def connect(self) -> BridgeClient:
|
|
106
|
+
if self.client is not None:
|
|
107
|
+
return self.client
|
|
108
|
+
self.peer = FlamePeer(self.flame)
|
|
109
|
+
kwargs: Dict[str, Any] = {}
|
|
110
|
+
if self.read_pairing is not None:
|
|
111
|
+
kwargs["read_pairing"] = self.read_pairing
|
|
112
|
+
self.client = self.client_factory(
|
|
113
|
+
host=self.host_info(), capabilities=CAPABILITIES, optional_verbs=OPTIONAL_VERBS, verbs=self.peer.verbs(),
|
|
114
|
+
run_on_main=idle_marshaller(lambda fn: self.flame.schedule_idle_event(fn)),
|
|
115
|
+
log=self.log, on_state=self._on_state, **kwargs)
|
|
116
|
+
self.client.start()
|
|
117
|
+
return self.client
|
|
118
|
+
|
|
119
|
+
def disconnect(self) -> None:
|
|
120
|
+
client, self.client = self.client, None
|
|
121
|
+
if client is not None:
|
|
122
|
+
client.stop()
|
|
123
|
+
self._console("disconnected")
|
|
124
|
+
|
|
125
|
+
def status(self) -> str:
|
|
126
|
+
if self.client is None:
|
|
127
|
+
return "Not connected (the bridge connection is off)"
|
|
128
|
+
return {"connected": "Connected to CONFORM.TOOLS", "unpaired": "Waiting for the app (turn on its Host Bridge)",
|
|
129
|
+
"connecting": "Connecting...", "hello": "Connecting...", "refused": f"Refused by the app ({self.client.detail})",
|
|
130
|
+
"closed": "Waiting for the app"}.get(self.client.state, self.client.state)
|
|
131
|
+
|
|
132
|
+
def project_changed(self, project_name: Any = None) -> None:
|
|
133
|
+
"""Flame calls `app_initialized` whenever the project changes: handles
|
|
134
|
+
minted for the old project mean nothing now, so the peer starts over;
|
|
135
|
+
the app hears it as an inert event."""
|
|
136
|
+
if self.peer is not None:
|
|
137
|
+
self.peer.handles.clear()
|
|
138
|
+
if self.client is not None:
|
|
139
|
+
self.client.event("project_changed", {"project": str(project_name or "")})
|
|
140
|
+
elif self.auto_connect:
|
|
141
|
+
self.connect()
|
|
142
|
+
|
|
143
|
+
# -- the main menu ---------------------------------------------------------
|
|
144
|
+
def _show_status(self, selection: Any = None) -> None:
|
|
145
|
+
try:
|
|
146
|
+
self.flame.messages.show_in_dialog(title=MENU, message=self.status(), type="info", buttons=["OK"])
|
|
147
|
+
except Exception:
|
|
148
|
+
self.log(self.status())
|
|
149
|
+
|
|
150
|
+
def menu(self) -> List[Dict[str, Any]]:
|
|
151
|
+
return [{
|
|
152
|
+
"name": MENU,
|
|
153
|
+
"actions": [
|
|
154
|
+
{"name": "Connect to CONFORM.TOOLS", "execute": lambda sel=None: self.connect(), "isVisible": lambda sel=None: not self.running,
|
|
155
|
+
"minimumVersion": "2025"},
|
|
156
|
+
{"name": "Disconnect from CONFORM.TOOLS", "execute": lambda sel=None: self.disconnect(), "isVisible": lambda sel=None: self.running,
|
|
157
|
+
"minimumVersion": "2025"},
|
|
158
|
+
{"name": "Connection Status", "execute": self._show_status, "minimumVersion": "2025"},
|
|
159
|
+
{"name": "Connect Automatically: Turn On", "execute": lambda sel=None: self.set_auto_connect(True),
|
|
160
|
+
"isVisible": lambda sel=None: not self.auto_connect, "minimumVersion": "2025"},
|
|
161
|
+
{"name": "Connect Automatically: Turn Off", "execute": lambda sel=None: self.set_auto_connect(False),
|
|
162
|
+
"isVisible": lambda sel=None: self.auto_connect, "minimumVersion": "2025"},
|
|
163
|
+
],
|
|
164
|
+
}]
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
_controller: Optional[Controller] = None
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def controller(flame: Any = None) -> Controller:
|
|
171
|
+
"""The one controller of this Flame session."""
|
|
172
|
+
global _controller
|
|
173
|
+
if _controller is None:
|
|
174
|
+
if flame is None:
|
|
175
|
+
import flame # type: ignore # the real module, inside Flame only
|
|
176
|
+
_controller = Controller(flame)
|
|
177
|
+
return _controller
|