@field/cascade 0.11.0 → 0.13.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 +8 -5
- package/ARCHITECTURE.md +5 -4
- package/CHANGELOG.md +245 -0
- package/README.md +1 -1
- package/dist/assets/AgentPanel-1JugFjE4.css +1 -0
- package/dist/assets/AgentPanel-BDL5MddA.js +5 -0
- package/dist/assets/{CodeEditor-4O7FQ__R.js → CodeEditor-C-xYG-Wn.js} +120 -120
- package/dist/assets/CodePanel-CtXd50m6.js +2 -0
- package/dist/assets/CookInfoPanel-B3NMhKJF.css +1 -0
- package/dist/assets/CookInfoPanel-DG4_TRsX.js +2 -0
- package/dist/assets/CustomNodeDialog-CHfZUs-r.js +1 -0
- package/dist/assets/DefinitionNode-CaRTXQ_b.js +1 -0
- package/dist/assets/DefinitionPanel-C3CxZY9r.js +1 -0
- package/dist/assets/DefinitionPanel-VNLnAiQD.css +1 -0
- package/dist/assets/OpenGraphDialog-BLdr6k_q.js +1 -0
- package/dist/assets/ProjectSettings-ZnvmIAir.js +2 -0
- package/dist/assets/{SettingsDialog-Bz8JxISH.js → SettingsDialog-CBX3Wa87.js} +1 -1
- package/dist/assets/TimelinePanel-CDeR0arY.css +1 -0
- package/dist/assets/TimelinePanel-CWgnFH1e.js +1 -0
- package/dist/assets/{VersionHistoryDialog-D5Z0nJ5-.js → VersionHistoryDialog-BOSoW1R-.js} +1 -1
- package/dist/assets/assert-BO2_erPD.js +1 -0
- package/dist/assets/assert-hvykGCnP.js +1 -0
- package/dist/assets/builder-BmBKcDix.js +1 -0
- package/dist/assets/camera-DFF7YA3F.js +1 -0
- package/dist/assets/checks-DAvyO9Gf.js +1 -0
- package/dist/assets/contactSheet-N1NcaWxw.js +2 -0
- package/dist/assets/{core-Yqi0Ni61.js → core-DB-MkGjj.js} +3 -4
- package/dist/assets/coreTypes-DtnDATZ7.js +1 -0
- package/dist/assets/{cssMode-CxUzc4vp.js → cssMode-DPVckSOc.js} +1 -1
- package/dist/assets/definitions-B227e7f_.js +1 -0
- package/dist/assets/definitions-D0WOUJd7.js +1 -0
- package/dist/assets/{editor.api-BNFb25CX.js → editor.api-Dkutg_Z1.js} +1 -1
- package/dist/assets/expressions-X-Z-GrgW.js +5 -0
- package/dist/assets/file-DAL6IfjV.js +1 -0
- package/dist/assets/filters-D3k1LRMa.js +1 -0
- package/dist/assets/{freemarker2-0ZDnWxeM.js → freemarker2-CLiLKk3B.js} +1 -1
- package/dist/assets/generators-BhDxRAFC.js +1 -0
- package/dist/assets/geo-BsMImJIJ.js +1 -0
- package/dist/assets/geo-C4YngDob.js +2 -0
- package/dist/assets/{handlebars-Cy18MoaD.js → handlebars-CcD3aMeL.js} +1 -1
- package/dist/assets/{html-B-2Dx7nq.js → html-DvZWGfqb.js} +1 -1
- package/dist/assets/{htmlMode-DUAc9B_d.js → htmlMode-DUD3VaoN.js} +1 -1
- package/dist/assets/image-0SfH-snh.js +1 -0
- package/dist/assets/image-Ck-RdGU4.js +2 -0
- package/dist/assets/index-BWnrmIB9.js +137 -0
- package/dist/assets/index-DIaxEONI.css +1 -0
- package/dist/assets/io-BGmt2g0D.js +1 -0
- package/dist/assets/{javascript-DeQsDqP5.js → javascript-Cap2ahgh.js} +1 -1
- package/dist/assets/{jsonMode-BiFwJVSk.js → jsonMode-B0uLjp9C.js} +1 -1
- package/dist/assets/{liquid-BLoHH68a.js → liquid-CnxwhfLn.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-CNFgm1Kv.js → lspLanguageFeatures-Dn9hlKX6.js} +1 -1
- package/dist/assets/math-GeULS-sk.js +1 -0
- package/dist/assets/{mdx-CFXQVNfs.js → mdx-BV3jbrVa.js} +1 -1
- package/dist/assets/pop-KMF_qloi.js +1 -0
- package/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/dist/assets/{python-Cf7S7p2E.js → python-CGyFk4XK.js} +1 -1
- package/dist/assets/{razor-CMHBcG-g.js → razor-CQfzX3-N.js} +1 -1
- package/dist/assets/remap-5SjXQU-q.js +1 -0
- package/dist/assets/renderMarkdown-ork0Oir7.js +67 -0
- package/dist/assets/studioImages-CAyH-0Pl.js +1 -0
- package/dist/assets/text-ZpX7qNkx.js +2 -0
- package/dist/assets/time-P_OiBhcf.js +1 -0
- package/dist/assets/{tsMode-BEih0GDj.js → tsMode-BOeXzO9H.js} +1 -1
- package/dist/assets/{typescript-COEKYD_a.js → typescript-J1SnE_Tu.js} +1 -1
- package/dist/assets/{workers-BNhAhMNn.js → workers-CYwwTiVF.js} +1 -1
- package/dist/assets/{xml-CPiMpnPl.js → xml-DnPRNzK9.js} +1 -1
- package/dist/assets/{yaml-Bgp1ITLR.js → yaml-BmmYBNa9.js} +1 -1
- package/dist/cli/DefinitionNode-P7AA4TAU.js +15 -0
- package/dist/cli/{Graph-ZJJTRQTM.js → Graph-OB6EWSGL.js} +12 -12
- package/dist/cli/assert-GROGQNCQ.js +25 -0
- package/dist/cli/checks-3WB44XBL.js +189 -0
- package/dist/cli/{chunk-3JTJHF7V.js → chunk-2L34ERS2.js} +4 -4
- package/dist/cli/chunk-53LGFPWX.js +138 -0
- package/dist/cli/chunk-5ORUQ6ES.js +267 -0
- package/dist/cli/{chunk-YAT5Y25U.js → chunk-7QE2ZNSN.js} +3 -3
- package/dist/cli/{chunk-SGJAET2L.js → chunk-BPODRH52.js} +8 -4
- package/dist/cli/{chunk-XWDSKG7N.js → chunk-BZ63XQ3I.js} +2 -2
- package/dist/cli/{chunk-FCDXJ6EK.js → chunk-CTPLRSWF.js} +2 -13
- package/dist/cli/{chunk-WIH4TEIS.js → chunk-EZRWJ4G2.js} +1 -1
- package/dist/cli/{chunk-BIJO5OFS.js → chunk-FWMSGKEH.js} +1 -1
- package/dist/cli/{chunk-POMMNKZZ.js → chunk-G23A2BZZ.js} +38 -5
- package/dist/cli/{chunk-35D343DC.js → chunk-GRIN2DDP.js} +19 -1
- package/dist/cli/{chunk-WKURDVYP.js → chunk-JEW5MPGI.js} +28 -331
- package/dist/cli/chunk-JVOCK5W4.js +83 -0
- package/dist/cli/chunk-KBGUO27Q.js +15 -0
- package/dist/cli/{chunk-GFS6W3C5.js → chunk-L6B6FUQP.js} +54 -32
- package/dist/cli/chunk-LTXWBXOM.js +438 -0
- package/dist/cli/chunk-MI5JLQYA.js +220 -0
- package/dist/cli/{chunk-A4OAMOZH.js → chunk-NJFMDXHR.js} +13 -3
- package/dist/cli/{chunk-DUIUFVU2.js → chunk-OBZAP3GG.js} +49 -23
- package/dist/cli/chunk-QAGATJGE.js +336 -0
- package/dist/cli/{chunk-EUIAC3U3.js → chunk-QKL7CCRS.js} +966 -132
- package/dist/cli/{chunk-RLCAJBVR.js → chunk-TJW67QSI.js} +8 -7
- package/dist/cli/{chunk-RQZ4SX5R.js → chunk-W5PJ5RMP.js} +156 -84
- package/dist/cli/chunk-W7OUAT7J.js +122 -0
- package/dist/cli/chunk-WGKPJZDY.js +364 -0
- package/dist/cli/{chunk-D6BUOHUG.js → chunk-X4WKAOQP.js} +4 -4
- package/dist/cli/{chunk-VVGSLVSF.js → chunk-X566FWBV.js} +6 -1
- package/dist/cli/chunk-YH637PDL.js +317 -0
- package/dist/cli/chunk-ZSCUZE6I.js +112 -0
- package/dist/cli/{cliCommands-UQSFGEHF.js → cliCommands-XVFRD7CF.js} +23 -17
- package/dist/cli/{commands-Q23M26QM.js → commands-M2XLTPTZ.js} +129 -47
- package/dist/cli/contactSheet-2PQVRUFW.js +11 -0
- package/dist/cli/{definitions-HF2FTHYU.js → definitions-BPOPW52L.js} +7 -7
- package/dist/cli/{doctorCommand-B7BPQMN6.js → doctorCommand-RAEI7GVY.js} +36 -6
- package/dist/cli/{edit-JHCPTQFT.js → edit-S5KEQ5RA.js} +3 -3
- package/dist/cli/editorCommands-5BBG4S6V.js +41 -0
- package/dist/cli/{encode-HAUZTYPT.js → encode-ICPEPMH5.js} +2 -2
- package/dist/cli/file-3HTQHPYQ.js +41 -0
- package/dist/cli/filters-6ODFWYK4.js +379 -0
- package/dist/cli/generators-YU7GB4MD.js +210 -0
- package/dist/cli/{geo-4RNK3QVN.js → geo-6ZPGKZRU.js} +7 -7
- package/dist/cli/{graphCommands-6BMAKGQE.js → graphCommands-MULQ7VD2.js} +4 -4
- package/dist/cli/{graphFile-VPSQ6OF7.js → graphFile-CITF36ZM.js} +25 -19
- package/dist/cli/{headlessCanvas-5XLDZT7M.js → headlessCanvas-ENRHC7GS.js} +3 -2
- package/dist/cli/{helpCommand-3VRE3KVO.js → helpCommand-X2QDANM3.js} +9 -7
- package/dist/cli/image-TXELZZK5.js +55 -0
- package/dist/cli/index.js +14 -14
- package/dist/cli/{math-ZRMLKU2D.js → math-RSYRQ3C6.js} +5 -5
- package/dist/cli/{mcp-ZLEEMYGF.js → mcp-YRIGRLYQ.js} +4 -4
- package/dist/cli/{parity-KINARCP2.js → parity-3N3HTKWX.js} +42 -36
- package/dist/cli/{pop-USDFXB7H.js → pop-B7SIIYKN.js} +5 -5
- package/dist/cli/project-SJF5ZF3F.js +12 -0
- package/dist/cli/{projectDefinition-DMTZN2NE.js → projectDefinition-F3D7UIHJ.js} +8 -8
- package/dist/cli/{projectRuntime-Z5PJOH47.js → projectRuntime-NY4XMDFH.js} +19 -12
- package/dist/cli/registerStandardNodes-BXJCB6E4.js +744 -0
- package/dist/cli/{render-YURAPPUI.js → render-Y23W6MY6.js} +29 -22
- package/dist/cli/{runCommand-PI764LEG.js → runCommand-XOG7AVC5.js} +3 -3
- package/dist/cli/runner-DNJO5WO2.js +43 -0
- package/dist/cli/runtime/image.ts +27 -2
- package/dist/cli/runtime/io.ts +78 -0
- package/dist/cli/share-B7HTCOJX.js +166 -0
- package/dist/cli/stageCache-TY2BFZJR.js +15 -0
- package/dist/cli/{stageRunner-KUNIMQKJ.js → stageRunner-KY2EJP7X.js} +2 -2
- package/dist/cli/text-MB3EKR4H.js +126 -0
- package/dist/cli/{verbs-RCE3K4VQ.js → verbs-PI2JH5FI.js} +2 -2
- package/dist/cli/webBuild-2K4COCGY.js +44 -0
- package/dist/contracts/capabilities.d.ts +39 -1
- package/dist/contracts/color.d.ts +8 -0
- package/dist/contracts/color.js +23 -0
- package/dist/contracts/definition.d.ts +10 -0
- package/dist/contracts/schema.d.ts +1 -1
- package/dist/contracts/schema.js +1 -0
- package/dist/contracts/validate.js +11 -1
- package/dist/contracts/values.d.ts +24 -0
- package/dist/image.d.ts +15 -0
- package/dist/image.js +36 -2
- package/dist/index.html +8 -2
- package/dist/io.d.ts +29 -0
- package/dist/io.js +40 -0
- package/dist/player/app.js +11 -7
- package/dist/player/editor.js +3 -2
- package/dist/player/editorEngine.js +3 -2
- package/dist/player/embed.js +2 -0
- package/dist/player/types.d.ts +6 -0
- package/dist/runtime/builtins/assert/checks.d.ts +18 -0
- package/dist/runtime/builtins/assert/checks.js +207 -0
- package/dist/runtime/builtins/assert/definitions.d.ts +130 -0
- package/dist/runtime/builtins/assert/definitions.js +54 -0
- package/dist/runtime/builtins/assert/index.d.ts +152 -0
- package/dist/runtime/builtins/assert/index.js +36 -0
- package/dist/runtime/builtins/image/contactSheet.d.ts +3 -165
- package/dist/runtime/builtins/image/contactSheet.js +0 -49
- package/dist/runtime/builtins/image/definitions.d.ts +950 -0
- package/dist/runtime/builtins/image/definitions.js +343 -0
- package/dist/runtime/builtins/image/file.d.ts +8 -0
- package/dist/runtime/builtins/image/file.js +37 -0
- package/dist/runtime/builtins/image/filters.d.ts +8 -0
- package/dist/runtime/builtins/image/filters.js +394 -0
- package/dist/runtime/builtins/image/generators.d.ts +7 -0
- package/dist/runtime/builtins/image/generators.js +144 -0
- package/dist/runtime/builtins/image/index.d.ts +947 -4
- package/dist/runtime/builtins/image/index.js +41 -6
- package/dist/runtime/builtins/image/io.d.ts +100 -0
- package/dist/runtime/builtins/image/io.js +142 -0
- package/dist/runtime/builtins/image/planar.d.ts +55 -0
- package/dist/runtime/builtins/image/planar.js +274 -0
- package/dist/runtime/builtins/image/simplex.d.ts +22 -0
- package/dist/runtime/builtins/image/simplex.js +92 -0
- package/dist/runtime/builtins/image/text.d.ts +4 -0
- package/dist/runtime/builtins/image/text.js +141 -0
- package/dist/runtime/builtins/index.d.ts +3 -0
- package/dist/runtime/builtins/index.js +7 -0
- package/dist/runtime/definition/architecture.js +89 -0
- package/dist/runtime/gpu.d.ts +25 -0
- package/dist/runtime/gpu.js +40 -0
- package/dist/runtime/runtime.d.ts +2 -0
- package/dist/runtime/runtime.js +268 -44
- package/dist/runtime/types.d.ts +30 -0
- package/doc/CLI_REFERENCE.md +21 -3
- package/doc/EDITOR_EXPORT.md +26 -0
- package/doc/MCP.md +2 -1
- package/doc/NODE_REFERENCE.md +286 -14
- package/doc/PROJECT_AUTHORING.md +158 -4
- package/doc/WEB_PLAYER.md +9 -1
- package/package.json +4 -1
- package/dist/assets/CodePanel-BU-autmq.js +0 -2
- package/dist/assets/CustomNodeDialog-BRpDfOV5.js +0 -1
- package/dist/assets/OpenGraphDialog-BwbRlC0X.js +0 -1
- package/dist/assets/ProjectSettings-DLOXLxcA.js +0 -2
- package/dist/assets/definitions-GreEMXLV.js +0 -1
- package/dist/assets/geo-u0n_jOsD.js +0 -1
- package/dist/assets/image-cAa-Nu9O.js +0 -2062
- package/dist/assets/index-5ZtDAuy2.js +0 -220
- package/dist/assets/index-7vae6YFC.css +0 -1
- package/dist/assets/math-DioIQOPJ.js +0 -1
- package/dist/assets/pop-DC_TQG9t.js +0 -1
- package/dist/cli/chunk-36P5K3SD.js +0 -631
- package/dist/cli/chunk-4UDFYF5G.js +0 -132
- package/dist/cli/chunk-53NMBJAO.js +0 -35
- package/dist/cli/chunk-MIIEFUGG.js +0 -623
- package/dist/cli/chunk-QBBKRNGY.js +0 -90
- package/dist/cli/chunk-WPUDGEFY.js +0 -20
- package/dist/cli/editorCommands-UIF5YLUZ.js +0 -33
- package/dist/cli/project-K3QIPGBB.js +0 -12
- package/dist/cli/registerStandardNodes-S2VLMF6J.js +0 -3081
- package/dist/cli/runner-RA6UKEPD.js +0 -37
- package/dist/cli/webBuild-GT4PZT5D.js +0 -37
- package/dist/runtime/builtins/headless.d.ts +0 -19
- package/dist/runtime/builtins/headless.js +0 -25
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
// packages/runtime/src/builtins/image/definitions.ts
|
|
2
|
+
var contactSheetDefinition = {
|
|
3
|
+
apiVersion: 1,
|
|
4
|
+
label: "Contact Sheet",
|
|
5
|
+
description: "Lay images out as one labelled grid.",
|
|
6
|
+
icon: "LayoutGrid",
|
|
7
|
+
runsOn: "portable",
|
|
8
|
+
capabilities: ["assets"],
|
|
9
|
+
inputs: {
|
|
10
|
+
images: { kind: "data", type: "image", variadic: true },
|
|
11
|
+
/** More images after the wired ones: image values or project-relative paths. */
|
|
12
|
+
list: { kind: "data", type: "array" }
|
|
13
|
+
},
|
|
14
|
+
outputs: {
|
|
15
|
+
image: { kind: "data", type: "image" },
|
|
16
|
+
asset: { kind: "data", type: "asset" }
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
columns: { type: "int", default: 0, min: 0, max: 64, description: "0: as square as the count allows." },
|
|
20
|
+
gap: { type: "int", default: 16, min: 0, max: 512 },
|
|
21
|
+
background: { type: "color", default: [1, 1, 1, 1], label: "Background" },
|
|
22
|
+
cellWidth: { type: "int", default: 0, min: 0, max: 8192, description: "0: images at their own size. Otherwise each is scaled to fit this width." },
|
|
23
|
+
labels: { type: "string", default: "", description: "One label per line, in image order." },
|
|
24
|
+
labelSize: { type: "int", default: 14, min: 6, max: 128 },
|
|
25
|
+
labelColor: { type: "color", default: [0.1, 0.1, 0.1, 1], label: "Label Colour" },
|
|
26
|
+
filename: { type: "string", default: "contact-sheet.png", label: "Filename" }
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var colorDefinition = {
|
|
30
|
+
apiVersion: 1,
|
|
31
|
+
label: "Color",
|
|
32
|
+
description: "A solid colour.",
|
|
33
|
+
icon: "Square",
|
|
34
|
+
runsOn: "portable",
|
|
35
|
+
capabilities: ["assets"],
|
|
36
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
37
|
+
props: {
|
|
38
|
+
color: { type: "color", default: [1, 1, 1, 1], label: "Color" },
|
|
39
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var checkersDefinition = {
|
|
43
|
+
apiVersion: 1,
|
|
44
|
+
label: "Checkers",
|
|
45
|
+
description: "A checkerboard.",
|
|
46
|
+
icon: "Grid",
|
|
47
|
+
runsOn: "portable",
|
|
48
|
+
capabilities: ["assets"],
|
|
49
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
50
|
+
props: {
|
|
51
|
+
color1: { type: "color", default: [1, 1, 1, 1], label: "Color 1" },
|
|
52
|
+
color2: { type: "color", default: [0, 0, 0, 1], label: "Color 2" },
|
|
53
|
+
mode: {
|
|
54
|
+
type: "string",
|
|
55
|
+
default: "size",
|
|
56
|
+
label: "Mode",
|
|
57
|
+
control: "select",
|
|
58
|
+
options: [{ value: "size", label: "Size" }, { value: "divisions", label: "Divisions" }]
|
|
59
|
+
},
|
|
60
|
+
size: { type: "float", default: 32, min: 1, max: 512, step: 0.1, label: "Size", description: "Cell size in pixels (mode Size)." },
|
|
61
|
+
divisions: { type: "int", default: 16, min: 1, max: 512, step: 1, label: "Divisions", description: "Cells across (mode Divisions)." },
|
|
62
|
+
centered: { type: "bool", default: false, label: "Centered" },
|
|
63
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" }
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var noiseDefinition = {
|
|
67
|
+
apiVersion: 1,
|
|
68
|
+
label: "Noise",
|
|
69
|
+
description: "Fractal simplex noise, grey.",
|
|
70
|
+
icon: "Cloud",
|
|
71
|
+
runsOn: "portable",
|
|
72
|
+
capabilities: ["assets"],
|
|
73
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
74
|
+
props: {
|
|
75
|
+
seed: { type: "int", default: 0, min: 0, max: 1e4, step: 1, label: "Seed" },
|
|
76
|
+
scale: { type: "float", default: 0.01, min: 1e-3, max: 1, step: 1e-3, label: "Scale" },
|
|
77
|
+
iterations: { type: "int", default: 4, min: 1, max: 8, step: 1, label: "Iterations" },
|
|
78
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" }
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var rampDefinition = {
|
|
82
|
+
apiVersion: 1,
|
|
83
|
+
label: "Ramp",
|
|
84
|
+
description: "A colour ramp: horizontal, vertical, radial or concentric.",
|
|
85
|
+
icon: "Gradient",
|
|
86
|
+
runsOn: "portable",
|
|
87
|
+
capabilities: ["assets"],
|
|
88
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
89
|
+
props: {
|
|
90
|
+
type: {
|
|
91
|
+
type: "string",
|
|
92
|
+
default: "horizontal",
|
|
93
|
+
label: "Type",
|
|
94
|
+
control: "select",
|
|
95
|
+
options: [
|
|
96
|
+
{ value: "horizontal", label: "Horizontal" },
|
|
97
|
+
{ value: "vertical", label: "Vertical" },
|
|
98
|
+
{ value: "radial", label: "Radial" },
|
|
99
|
+
{ value: "concentric", label: "Concentric" }
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
points: {
|
|
103
|
+
type: "array",
|
|
104
|
+
label: "Ramp",
|
|
105
|
+
description: "{ position, color, interpolation: linear | smooth | constant } stops.",
|
|
106
|
+
default: [
|
|
107
|
+
{ position: 0, color: { r: 0, g: 0, b: 0 }, interpolation: "linear" },
|
|
108
|
+
{ position: 1, color: { r: 1, g: 1, b: 1 }, interpolation: "linear" }
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" }
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var textDefinition = {
|
|
115
|
+
apiVersion: 1,
|
|
116
|
+
label: "Text",
|
|
117
|
+
description: "Text drawn with a CSS font family, or a font file from the project.",
|
|
118
|
+
icon: "Type",
|
|
119
|
+
runsOn: "portable",
|
|
120
|
+
capabilities: ["assets"],
|
|
121
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
122
|
+
props: {
|
|
123
|
+
text: { type: "string", default: "Hello, World!", label: "Text", control: "textarea" },
|
|
124
|
+
font: {
|
|
125
|
+
type: "string",
|
|
126
|
+
default: "Inter, system-ui, sans-serif",
|
|
127
|
+
label: "Font",
|
|
128
|
+
description: "A CSS font family list, or a project font file (.otf, .ttf, .woff, .woff2); a file that is not there falls back to sans-serif."
|
|
129
|
+
},
|
|
130
|
+
fontSize: { type: "float", default: 48, min: 1, max: 500, step: 1, label: "Font Size", control: "slider" },
|
|
131
|
+
fontWeight: {
|
|
132
|
+
type: "string",
|
|
133
|
+
default: "normal",
|
|
134
|
+
label: "Font Weight",
|
|
135
|
+
control: "select",
|
|
136
|
+
options: [
|
|
137
|
+
{ value: "normal", label: "Normal" },
|
|
138
|
+
{ value: "bold", label: "Bold" },
|
|
139
|
+
{ value: "100", label: "Thin (100)" },
|
|
140
|
+
{ value: "200", label: "Extra Light (200)" },
|
|
141
|
+
{ value: "300", label: "Light (300)" },
|
|
142
|
+
{ value: "500", label: "Medium (500)" },
|
|
143
|
+
{ value: "600", label: "Semi Bold (600)" },
|
|
144
|
+
{ value: "700", label: "Bold (700)" },
|
|
145
|
+
{ value: "800", label: "Extra Bold (800)" },
|
|
146
|
+
{ value: "900", label: "Black (900)" }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
fontStyle: {
|
|
150
|
+
type: "string",
|
|
151
|
+
default: "normal",
|
|
152
|
+
label: "Font Style",
|
|
153
|
+
control: "select",
|
|
154
|
+
options: [{ value: "normal", label: "Normal" }, { value: "italic", label: "Italic" }, { value: "oblique", label: "Oblique" }]
|
|
155
|
+
},
|
|
156
|
+
alignH: {
|
|
157
|
+
type: "string",
|
|
158
|
+
default: "center",
|
|
159
|
+
label: "Horizontal Align",
|
|
160
|
+
control: "select",
|
|
161
|
+
options: [{ value: "left", label: "Left" }, { value: "center", label: "Center" }, { value: "right", label: "Right" }]
|
|
162
|
+
},
|
|
163
|
+
alignV: {
|
|
164
|
+
type: "string",
|
|
165
|
+
default: "middle",
|
|
166
|
+
label: "Vertical Align",
|
|
167
|
+
control: "select",
|
|
168
|
+
options: [{ value: "top", label: "Top" }, { value: "middle", label: "Middle" }, { value: "bottom", label: "Bottom" }]
|
|
169
|
+
},
|
|
170
|
+
color: { type: "color", default: [1, 1, 1, 1], label: "Color" },
|
|
171
|
+
backgroundColor: { type: "color", default: [0, 0, 0, 0], label: "Background" },
|
|
172
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
173
|
+
offset: { type: "vec2", default: [0, 0], min: -2048, max: 2048, step: 1, label: "Offset" },
|
|
174
|
+
rotation: { type: "float", default: 0, min: -180, max: 180, step: 0.1, label: "Rotation", control: "slider" },
|
|
175
|
+
letterSpacing: { type: "float", default: 0, min: -50, max: 100, step: 0.5, label: "Letter Spacing", control: "slider" },
|
|
176
|
+
lineHeight: { type: "float", default: 1.2, min: 0.5, max: 3, step: 0.05, label: "Line Height", control: "slider" },
|
|
177
|
+
opacity: { type: "float", default: 1, min: 0, max: 1, step: 0.01, label: "Opacity", control: "slider" }
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
var imageDefinition = {
|
|
181
|
+
apiVersion: 1,
|
|
182
|
+
label: "File",
|
|
183
|
+
description: "An image file from the project, or an image input, optionally resized.",
|
|
184
|
+
icon: "FileImage",
|
|
185
|
+
runsOn: "portable",
|
|
186
|
+
capabilities: ["assets"],
|
|
187
|
+
inputs: { image: { kind: "data", type: "image", description: "Used instead of the file when wired." } },
|
|
188
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
189
|
+
props: {
|
|
190
|
+
file: { type: "string", default: "", label: "File", description: "A project-relative image path." },
|
|
191
|
+
resolutionMode: {
|
|
192
|
+
type: "string",
|
|
193
|
+
default: "original",
|
|
194
|
+
label: "Resolution Mode",
|
|
195
|
+
control: "select",
|
|
196
|
+
options: [{ value: "original", label: "Original" }, { value: "max", label: "Max Resolution" }, { value: "fixed", label: "Fixed Resolution" }]
|
|
197
|
+
},
|
|
198
|
+
maxResolution: { type: "vec2i", default: [2048, 2048], min: 1, max: 4096, label: "Max Resolution" },
|
|
199
|
+
fixedResolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Fixed Resolution" }
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
var blurDefinition = {
|
|
203
|
+
apiVersion: 1,
|
|
204
|
+
label: "Blur",
|
|
205
|
+
description: "Box (three passes, fast) or true Gaussian blur.",
|
|
206
|
+
icon: "Droplets",
|
|
207
|
+
runsOn: "portable",
|
|
208
|
+
capabilities: ["assets"],
|
|
209
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
210
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
211
|
+
props: {
|
|
212
|
+
method: {
|
|
213
|
+
type: "string",
|
|
214
|
+
default: "box",
|
|
215
|
+
label: "Method",
|
|
216
|
+
control: "select",
|
|
217
|
+
options: [{ value: "box", label: "Box (Fast)" }, { value: "gaussian", label: "Gaussian (Accurate)" }]
|
|
218
|
+
},
|
|
219
|
+
radius: { type: "float", default: 5, min: 0, max: 100, step: 0.1, label: "Radius" },
|
|
220
|
+
wrapEdges: { type: "bool", default: false, label: "Wrap Edges" }
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
var normalMapDefinition = {
|
|
224
|
+
apiVersion: 1,
|
|
225
|
+
label: "Normal Map",
|
|
226
|
+
description: "A normal map from the red (or grey) channel as height.",
|
|
227
|
+
icon: "Box",
|
|
228
|
+
runsOn: "portable",
|
|
229
|
+
capabilities: ["assets"],
|
|
230
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
231
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
232
|
+
props: {
|
|
233
|
+
scale: { type: "float", default: 1, min: 0, max: 10, step: 0.1, label: "Scale" },
|
|
234
|
+
flipX: { type: "bool", default: false, label: "Flip X" },
|
|
235
|
+
flipY: { type: "bool", default: false, label: "Flip Y" }
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
var resizeDefinition = {
|
|
239
|
+
apiVersion: 1,
|
|
240
|
+
label: "Resize",
|
|
241
|
+
description: "Scale an image, or resize it to a fixed size, bilinear.",
|
|
242
|
+
icon: "Maximize2",
|
|
243
|
+
runsOn: "portable",
|
|
244
|
+
capabilities: ["assets"],
|
|
245
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
246
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
247
|
+
props: {
|
|
248
|
+
mode: {
|
|
249
|
+
type: "string",
|
|
250
|
+
default: "scale",
|
|
251
|
+
label: "Mode",
|
|
252
|
+
control: "select",
|
|
253
|
+
options: [{ value: "scale", label: "Scale" }, { value: "fixed", label: "Fixed" }]
|
|
254
|
+
},
|
|
255
|
+
scale: { type: "float", default: 1, min: 0.1, max: 10, step: 0.1, label: "Scale" },
|
|
256
|
+
width: { type: "int", default: 512, min: 1, max: 4096, step: 1, label: "Width" },
|
|
257
|
+
height: { type: "int", default: 512, min: 1, max: 4096, step: 1, label: "Height" }
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
var transformDefinition = {
|
|
261
|
+
apiVersion: 1,
|
|
262
|
+
label: "Transform",
|
|
263
|
+
description: "Rotate, translate and scale an image about a pivot.",
|
|
264
|
+
icon: "Move",
|
|
265
|
+
runsOn: "portable",
|
|
266
|
+
capabilities: ["assets"],
|
|
267
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
268
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
269
|
+
props: {
|
|
270
|
+
translate: { type: "vec2", default: [0, 0], min: -2048, max: 2048, step: 1, label: "Translate" },
|
|
271
|
+
rotation: { type: "float", default: 0, min: -180, max: 180, step: 0.1, label: "Rotation" },
|
|
272
|
+
scale: { type: "vec2", default: [1, 1], min: 0.01, max: 10, step: 0.01, label: "Scale" },
|
|
273
|
+
uniformScale: { type: "bool", default: true, label: "Uniform Scale" },
|
|
274
|
+
pivot: {
|
|
275
|
+
type: "string",
|
|
276
|
+
default: "center",
|
|
277
|
+
label: "Pivot",
|
|
278
|
+
control: "select",
|
|
279
|
+
options: [
|
|
280
|
+
{ value: "center", label: "Center" },
|
|
281
|
+
{ value: "top-left", label: "Top Left" },
|
|
282
|
+
{ value: "top-right", label: "Top Right" },
|
|
283
|
+
{ value: "bottom-left", label: "Bottom Left" },
|
|
284
|
+
{ value: "bottom-right", label: "Bottom Right" },
|
|
285
|
+
{ value: "custom", label: "Custom" }
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
customPivot: { type: "vec2", default: [0.5, 0.5], min: 0, max: 1, step: 0.01, label: "Custom Pivot" },
|
|
289
|
+
filter: {
|
|
290
|
+
type: "string",
|
|
291
|
+
default: "bilinear",
|
|
292
|
+
label: "Filter",
|
|
293
|
+
control: "select",
|
|
294
|
+
options: [{ value: "nearest", label: "Nearest" }, { value: "bilinear", label: "Bilinear" }]
|
|
295
|
+
},
|
|
296
|
+
wrap: {
|
|
297
|
+
type: "string",
|
|
298
|
+
default: "clamp",
|
|
299
|
+
label: "Wrap Mode",
|
|
300
|
+
control: "select",
|
|
301
|
+
options: [
|
|
302
|
+
{ value: "clamp", label: "Clamp" },
|
|
303
|
+
{ value: "repeat", label: "Repeat" },
|
|
304
|
+
{ value: "mirror", label: "Mirror" },
|
|
305
|
+
{ value: "transparent", label: "Transparent" }
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
var compositeDefinition = {
|
|
311
|
+
apiVersion: 1,
|
|
312
|
+
label: "Composite",
|
|
313
|
+
description: "Blend image2 over image1.",
|
|
314
|
+
icon: "Layers",
|
|
315
|
+
runsOn: "portable",
|
|
316
|
+
capabilities: ["assets"],
|
|
317
|
+
inputs: {
|
|
318
|
+
image1: { kind: "data", type: "image" },
|
|
319
|
+
image2: { kind: "data", type: "image" }
|
|
320
|
+
},
|
|
321
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
322
|
+
props: {
|
|
323
|
+
blendMode: {
|
|
324
|
+
type: "string",
|
|
325
|
+
default: "multiply",
|
|
326
|
+
label: "Blend Mode",
|
|
327
|
+
control: "select",
|
|
328
|
+
options: [
|
|
329
|
+
{ value: "normal", label: "Normal" },
|
|
330
|
+
{ value: "multiply", label: "Multiply" },
|
|
331
|
+
{ value: "screen", label: "Screen" },
|
|
332
|
+
{ value: "overlay", label: "Overlay" },
|
|
333
|
+
{ value: "darken", label: "Darken" },
|
|
334
|
+
{ value: "lighten", label: "Lighten" },
|
|
335
|
+
{ value: "color-dodge", label: "Color Dodge" },
|
|
336
|
+
{ value: "color-burn", label: "Color Burn" },
|
|
337
|
+
{ value: "hard-light", label: "Hard Light" },
|
|
338
|
+
{ value: "soft-light", label: "Soft Light" },
|
|
339
|
+
{ value: "difference", label: "Difference" },
|
|
340
|
+
{ value: "exclusion", label: "Exclusion" },
|
|
341
|
+
{ value: "add", label: "Add" },
|
|
342
|
+
{ value: "subtract", label: "Subtract" },
|
|
343
|
+
{ value: "divide", label: "Divide" },
|
|
344
|
+
{ value: "pin-light", label: "Pin Light" },
|
|
345
|
+
{ value: "vivid-light", label: "Vivid Light" },
|
|
346
|
+
{ value: "linear-dodge", label: "Linear Dodge" },
|
|
347
|
+
{ value: "linear-burn", label: "Linear Burn" }
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
opacity: { type: "float", default: 1, min: 0, max: 1, step: 0.01, label: "Opacity" },
|
|
351
|
+
outputResolution: {
|
|
352
|
+
type: "string",
|
|
353
|
+
default: "input1",
|
|
354
|
+
label: "Output Resolution",
|
|
355
|
+
control: "select",
|
|
356
|
+
options: [
|
|
357
|
+
{ value: "input1", label: "Use Input 1" },
|
|
358
|
+
{ value: "input2", label: "Use Input 2" },
|
|
359
|
+
{ value: "largest", label: "Largest Input" },
|
|
360
|
+
{ value: "smallest", label: "Smallest Input" },
|
|
361
|
+
{ value: "custom", label: "Custom" }
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
customResolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
365
|
+
fitMode: {
|
|
366
|
+
type: "string",
|
|
367
|
+
default: "fill",
|
|
368
|
+
label: "Fit Mode",
|
|
369
|
+
control: "select",
|
|
370
|
+
options: [
|
|
371
|
+
{ value: "fill", label: "Fill (Crop)" },
|
|
372
|
+
{ value: "fit", label: "Fit (Letterbox)" },
|
|
373
|
+
{ value: "stretch", label: "Stretch" },
|
|
374
|
+
{ value: "native", label: "Native (No Scale)" }
|
|
375
|
+
]
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
// packages/runtime/src/builtins/image/index.ts
|
|
381
|
+
function lazy(name, definition, load) {
|
|
382
|
+
return { kind: "definition-v1", moduleId: `cascade.image.${name}`, definition, loadExecute: load };
|
|
383
|
+
}
|
|
384
|
+
var contactSheetRegistration = lazy("ContactSheet", contactSheetDefinition, async () => (await import("./contactSheet-2PQVRUFW.js")).executeContactSheet);
|
|
385
|
+
var colorRegistration = lazy("Color", colorDefinition, async () => (await import("./generators-YU7GB4MD.js")).executeColor);
|
|
386
|
+
var checkersRegistration = lazy("Checkers", checkersDefinition, async () => (await import("./generators-YU7GB4MD.js")).executeCheckers);
|
|
387
|
+
var noiseRegistration = lazy("Noise", noiseDefinition, async () => (await import("./generators-YU7GB4MD.js")).executeNoise);
|
|
388
|
+
var rampRegistration = lazy("Ramp", rampDefinition, async () => (await import("./generators-YU7GB4MD.js")).executeRamp);
|
|
389
|
+
var textRegistration = lazy("Text", textDefinition, async () => (await import("./text-MB3EKR4H.js")).executeText);
|
|
390
|
+
var imageRegistration = lazy("Image", imageDefinition, async () => (await import("./file-3HTQHPYQ.js")).executeImage);
|
|
391
|
+
var blurRegistration = lazy("Blur", blurDefinition, async () => (await import("./filters-6ODFWYK4.js")).executeBlur);
|
|
392
|
+
var normalMapRegistration = lazy("NormalMap", normalMapDefinition, async () => (await import("./filters-6ODFWYK4.js")).executeNormalMap);
|
|
393
|
+
var resizeRegistration = lazy("Resize", resizeDefinition, async () => (await import("./filters-6ODFWYK4.js")).executeResize);
|
|
394
|
+
var transformRegistration = lazy("Transform", transformDefinition, async () => (await import("./filters-6ODFWYK4.js")).executeTransform);
|
|
395
|
+
var compositeRegistration = lazy("Composite", compositeDefinition, async () => (await import("./filters-6ODFWYK4.js")).executeComposite);
|
|
396
|
+
var imageNodeRegistrations = Object.freeze([
|
|
397
|
+
colorRegistration,
|
|
398
|
+
checkersRegistration,
|
|
399
|
+
noiseRegistration,
|
|
400
|
+
rampRegistration,
|
|
401
|
+
textRegistration,
|
|
402
|
+
imageRegistration,
|
|
403
|
+
blurRegistration,
|
|
404
|
+
normalMapRegistration,
|
|
405
|
+
resizeRegistration,
|
|
406
|
+
transformRegistration,
|
|
407
|
+
compositeRegistration,
|
|
408
|
+
contactSheetRegistration
|
|
409
|
+
]);
|
|
410
|
+
|
|
411
|
+
export {
|
|
412
|
+
contactSheetDefinition,
|
|
413
|
+
colorDefinition,
|
|
414
|
+
checkersDefinition,
|
|
415
|
+
noiseDefinition,
|
|
416
|
+
rampDefinition,
|
|
417
|
+
textDefinition,
|
|
418
|
+
imageDefinition,
|
|
419
|
+
blurDefinition,
|
|
420
|
+
normalMapDefinition,
|
|
421
|
+
resizeDefinition,
|
|
422
|
+
transformDefinition,
|
|
423
|
+
compositeDefinition,
|
|
424
|
+
contactSheetRegistration,
|
|
425
|
+
colorRegistration,
|
|
426
|
+
checkersRegistration,
|
|
427
|
+
noiseRegistration,
|
|
428
|
+
rampRegistration,
|
|
429
|
+
textRegistration,
|
|
430
|
+
imageRegistration,
|
|
431
|
+
blurRegistration,
|
|
432
|
+
normalMapRegistration,
|
|
433
|
+
resizeRegistration,
|
|
434
|
+
transformRegistration,
|
|
435
|
+
compositeRegistration,
|
|
436
|
+
imageNodeRegistrations
|
|
437
|
+
};
|
|
438
|
+
//# sourceMappingURL=chunk-LTXWBXOM.js.map
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LIGHT_DEFAULTS,
|
|
3
|
+
geoNodeRegistrations,
|
|
4
|
+
isLight,
|
|
5
|
+
isScene
|
|
6
|
+
} from "./chunk-GRIN2DDP.js";
|
|
7
|
+
import {
|
|
8
|
+
coreNodeRegistrations,
|
|
9
|
+
isCamera
|
|
10
|
+
} from "./chunk-X4WKAOQP.js";
|
|
11
|
+
import {
|
|
12
|
+
mathNodeRegistrations
|
|
13
|
+
} from "./chunk-QQPA2ZHH.js";
|
|
14
|
+
import {
|
|
15
|
+
popNodeRegistrations
|
|
16
|
+
} from "./chunk-KH4MUBKF.js";
|
|
17
|
+
import {
|
|
18
|
+
imageNodeRegistrations
|
|
19
|
+
} from "./chunk-LTXWBXOM.js";
|
|
20
|
+
import {
|
|
21
|
+
assertNodeRegistrations
|
|
22
|
+
} from "./chunk-JVOCK5W4.js";
|
|
23
|
+
|
|
24
|
+
// packages/runtime/src/builtins/scene/definitions.ts
|
|
25
|
+
var SCENE_NAMESPACE = "cascade.scene";
|
|
26
|
+
function sceneModuleId(name) {
|
|
27
|
+
return `${SCENE_NAMESPACE}.${name}`;
|
|
28
|
+
}
|
|
29
|
+
var sceneDefinition = {
|
|
30
|
+
apiVersion: 1,
|
|
31
|
+
label: "Scene",
|
|
32
|
+
description: "Geometry, a camera and lights, assembled into a scene. Attach anything to the input.",
|
|
33
|
+
icon: "Box",
|
|
34
|
+
runsOn: "portable",
|
|
35
|
+
inputs: {
|
|
36
|
+
inputs: {
|
|
37
|
+
kind: "data",
|
|
38
|
+
type: "any",
|
|
39
|
+
variadic: true,
|
|
40
|
+
description: "Geometry, one camera, and lights, in any order. Scenes are flattened."
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
outputs: {
|
|
44
|
+
scene: { kind: "data", type: "scene" }
|
|
45
|
+
},
|
|
46
|
+
props: {}
|
|
47
|
+
};
|
|
48
|
+
function executeScene(context) {
|
|
49
|
+
const geometry = [];
|
|
50
|
+
const lights = [];
|
|
51
|
+
let camera = null;
|
|
52
|
+
let cameraFrom = -1;
|
|
53
|
+
context.inputs.inputs.forEach((value, index) => {
|
|
54
|
+
if (value === void 0 || value === null) return;
|
|
55
|
+
if (isScene(value)) {
|
|
56
|
+
geometry.push(...value.geometry);
|
|
57
|
+
lights.push(...value.lights);
|
|
58
|
+
if (value.camera !== null) {
|
|
59
|
+
if (camera !== null)
|
|
60
|
+
throw new Error(
|
|
61
|
+
`cascade.scene.Scene has two cameras, on inputs ${cameraFrom} and ${index}. A scene has one viewpoint; remove one or use a Switch to choose between them.`
|
|
62
|
+
);
|
|
63
|
+
camera = value.camera;
|
|
64
|
+
cameraFrom = index;
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (isCamera(value)) {
|
|
69
|
+
if (camera !== null)
|
|
70
|
+
throw new Error(
|
|
71
|
+
`cascade.scene.Scene has two cameras, on inputs ${cameraFrom} and ${index}. A scene has one viewpoint; remove one or use a Switch to choose between them.`
|
|
72
|
+
);
|
|
73
|
+
camera = value;
|
|
74
|
+
cameraFrom = index;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (isLight(value)) {
|
|
78
|
+
lights.push(value);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value === "object" && value.kind === "geometry") {
|
|
82
|
+
geometry.push(value);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
throw new Error(
|
|
86
|
+
`cascade.scene.Scene input ${index} is not geometry, a camera, a light or a scene (received ${describe(value)}). A scene can only hold those.`
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
context.outputs.scene.set({ geometry, camera, lights });
|
|
90
|
+
}
|
|
91
|
+
function describe(value) {
|
|
92
|
+
if (Array.isArray(value)) return `an array of ${value.length}`;
|
|
93
|
+
if (typeof value === "object" && value !== null) {
|
|
94
|
+
const kind = value.kind;
|
|
95
|
+
return typeof kind === "string" ? `an object of kind "${kind}"` : "an object";
|
|
96
|
+
}
|
|
97
|
+
return `a ${typeof value}`;
|
|
98
|
+
}
|
|
99
|
+
var lightDefinition = {
|
|
100
|
+
apiVersion: 1,
|
|
101
|
+
label: "Light",
|
|
102
|
+
description: "A light, following Houdini's /obj/hlight. Nothing shades with lights yet \u2014 the viewport draws wireframe and points.",
|
|
103
|
+
icon: "Lightbulb",
|
|
104
|
+
runsOn: "portable",
|
|
105
|
+
inputs: {
|
|
106
|
+
translate: {
|
|
107
|
+
kind: "data",
|
|
108
|
+
type: "vec3",
|
|
109
|
+
default: [0, 0, 5],
|
|
110
|
+
description: "World position. Ignored for a distant or ambient light."
|
|
111
|
+
},
|
|
112
|
+
direction: {
|
|
113
|
+
kind: "data",
|
|
114
|
+
type: "vec3",
|
|
115
|
+
default: [0, 0, -1],
|
|
116
|
+
description: "Direction the light points. Used by distant and spot."
|
|
117
|
+
},
|
|
118
|
+
color: {
|
|
119
|
+
kind: "data",
|
|
120
|
+
type: "color",
|
|
121
|
+
default: [1, 1, 1, 1],
|
|
122
|
+
description: "Houdini light_color."
|
|
123
|
+
},
|
|
124
|
+
intensity: {
|
|
125
|
+
kind: "data",
|
|
126
|
+
type: "float",
|
|
127
|
+
default: 1,
|
|
128
|
+
min: 0,
|
|
129
|
+
description: "Houdini light_intensity."
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
outputs: {
|
|
133
|
+
light: { kind: "data", type: "light" }
|
|
134
|
+
},
|
|
135
|
+
props: {
|
|
136
|
+
type: {
|
|
137
|
+
type: "string",
|
|
138
|
+
default: "point",
|
|
139
|
+
label: "Light Type",
|
|
140
|
+
control: "select",
|
|
141
|
+
options: [
|
|
142
|
+
{ value: "point", label: "Point" },
|
|
143
|
+
{ value: "distant", label: "Distant - directional" },
|
|
144
|
+
{ value: "ambient", label: "Ambient" },
|
|
145
|
+
{ value: "spot", label: "Spot" }
|
|
146
|
+
],
|
|
147
|
+
description: "Houdini light_type. Distant is what other renderers call directional."
|
|
148
|
+
},
|
|
149
|
+
coneangle: {
|
|
150
|
+
type: "float",
|
|
151
|
+
default: 45,
|
|
152
|
+
min: 0,
|
|
153
|
+
max: 180,
|
|
154
|
+
label: "Cone Angle",
|
|
155
|
+
description: "Degrees. Spot only."
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
function executeLight(context) {
|
|
160
|
+
const type = context.props.type;
|
|
161
|
+
context.outputs.light.set({
|
|
162
|
+
type: type === "distant" || type === "ambient" || type === "spot" ? type : LIGHT_DEFAULTS.type,
|
|
163
|
+
translate: context.inputs.translate ?? LIGHT_DEFAULTS.translate,
|
|
164
|
+
direction: context.inputs.direction ?? LIGHT_DEFAULTS.direction,
|
|
165
|
+
color: context.inputs.color ?? LIGHT_DEFAULTS.color,
|
|
166
|
+
intensity: context.inputs.intensity ?? LIGHT_DEFAULTS.intensity,
|
|
167
|
+
coneangle: context.props.coneangle
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
var sceneRegistration = {
|
|
171
|
+
kind: "definition-v1",
|
|
172
|
+
moduleId: sceneModuleId("Scene"),
|
|
173
|
+
definition: sceneDefinition,
|
|
174
|
+
loadExecute: async () => executeScene
|
|
175
|
+
};
|
|
176
|
+
var lightRegistration = {
|
|
177
|
+
kind: "definition-v1",
|
|
178
|
+
moduleId: sceneModuleId("Light"),
|
|
179
|
+
definition: lightDefinition,
|
|
180
|
+
loadExecute: async () => executeLight
|
|
181
|
+
};
|
|
182
|
+
var sceneNodeRegistrations = Object.freeze([sceneRegistration, lightRegistration]);
|
|
183
|
+
var sceneNodeDefinitions = Object.freeze([
|
|
184
|
+
[sceneModuleId("Scene"), sceneDefinition],
|
|
185
|
+
[sceneModuleId("Light"), lightDefinition]
|
|
186
|
+
]);
|
|
187
|
+
|
|
188
|
+
// packages/runtime/src/builtins/index.ts
|
|
189
|
+
var builtinNodeRegistrations = Object.freeze([
|
|
190
|
+
...coreNodeRegistrations,
|
|
191
|
+
...geoNodeRegistrations,
|
|
192
|
+
...mathNodeRegistrations,
|
|
193
|
+
...popNodeRegistrations,
|
|
194
|
+
...sceneNodeRegistrations,
|
|
195
|
+
...imageNodeRegistrations,
|
|
196
|
+
...assertNodeRegistrations
|
|
197
|
+
]);
|
|
198
|
+
var registrationsById = new Map(
|
|
199
|
+
builtinNodeRegistrations.map((registration) => [
|
|
200
|
+
registration.moduleId,
|
|
201
|
+
registration
|
|
202
|
+
])
|
|
203
|
+
);
|
|
204
|
+
function builtinNodeRegistration(moduleId) {
|
|
205
|
+
return registrationsById.get(moduleId);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/cli/headlessBuiltins.ts
|
|
209
|
+
var headlessBuiltinRegistrations = builtinNodeRegistrations;
|
|
210
|
+
function headlessBuiltin(moduleId) {
|
|
211
|
+
return builtinNodeRegistration(moduleId);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export {
|
|
215
|
+
builtinNodeRegistrations,
|
|
216
|
+
builtinNodeRegistration,
|
|
217
|
+
headlessBuiltinRegistrations,
|
|
218
|
+
headlessBuiltin
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=chunk-MI5JLQYA.js.map
|