@field/cascade 0.8.0 → 0.11.0
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/AGENTS.md +36 -3
- package/CHANGELOG.md +401 -0
- package/DESIGN.md +14 -0
- package/README.md +41 -26
- package/dist/assets/CodeEditor-4O7FQ__R.js +623 -0
- package/dist/assets/CodePanel-BU-autmq.js +2 -0
- package/dist/assets/{CustomNodeDialog-BQbEhIwL.js → CustomNodeDialog-BRpDfOV5.js} +1 -1
- package/dist/assets/OpenGraphDialog-BwbRlC0X.js +1 -0
- package/dist/assets/ProjectSettings-DLOXLxcA.js +2 -0
- package/dist/assets/SettingsDialog-Bz8JxISH.js +1 -0
- package/dist/assets/{VersionHistoryDialog-D6VBzSQ0.js → VersionHistoryDialog-D5Z0nJ5-.js} +2 -2
- package/dist/assets/{core-BInLG4gw.js → core-Yqi0Ni61.js} +8 -8
- package/dist/assets/{cssMode-DfR2qmYG.js → cssMode-CxUzc4vp.js} +1 -1
- package/dist/assets/definitions-GreEMXLV.js +1 -0
- package/dist/assets/{editor.api-Ck8_vgQV.js → editor.api-BNFb25CX.js} +1 -1
- package/dist/assets/{freemarker2-fVn10Wn3.js → freemarker2-0ZDnWxeM.js} +1 -1
- package/dist/assets/geo-u0n_jOsD.js +1 -0
- package/dist/assets/{handlebars-BCSchLT2.js → handlebars-Cy18MoaD.js} +1 -1
- package/dist/assets/{html-CVpSv_k9.js → html-B-2Dx7nq.js} +1 -1
- package/dist/assets/{htmlMode-Da4ESTv0.js → htmlMode-DUAc9B_d.js} +1 -1
- package/dist/assets/{image-BLn--oSF.js → image-cAa-Nu9O.js} +3 -3
- package/dist/assets/index-5ZtDAuy2.js +220 -0
- package/dist/assets/index-7vae6YFC.css +1 -0
- package/dist/assets/index-client-DqYmKstU.js +1 -0
- package/dist/assets/{javascript-BpX0Gvcf.js → javascript-DeQsDqP5.js} +1 -1
- package/dist/assets/{jsonMode-CsLqaou7.js → jsonMode-BiFwJVSk.js} +1 -1
- package/dist/assets/legacy-CTEeXeqF.js +2 -0
- package/dist/assets/{liquid-efUz51Wf.js → liquid-BLoHH68a.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-DCi5-K0n.js → lspLanguageFeatures-CNFgm1Kv.js} +1 -1
- package/dist/assets/math-DioIQOPJ.js +1 -0
- package/dist/assets/{mdx-DP_sjGVy.js → mdx-CFXQVNfs.js} +1 -1
- package/dist/assets/pop-DC_TQG9t.js +1 -0
- package/dist/assets/{python-aAuP3LUi.js → python-Cf7S7p2E.js} +1 -1
- package/dist/assets/{razor-7M6sMmC5.js → razor-CMHBcG-g.js} +1 -1
- package/dist/assets/studioScenes-8sq9FfFg.js +1 -0
- package/dist/assets/{tsMode-Bf4CnoYK.js → tsMode-BEih0GDj.js} +1 -1
- package/dist/assets/{typescript-ddhYBGyT.js → typescript-COEKYD_a.js} +1 -1
- package/dist/assets/{workers-X5la8DDT.js → workers-BNhAhMNn.js} +1 -1
- package/dist/assets/{xml-BzbXa3Ps.js → xml-CPiMpnPl.js} +1 -1
- package/dist/assets/{yaml-CXs-VzxL.js → yaml-Bgp1ITLR.js} +1 -1
- package/dist/cli/Graph-ZJJTRQTM.js +2975 -0
- package/dist/cli/chunk-2KXB47FP.js +115 -0
- package/dist/cli/chunk-35D343DC.js +1447 -0
- package/dist/cli/chunk-36P5K3SD.js +631 -0
- package/dist/cli/chunk-3JTJHF7V.js +267 -0
- package/dist/cli/chunk-4UDFYF5G.js +132 -0
- package/dist/cli/chunk-53NMBJAO.js +35 -0
- package/dist/cli/chunk-A4OAMOZH.js +310 -0
- package/dist/cli/chunk-BIJO5OFS.js +71 -0
- package/dist/cli/chunk-BP7UKF36.js +376 -0
- package/dist/cli/chunk-CKS2FQWR.js +89 -0
- package/dist/cli/chunk-CO22XHNG.js +593 -0
- package/dist/cli/chunk-D6BUOHUG.js +634 -0
- package/dist/cli/chunk-DEQSEFFH.js +153 -0
- package/dist/cli/chunk-DUIUFVU2.js +241 -0
- package/dist/cli/chunk-EUIAC3U3.js +3006 -0
- package/dist/cli/chunk-FCDXJ6EK.js +2208 -0
- package/dist/cli/chunk-GFS6W3C5.js +308 -0
- package/dist/cli/chunk-HFHWYL55.js +139 -0
- package/dist/cli/chunk-HSNOBIVT.js +263 -0
- package/dist/cli/chunk-ICH7N5PN.js +26 -0
- package/dist/cli/chunk-J7VK7MNF.js +418 -0
- package/dist/cli/chunk-KH4MUBKF.js +1551 -0
- package/dist/cli/chunk-MIIEFUGG.js +623 -0
- package/dist/cli/chunk-OWWBYLHC.js +136 -0
- package/dist/cli/chunk-POMMNKZZ.js +672 -0
- package/dist/cli/chunk-QBBKRNGY.js +90 -0
- package/dist/cli/chunk-QQPA2ZHH.js +273 -0
- package/dist/cli/chunk-RLCAJBVR.js +224 -0
- package/dist/cli/chunk-RQZ4SX5R.js +1125 -0
- package/dist/cli/chunk-RUU3YWXU.js +99 -0
- package/dist/cli/chunk-RXDIMXN5.js +98 -0
- package/dist/cli/chunk-SGJAET2L.js +197 -0
- package/dist/cli/chunk-VVGSLVSF.js +151 -0
- package/dist/cli/chunk-WD62JIP6.js +118 -0
- package/dist/cli/chunk-WIH4TEIS.js +104 -0
- package/dist/cli/chunk-WKURDVYP.js +1119 -0
- package/dist/cli/chunk-WPUDGEFY.js +20 -0
- package/dist/cli/chunk-XWDSKG7N.js +1301 -0
- package/dist/cli/chunk-YAT5Y25U.js +121 -0
- package/dist/cli/chunk-ZL4JTG5Y.js +37 -0
- package/dist/cli/cliCommands-UQSFGEHF.js +3464 -0
- package/dist/cli/commands-Q23M26QM.js +1292 -0
- package/dist/cli/definitions-HF2FTHYU.js +32 -0
- package/dist/cli/doctorCommand-B7BPQMN6.js +76 -0
- package/dist/cli/edit-JHCPTQFT.js +28 -0
- package/dist/cli/editorCommands-UIF5YLUZ.js +33 -0
- package/dist/cli/encode-HAUZTYPT.js +17 -0
- package/dist/cli/frames-LSAUBZ7P.js +16 -0
- package/dist/cli/geo-4RNK3QVN.js +43 -0
- package/dist/cli/graphCommands-6BMAKGQE.js +184 -0
- package/dist/cli/graphFile-VPSQ6OF7.js +286 -0
- package/dist/cli/headlessCanvas-5XLDZT7M.js +15 -0
- package/dist/cli/helpCommand-3VRE3KVO.js +155 -0
- package/dist/cli/index.js +106 -14207
- package/dist/cli/math-ZRMLKU2D.js +16 -0
- package/dist/cli/mcp-ZLEEMYGF.js +164 -0
- package/dist/cli/parity-KINARCP2.js +328 -0
- package/dist/cli/pop-USDFXB7H.js +39 -0
- package/dist/cli/project-K3QIPGBB.js +12 -0
- package/dist/cli/projectDefinition-DMTZN2NE.js +27 -0
- package/dist/cli/projectRuntime-Z5PJOH47.js +48 -0
- package/dist/cli/registerStandardNodes-S2VLMF6J.js +3081 -0
- package/dist/cli/render-YURAPPUI.js +436 -0
- package/dist/cli/runCommand-PI764LEG.js +198 -0
- package/dist/cli/runner-RA6UKEPD.js +37 -0
- package/dist/cli/runtime/image.ts +277 -0
- package/dist/cli/runtime/stage.ts +74 -11
- package/dist/cli/stageRunner-KUNIMQKJ.js +10 -0
- package/dist/cli/verbs-RCE3K4VQ.js +19 -0
- package/dist/cli/webBuild-GT4PZT5D.js +37 -0
- package/dist/contracts/bundle.d.ts +75 -0
- package/dist/contracts/bundle.js +112 -0
- package/dist/contracts/definition.d.ts +67 -4
- package/dist/contracts/document.d.ts +29 -0
- package/dist/contracts/documentFormat.d.ts +18 -0
- package/dist/contracts/documentFormat.js +195 -0
- package/dist/contracts/editor.d.ts +189 -0
- package/dist/contracts/editor.js +2 -0
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/validate.js +59 -3
- package/dist/contracts/values.d.ts +3 -3
- package/dist/contracts/values.js +1 -0
- package/dist/image.d.ts +141 -0
- package/dist/image.js +127 -0
- package/dist/index.html +4 -4
- package/dist/player/app.js +17 -5
- package/dist/player/editor.js +1919 -0
- package/dist/player/editorEngine.js +477 -0
- package/dist/runtime/builtins/core/bundle.d.ts +70 -0
- package/dist/runtime/builtins/core/bundle.js +81 -0
- package/dist/runtime/builtins/core/index.d.ts +3 -2
- package/dist/runtime/builtins/core/index.js +6 -2
- package/dist/runtime/builtins/core/routing.d.ts +27 -0
- package/dist/runtime/builtins/core/routing.js +28 -0
- package/dist/runtime/builtins/headless.d.ts +19 -0
- package/dist/runtime/builtins/headless.js +25 -0
- package/dist/runtime/builtins/image/contactSheet.d.ts +226 -0
- package/dist/runtime/builtins/image/contactSheet.js +199 -0
- package/dist/runtime/builtins/image/index.d.ts +9 -0
- package/dist/runtime/builtins/image/index.js +9 -0
- package/dist/runtime/edit/document.d.ts +94 -0
- package/dist/runtime/edit/document.js +194 -0
- package/dist/runtime/edit/graphEditor.d.ts +223 -0
- package/dist/runtime/edit/graphEditor.js +893 -0
- package/dist/runtime/edit/index.d.ts +12 -0
- package/dist/runtime/edit/index.js +6 -0
- package/dist/runtime/edit/layout.d.ts +50 -0
- package/dist/runtime/edit/layout.js +126 -0
- package/dist/runtime/edit/operations.d.ts +65 -0
- package/dist/runtime/edit/operations.js +57 -0
- package/dist/runtime/edit/parameters.d.ts +75 -0
- package/dist/runtime/edit/parameters.js +284 -0
- package/dist/runtime/edit/read.d.ts +35 -0
- package/dist/runtime/edit/read.js +65 -0
- package/dist/runtime/editor/index.d.ts +104 -0
- package/dist/runtime/editor/index.js +439 -0
- package/dist/runtime/expressions/bundlePaths.d.ts +37 -0
- package/dist/runtime/expressions/bundlePaths.js +55 -0
- package/dist/runtime/expressions/index.d.ts +2 -0
- package/dist/runtime/expressions/index.js +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/params/animator.d.ts +5 -0
- package/dist/runtime/params/animator.js +16 -0
- package/dist/runtime/runtime.js +238 -12
- package/dist/runtime/seed.d.ts +29 -0
- package/dist/runtime/seed.js +52 -0
- package/dist/runtime/types.d.ts +12 -0
- package/dist/stage.js +43 -9
- package/dist/studio/panel.d.ts +2 -0
- package/doc/CLI_REFERENCE.md +171 -0
- package/doc/EDITOR_EXPORT.md +235 -0
- package/doc/HEADLESS_GPU.md +27 -0
- package/doc/MCP.md +69 -0
- package/doc/NODE_REFERENCE.md +208 -0
- package/doc/PROJECT_AUTHORING.md +258 -1
- package/package.json +29 -8
- package/dist/assets/CodeEditor-BEk-kIBd.js +0 -623
- package/dist/assets/CodePanel-CeSdjXkg.js +0 -2
- package/dist/assets/ExportDialog-CjTbbTZJ.js +0 -358
- package/dist/assets/ExportDialog-DOq0flMV.css +0 -1
- package/dist/assets/OpenGraphDialog-DCwH9itM.js +0 -1
- package/dist/assets/ProjectSettings-Dg7M5xt9.js +0 -2
- package/dist/assets/SettingsDialog-e7GgsjB9.js +0 -1
- package/dist/assets/definitions-DZpOjWKR.js +0 -1
- package/dist/assets/geo-D2VPjAdt.js +0 -1
- package/dist/assets/index-CMiBdEuT.js +0 -212
- package/dist/assets/index-DMIuml9a.css +0 -1
- package/dist/assets/index-client-BI2H82FJ.js +0 -1
- package/dist/assets/legacy-ZA7textG.js +0 -2
- package/dist/assets/math-B6hpxPJO.js +0 -1
- package/dist/assets/pop-CYUIjT6x.js +0 -1
- package/dist/assets/projectSettingsApi-C1WvIwfP.js +0 -1
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
import {
|
|
2
|
+
randomRegistration,
|
|
3
|
+
remapRegistration
|
|
4
|
+
} from "./chunk-RXDIMXN5.js";
|
|
5
|
+
import {
|
|
6
|
+
lookAtRotation
|
|
7
|
+
} from "./chunk-DEQSEFFH.js";
|
|
8
|
+
|
|
9
|
+
// packages/runtime/src/builtins/core/bundle.ts
|
|
10
|
+
var pickDefinition = {
|
|
11
|
+
apiVersion: 1,
|
|
12
|
+
runsOn: "portable",
|
|
13
|
+
label: "Pick",
|
|
14
|
+
description: "Reads one field of a bundle",
|
|
15
|
+
icon: "ListFilter",
|
|
16
|
+
inputs: {
|
|
17
|
+
bundle: { kind: "data", type: "bundle" }
|
|
18
|
+
},
|
|
19
|
+
outputs: {
|
|
20
|
+
value: { kind: "data", type: "any" }
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
field: { type: "string", default: "", label: "Field" }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var packDefinition = {
|
|
27
|
+
apiVersion: 1,
|
|
28
|
+
runsOn: "portable",
|
|
29
|
+
label: "Pack",
|
|
30
|
+
description: "Collects inputs into a bundle, one named field each",
|
|
31
|
+
icon: "Package",
|
|
32
|
+
inputs: {
|
|
33
|
+
inputs: { kind: "data", type: "any", variadic: true }
|
|
34
|
+
},
|
|
35
|
+
outputs: {
|
|
36
|
+
bundle: { kind: "data", type: "bundle" }
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
names: {
|
|
40
|
+
type: "string",
|
|
41
|
+
default: "",
|
|
42
|
+
label: "Field names",
|
|
43
|
+
description: "Comma-separated, one per input in order; an unnamed input becomes field_<n>"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
function packFieldNames(names, count) {
|
|
48
|
+
const declared = String(names ?? "").split(",").map((name) => name.trim());
|
|
49
|
+
return Array.from({ length: count }, (_, index) => declared[index] || `field_${index}`);
|
|
50
|
+
}
|
|
51
|
+
var pickRegistration = {
|
|
52
|
+
kind: "definition-v1",
|
|
53
|
+
moduleId: "cascade.core.Pick",
|
|
54
|
+
definition: pickDefinition,
|
|
55
|
+
loadExecute: async () => ({ inputs, outputs, props }) => {
|
|
56
|
+
const bundle = inputs.bundle;
|
|
57
|
+
const field = props.field.trim();
|
|
58
|
+
outputs.value.set(
|
|
59
|
+
bundle && field && Object.prototype.hasOwnProperty.call(bundle, field) ? bundle[field] : null
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var packRegistration = {
|
|
64
|
+
kind: "definition-v1",
|
|
65
|
+
moduleId: "cascade.core.Pack",
|
|
66
|
+
definition: packDefinition,
|
|
67
|
+
loadExecute: async () => ({ inputs, outputs, props }) => {
|
|
68
|
+
const values = inputs.inputs;
|
|
69
|
+
const names = packFieldNames(props.names, values.length);
|
|
70
|
+
const bundle = {};
|
|
71
|
+
names.forEach((name, index) => {
|
|
72
|
+
if (values[index] !== void 0) bundle[name] = values[index];
|
|
73
|
+
});
|
|
74
|
+
outputs.bundle.set(bundle);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// packages/contracts/src/camera.ts
|
|
79
|
+
var CAMERA_DEFAULTS = Object.freeze({
|
|
80
|
+
translate: [0, 0, 0],
|
|
81
|
+
rotate: [0, 0, 0],
|
|
82
|
+
focal: 50,
|
|
83
|
+
aperture: 41.4214,
|
|
84
|
+
near: 1e-3,
|
|
85
|
+
far: 1e4,
|
|
86
|
+
resolution: [1280, 720],
|
|
87
|
+
aspect: 1,
|
|
88
|
+
projection: "perspective",
|
|
89
|
+
orthowidth: 2
|
|
90
|
+
});
|
|
91
|
+
function isCamera(value) {
|
|
92
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
const candidate = value;
|
|
96
|
+
return Array.isArray(candidate.translate) && Array.isArray(candidate.rotate) && typeof candidate.focal === "number" && typeof candidate.aperture === "number";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// packages/runtime/src/builtins/core/camera.ts
|
|
100
|
+
var cameraDefinition = {
|
|
101
|
+
apiVersion: 1,
|
|
102
|
+
label: "Camera",
|
|
103
|
+
description: "A camera, following Houdini's /obj/cam.",
|
|
104
|
+
icon: "Video",
|
|
105
|
+
runsOn: "portable",
|
|
106
|
+
inputs: {
|
|
107
|
+
translate: {
|
|
108
|
+
kind: "data",
|
|
109
|
+
type: "vec3",
|
|
110
|
+
default: [0, 0, 5],
|
|
111
|
+
description: "World position."
|
|
112
|
+
},
|
|
113
|
+
rotate: {
|
|
114
|
+
kind: "data",
|
|
115
|
+
type: "vec3",
|
|
116
|
+
default: [0, 0, 0],
|
|
117
|
+
description: "Degrees, XYZ order. The camera looks down its own -Z."
|
|
118
|
+
},
|
|
119
|
+
focal: {
|
|
120
|
+
kind: "data",
|
|
121
|
+
type: "float",
|
|
122
|
+
default: 50,
|
|
123
|
+
min: 1,
|
|
124
|
+
max: 300,
|
|
125
|
+
description: "Focal length in millimetres."
|
|
126
|
+
},
|
|
127
|
+
lookat: {
|
|
128
|
+
kind: "data",
|
|
129
|
+
type: "vec3",
|
|
130
|
+
default: [0, 0, 0],
|
|
131
|
+
description: "Point to aim at. Used only when Look At is on, and it replaces Rotate."
|
|
132
|
+
},
|
|
133
|
+
up: {
|
|
134
|
+
kind: "data",
|
|
135
|
+
type: "vec3",
|
|
136
|
+
default: [0, 1, 0],
|
|
137
|
+
description: "Up vector for Look At."
|
|
138
|
+
},
|
|
139
|
+
spin: {
|
|
140
|
+
kind: "data",
|
|
141
|
+
type: "float",
|
|
142
|
+
default: 0,
|
|
143
|
+
description: "Degrees added to the Y rotation, after Look At. For turntables."
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
outputs: {
|
|
147
|
+
camera: { kind: "data", type: "camera" }
|
|
148
|
+
},
|
|
149
|
+
props: {
|
|
150
|
+
lookAt: {
|
|
151
|
+
type: "bool",
|
|
152
|
+
default: false,
|
|
153
|
+
label: "Look At",
|
|
154
|
+
description: "Aim at the Look At point instead of using Rotate."
|
|
155
|
+
},
|
|
156
|
+
aperture: {
|
|
157
|
+
type: "float",
|
|
158
|
+
default: 41.4214,
|
|
159
|
+
min: 1,
|
|
160
|
+
max: 200,
|
|
161
|
+
label: "Aperture",
|
|
162
|
+
description: "Horizontal aperture in millimetres. With the default focal length this is a 45 degree view."
|
|
163
|
+
},
|
|
164
|
+
resolution: {
|
|
165
|
+
type: "vec2i",
|
|
166
|
+
default: [1280, 720],
|
|
167
|
+
label: "Resolution",
|
|
168
|
+
description: "Frame size in pixels. The vertical field of view is derived from this."
|
|
169
|
+
},
|
|
170
|
+
aspect: {
|
|
171
|
+
type: "float",
|
|
172
|
+
default: 1,
|
|
173
|
+
min: 0.1,
|
|
174
|
+
max: 10,
|
|
175
|
+
label: "Pixel Aspect",
|
|
176
|
+
description: "The aspect of one pixel, not of the frame."
|
|
177
|
+
},
|
|
178
|
+
projection: {
|
|
179
|
+
type: "string",
|
|
180
|
+
default: "perspective",
|
|
181
|
+
label: "Projection",
|
|
182
|
+
control: "select",
|
|
183
|
+
options: [
|
|
184
|
+
{ value: "perspective", label: "Perspective" },
|
|
185
|
+
{ value: "orthographic", label: "Orthographic" }
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
orthowidth: {
|
|
189
|
+
type: "float",
|
|
190
|
+
default: 2,
|
|
191
|
+
min: 0.01,
|
|
192
|
+
label: "Ortho Width",
|
|
193
|
+
description: "Width of the orthographic frame in world units."
|
|
194
|
+
},
|
|
195
|
+
near: { type: "float", default: 1e-3, min: 0, label: "Near Clip" },
|
|
196
|
+
far: { type: "float", default: 1e4, min: 0, label: "Far Clip" }
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
function executeCamera(context) {
|
|
200
|
+
const { translate, rotate, focal, lookat, up, spin } = context.inputs;
|
|
201
|
+
const props = context.props;
|
|
202
|
+
const aimed = props.lookAt ? lookAtRotation(translate, lookat, up) : rotate;
|
|
203
|
+
const oriented = spin === 0 ? aimed : [aimed[0], aimed[1] + spin, aimed[2]];
|
|
204
|
+
const camera = {
|
|
205
|
+
...CAMERA_DEFAULTS,
|
|
206
|
+
translate,
|
|
207
|
+
rotate: oriented,
|
|
208
|
+
focal,
|
|
209
|
+
aperture: props.aperture,
|
|
210
|
+
resolution: props.resolution,
|
|
211
|
+
aspect: props.aspect,
|
|
212
|
+
projection: props.projection === "orthographic" ? "orthographic" : "perspective",
|
|
213
|
+
orthowidth: props.orthowidth,
|
|
214
|
+
near: props.near,
|
|
215
|
+
far: props.far
|
|
216
|
+
};
|
|
217
|
+
context.outputs.camera.set(camera);
|
|
218
|
+
}
|
|
219
|
+
var cameraRegistration = {
|
|
220
|
+
kind: "definition-v1",
|
|
221
|
+
moduleId: "cascade.core.Camera",
|
|
222
|
+
definition: cameraDefinition,
|
|
223
|
+
loadExecute: async () => executeCamera
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// packages/runtime/src/builtins/core/routing.ts
|
|
227
|
+
var switchDefinition = {
|
|
228
|
+
apiVersion: 1,
|
|
229
|
+
runsOn: "portable",
|
|
230
|
+
label: "Switch",
|
|
231
|
+
description: "Selects one input by index",
|
|
232
|
+
icon: "GitBranch",
|
|
233
|
+
inputs: {
|
|
234
|
+
inputs: { kind: "data", type: "any", variadic: true }
|
|
235
|
+
},
|
|
236
|
+
outputs: {
|
|
237
|
+
output: { kind: "data", type: "any" }
|
|
238
|
+
},
|
|
239
|
+
props: {
|
|
240
|
+
index: { type: "int", default: 0, min: 0, step: 1 }
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var mergeDefinition = {
|
|
244
|
+
apiVersion: 1,
|
|
245
|
+
runsOn: "portable",
|
|
246
|
+
label: "Merge",
|
|
247
|
+
description: "Collects inputs into an array",
|
|
248
|
+
icon: "GitMerge",
|
|
249
|
+
inputs: {
|
|
250
|
+
inputs: { kind: "data", type: "any", variadic: true }
|
|
251
|
+
},
|
|
252
|
+
outputs: {
|
|
253
|
+
output: { kind: "data", type: "array" }
|
|
254
|
+
},
|
|
255
|
+
props: {
|
|
256
|
+
append: { type: "bool", default: false }
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var selectDefinition = {
|
|
260
|
+
apiVersion: 1,
|
|
261
|
+
runsOn: "portable",
|
|
262
|
+
label: "Select",
|
|
263
|
+
description: "Selects an array item by index",
|
|
264
|
+
icon: "ListFilter",
|
|
265
|
+
inputs: {
|
|
266
|
+
array: { kind: "data", type: "array", default: [] }
|
|
267
|
+
},
|
|
268
|
+
outputs: {
|
|
269
|
+
item: { kind: "data", type: "any" },
|
|
270
|
+
count: { kind: "data", type: "int" }
|
|
271
|
+
},
|
|
272
|
+
props: {
|
|
273
|
+
index: { type: "int", default: 0, min: 0, step: 1 },
|
|
274
|
+
wrap: { type: "bool", default: true }
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
var nullDefinition = {
|
|
278
|
+
apiVersion: 1,
|
|
279
|
+
runsOn: "portable",
|
|
280
|
+
label: "Null",
|
|
281
|
+
description: "Passes its input through unchanged",
|
|
282
|
+
icon: "Circle",
|
|
283
|
+
inputs: {
|
|
284
|
+
input: { kind: "data", type: "any", default: null }
|
|
285
|
+
},
|
|
286
|
+
outputs: {
|
|
287
|
+
output: { kind: "data", type: "any" }
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var frozenDefinition = {
|
|
291
|
+
apiVersion: 1,
|
|
292
|
+
runsOn: "portable",
|
|
293
|
+
label: "Frozen",
|
|
294
|
+
description: "Emits a frozen snapshot of a data source's chosen values",
|
|
295
|
+
icon: "Snowflake",
|
|
296
|
+
outputs: {
|
|
297
|
+
value: { kind: "data", type: "any" }
|
|
298
|
+
},
|
|
299
|
+
props: {
|
|
300
|
+
value: { type: "any", default: null }
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
var frozenRegistration = {
|
|
304
|
+
kind: "definition-v1",
|
|
305
|
+
moduleId: "cascade.core.Frozen",
|
|
306
|
+
definition: frozenDefinition,
|
|
307
|
+
loadExecute: async () => ({ outputs, props }) => {
|
|
308
|
+
outputs.value.set(props.value);
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
var switchRegistration = {
|
|
312
|
+
kind: "definition-v1",
|
|
313
|
+
moduleId: "cascade.core.Switch",
|
|
314
|
+
definition: switchDefinition,
|
|
315
|
+
loadExecute: async () => ({ inputs, outputs, props }) => {
|
|
316
|
+
const values = inputs.inputs;
|
|
317
|
+
if (!values.length) {
|
|
318
|
+
outputs.output.set(null);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const index = Math.max(0, Math.min(props.index, values.length - 1));
|
|
322
|
+
outputs.output.set(values[index]);
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
var mergeRegistration = {
|
|
326
|
+
kind: "definition-v1",
|
|
327
|
+
moduleId: "cascade.core.Merge",
|
|
328
|
+
definition: mergeDefinition,
|
|
329
|
+
loadExecute: async () => ({ inputs, outputs, props }) => {
|
|
330
|
+
const values = inputs.inputs.filter((value) => value !== null);
|
|
331
|
+
outputs.output.set(
|
|
332
|
+
props.append && Array.isArray(values[0]) ? [...values[0], ...values.slice(1)] : values
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var selectRegistration = {
|
|
337
|
+
kind: "definition-v1",
|
|
338
|
+
moduleId: "cascade.core.Select",
|
|
339
|
+
definition: selectDefinition,
|
|
340
|
+
loadExecute: async () => ({ inputs, outputs, props }) => {
|
|
341
|
+
const count = inputs.array.length;
|
|
342
|
+
outputs.count.set(count);
|
|
343
|
+
if (!count) {
|
|
344
|
+
outputs.item.set(null);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
const index = props.wrap ? (props.index % count + count) % count : Math.max(0, Math.min(props.index, count - 1));
|
|
348
|
+
outputs.item.set(inputs.array[index]);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
var nullRegistration = {
|
|
352
|
+
kind: "definition-v1",
|
|
353
|
+
moduleId: "cascade.core.Null",
|
|
354
|
+
definition: nullDefinition,
|
|
355
|
+
loadExecute: async () => ({ inputs, outputs }) => {
|
|
356
|
+
outputs.output.set(inputs.input);
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
// packages/runtime/src/builtins/core/structural.ts
|
|
361
|
+
var inputDefinition = {
|
|
362
|
+
apiVersion: 1,
|
|
363
|
+
runsOn: "portable",
|
|
364
|
+
label: "Input",
|
|
365
|
+
description: "Defines a public graph or subnet input",
|
|
366
|
+
icon: "LogIn",
|
|
367
|
+
inputs: {
|
|
368
|
+
value: { kind: "data", type: "any", default: null }
|
|
369
|
+
},
|
|
370
|
+
outputs: {
|
|
371
|
+
output: { kind: "data", type: "any" }
|
|
372
|
+
},
|
|
373
|
+
props: {
|
|
374
|
+
inputIndex: { type: "int", default: 0, min: 0, step: 1 },
|
|
375
|
+
inputName: { type: "string", default: "" },
|
|
376
|
+
dataType: { type: "string", default: "any" }
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
var outputDefinition = {
|
|
380
|
+
apiVersion: 1,
|
|
381
|
+
runsOn: "portable",
|
|
382
|
+
label: "Output",
|
|
383
|
+
description: "Defines a public graph or subnet output",
|
|
384
|
+
icon: "LogOut",
|
|
385
|
+
inputs: {
|
|
386
|
+
input: { kind: "data", type: "any", default: null }
|
|
387
|
+
},
|
|
388
|
+
outputs: {
|
|
389
|
+
output: { kind: "data", type: "any" }
|
|
390
|
+
},
|
|
391
|
+
props: {
|
|
392
|
+
outputIndex: { type: "int", default: 0, min: 0, step: 1 },
|
|
393
|
+
outputName: { type: "string", default: "" },
|
|
394
|
+
dataType: { type: "string", default: "any" }
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
var subnetDefinition = {
|
|
398
|
+
apiVersion: 1,
|
|
399
|
+
runsOn: "portable",
|
|
400
|
+
container: "subnet",
|
|
401
|
+
label: "Subnet",
|
|
402
|
+
description: "Contains a nested deterministic graph",
|
|
403
|
+
icon: "Folder"
|
|
404
|
+
};
|
|
405
|
+
var feedbackDefinition = {
|
|
406
|
+
apiVersion: 1,
|
|
407
|
+
runsOn: "portable",
|
|
408
|
+
container: "feedback",
|
|
409
|
+
label: "Feedback",
|
|
410
|
+
description: "Runs its contents once per step, carrying the previous result forward.",
|
|
411
|
+
icon: "Repeat",
|
|
412
|
+
inputs: {
|
|
413
|
+
initial: {
|
|
414
|
+
kind: "data",
|
|
415
|
+
type: "any",
|
|
416
|
+
default: null,
|
|
417
|
+
description: "The state the first step starts from."
|
|
418
|
+
},
|
|
419
|
+
steps: {
|
|
420
|
+
kind: "data",
|
|
421
|
+
type: "int",
|
|
422
|
+
default: 1,
|
|
423
|
+
min: 0,
|
|
424
|
+
description: "How many times the contents run. Drive it from a Time node."
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
outputs: {
|
|
428
|
+
result: {
|
|
429
|
+
kind: "data",
|
|
430
|
+
type: "any",
|
|
431
|
+
description: "The last step's result, or `initial` when steps is zero."
|
|
432
|
+
},
|
|
433
|
+
/**
|
|
434
|
+
* Every kept step, oldest first.
|
|
435
|
+
*
|
|
436
|
+
* This exists because **a trail needs the history, not the final state**,
|
|
437
|
+
* and nothing outside the loop could reconstruct it: a downstream node sees
|
|
438
|
+
* one frame, which draws nothing. Houdini's Trail SOP has the same
|
|
439
|
+
* requirement and solves it the same way, by being given the frames.
|
|
440
|
+
*
|
|
441
|
+
* Empty unless `history` is non-zero, because the alternative is a
|
|
442
|
+
* simulation that quietly holds 120 copies of its own geometry — and at
|
|
443
|
+
* a few thousand particles that is the difference between a preview and a
|
|
444
|
+
* tab that runs out of memory.
|
|
445
|
+
*/
|
|
446
|
+
history: {
|
|
447
|
+
kind: "data",
|
|
448
|
+
type: "array",
|
|
449
|
+
description: "The kept step results, oldest first. Empty unless History is set."
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
props: {
|
|
453
|
+
/**
|
|
454
|
+
* How many step results to keep, newest-biased: `0` keeps none, `N` keeps
|
|
455
|
+
* the last `N`.
|
|
456
|
+
*
|
|
457
|
+
* A prop rather than an input because it is structural — how much memory
|
|
458
|
+
* this loop is allowed — rather than something to animate. It is also a
|
|
459
|
+
* cap rather than a flag on purpose: "keep everything" is not offered,
|
|
460
|
+
* because the honest version of that is a number somebody chose.
|
|
461
|
+
*/
|
|
462
|
+
history: {
|
|
463
|
+
type: "int",
|
|
464
|
+
default: 0,
|
|
465
|
+
min: 0,
|
|
466
|
+
max: 1e5,
|
|
467
|
+
label: "History",
|
|
468
|
+
description: "Keep the last N step results on the history output. 0 keeps none."
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
var previousDefinition = {
|
|
473
|
+
apiVersion: 1,
|
|
474
|
+
runsOn: "portable",
|
|
475
|
+
label: "Previous",
|
|
476
|
+
description: "The previous step's state, inside a Feedback container. The first step gets the container's initial value.",
|
|
477
|
+
icon: "Rewind",
|
|
478
|
+
inputs: {
|
|
479
|
+
initial: {
|
|
480
|
+
kind: "data",
|
|
481
|
+
type: "any",
|
|
482
|
+
default: null,
|
|
483
|
+
description: "Used only outside a Feedback container."
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
outputs: {
|
|
487
|
+
value: { kind: "data", type: "any", description: "The carried state." },
|
|
488
|
+
step: { kind: "data", type: "int", description: "Zero-based step index." }
|
|
489
|
+
},
|
|
490
|
+
props: {}
|
|
491
|
+
};
|
|
492
|
+
var inputRegistration = {
|
|
493
|
+
kind: "definition-v1",
|
|
494
|
+
moduleId: "cascade.core.Input",
|
|
495
|
+
definition: inputDefinition,
|
|
496
|
+
loadExecute: async () => ({ inputs, outputs }) => outputs.output.set(inputs.value)
|
|
497
|
+
};
|
|
498
|
+
var outputRegistration = {
|
|
499
|
+
kind: "definition-v1",
|
|
500
|
+
moduleId: "cascade.core.Output",
|
|
501
|
+
definition: outputDefinition,
|
|
502
|
+
loadExecute: async () => ({ inputs, outputs }) => outputs.output.set(inputs.input)
|
|
503
|
+
};
|
|
504
|
+
var subnetRegistration = {
|
|
505
|
+
kind: "definition-v1",
|
|
506
|
+
moduleId: "cascade.core.Subnet",
|
|
507
|
+
definition: subnetDefinition,
|
|
508
|
+
loadExecute: async () => () => {
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
var feedbackRegistration = {
|
|
512
|
+
kind: "definition-v1",
|
|
513
|
+
moduleId: "cascade.core.Feedback",
|
|
514
|
+
definition: feedbackDefinition,
|
|
515
|
+
loadExecute: async () => () => {
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
var previousRegistration = {
|
|
519
|
+
kind: "definition-v1",
|
|
520
|
+
moduleId: "cascade.core.Previous",
|
|
521
|
+
definition: previousDefinition,
|
|
522
|
+
loadExecute: async () => ({ inputs, outputs }) => {
|
|
523
|
+
outputs.value.set(inputs.initial);
|
|
524
|
+
outputs.step.set(0);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
// packages/runtime/src/builtins/core/time.ts
|
|
529
|
+
var timeDefinition = {
|
|
530
|
+
apiVersion: 1,
|
|
531
|
+
label: "Time",
|
|
532
|
+
description: "The current frame and time, as values the graph can read.",
|
|
533
|
+
icon: "Clock",
|
|
534
|
+
runsOn: "portable",
|
|
535
|
+
inputs: {},
|
|
536
|
+
outputs: {
|
|
537
|
+
/**
|
|
538
|
+
* The whole frame, as an integer — Houdini's `$F`.
|
|
539
|
+
*
|
|
540
|
+
* An `int` rather than a `float`, and that is the point of having two
|
|
541
|
+
* outputs. Anything that **counts** frames needs an integer: a feedback
|
|
542
|
+
* container's step count, a sequence index, a modulo. Narrowing is never
|
|
543
|
+
* implicit in Cascade, so a float frame simply could not be wired to a step
|
|
544
|
+
* count, and the alternative — truncating silently somewhere downstream —
|
|
545
|
+
* is a simulation running 3 steps when the graph said 3.7.
|
|
546
|
+
*/
|
|
547
|
+
frame: {
|
|
548
|
+
kind: "data",
|
|
549
|
+
type: "int",
|
|
550
|
+
description: "The whole frame. Houdini's $F."
|
|
551
|
+
},
|
|
552
|
+
/** The fractional frame — Houdini's `$FF`. For anything that moves. */
|
|
553
|
+
fframe: {
|
|
554
|
+
kind: "data",
|
|
555
|
+
type: "float",
|
|
556
|
+
description: "The fractional frame, for sub-frame motion. Houdini's $FF."
|
|
557
|
+
},
|
|
558
|
+
time: {
|
|
559
|
+
kind: "data",
|
|
560
|
+
type: "float",
|
|
561
|
+
description: "The playhead in seconds."
|
|
562
|
+
}
|
|
563
|
+
},
|
|
564
|
+
props: {
|
|
565
|
+
frame: {
|
|
566
|
+
type: "int",
|
|
567
|
+
default: 1,
|
|
568
|
+
expression: "$F",
|
|
569
|
+
label: "Frame",
|
|
570
|
+
description: "Bound to $F. Replace with a number to pin a still, or with any expression."
|
|
571
|
+
},
|
|
572
|
+
fframe: {
|
|
573
|
+
type: "float",
|
|
574
|
+
default: 1,
|
|
575
|
+
expression: "$FF",
|
|
576
|
+
label: "Fractional Frame",
|
|
577
|
+
description: "Bound to $FF."
|
|
578
|
+
},
|
|
579
|
+
time: {
|
|
580
|
+
type: "float",
|
|
581
|
+
default: 0,
|
|
582
|
+
expression: "$T",
|
|
583
|
+
label: "Time",
|
|
584
|
+
description: "Bound to $T, in seconds."
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
function executeTime(context) {
|
|
589
|
+
context.outputs.frame.set(context.props.frame);
|
|
590
|
+
context.outputs.fframe.set(context.props.fframe);
|
|
591
|
+
context.outputs.time.set(context.props.time);
|
|
592
|
+
}
|
|
593
|
+
var timeRegistration = {
|
|
594
|
+
kind: "definition-v1",
|
|
595
|
+
moduleId: "cascade.core.Time",
|
|
596
|
+
definition: timeDefinition,
|
|
597
|
+
loadExecute: async () => executeTime
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
// packages/runtime/src/builtins/core/index.ts
|
|
601
|
+
var coreNodeRegistrations = Object.freeze([
|
|
602
|
+
subnetRegistration,
|
|
603
|
+
inputRegistration,
|
|
604
|
+
outputRegistration,
|
|
605
|
+
switchRegistration,
|
|
606
|
+
mergeRegistration,
|
|
607
|
+
nullRegistration,
|
|
608
|
+
selectRegistration,
|
|
609
|
+
pickRegistration,
|
|
610
|
+
packRegistration,
|
|
611
|
+
randomRegistration,
|
|
612
|
+
remapRegistration,
|
|
613
|
+
cameraRegistration,
|
|
614
|
+
timeRegistration,
|
|
615
|
+
feedbackRegistration,
|
|
616
|
+
previousRegistration,
|
|
617
|
+
frozenRegistration
|
|
618
|
+
]);
|
|
619
|
+
var registrationsById = new Map(
|
|
620
|
+
coreNodeRegistrations.map((registration) => [registration.moduleId, registration])
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
export {
|
|
624
|
+
isCamera,
|
|
625
|
+
pickRegistration,
|
|
626
|
+
packRegistration,
|
|
627
|
+
cameraRegistration,
|
|
628
|
+
frozenRegistration,
|
|
629
|
+
feedbackRegistration,
|
|
630
|
+
previousRegistration,
|
|
631
|
+
timeRegistration,
|
|
632
|
+
coreNodeRegistrations
|
|
633
|
+
};
|
|
634
|
+
//# sourceMappingURL=chunk-D6BUOHUG.js.map
|