@tomorrowevening/hermes 0.1.39 → 0.1.41
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/dist/{ThreeEditor-CTkjs-SY.js → ThreeEditor-jkqfXLb4.js} +16 -16
- package/dist/core/Application.js +77 -0
- package/dist/core/remote/BaseRemote.js +33 -0
- package/dist/core/remote/RemoteTheatre.js +253 -0
- package/dist/core/remote/RemoteThree.js +451 -0
- package/dist/core/types.js +7 -0
- package/dist/editor/Editor.js +12 -0
- package/dist/editor/HermesApp.js +24 -0
- package/dist/editor/ThreeEditor.js +25 -0
- package/dist/editor/components/Draggable.js +40 -0
- package/dist/editor/components/DraggableItem.js +25 -0
- package/dist/editor/components/Dropdown.js +32 -0
- package/dist/editor/components/DropdownItem.js +50 -0
- package/dist/editor/components/NavButton.js +7 -0
- package/dist/editor/components/content.js +4 -0
- package/dist/editor/components/icons/CloseIcon.js +9 -0
- package/dist/editor/components/icons/DragIcon.js +12 -0
- package/dist/editor/multiView/CameraWindow.js +64 -0
- package/dist/editor/multiView/DepthNodeMaterial.js +12 -0
- package/dist/editor/multiView/InfiniteGridHelper.js +31 -0
- package/dist/editor/multiView/InfiniteGridHelperGPU.js +31 -0
- package/dist/editor/multiView/InfiniteGridMaterial.js +137 -0
- package/dist/editor/multiView/InfiniteGridNodeMaterial.js +63 -0
- package/dist/editor/multiView/MultiView.js +890 -0
- package/dist/editor/multiView/Toggle.js +25 -0
- package/dist/editor/multiView/UVMaterial.js +60 -0
- package/dist/editor/multiView/UVNodeMaterial.js +10 -0
- package/dist/editor/sidePanel/Accordion.js +56 -0
- package/dist/editor/sidePanel/ChildObject.js +78 -0
- package/dist/editor/sidePanel/ContainerObject.js +11 -0
- package/dist/editor/sidePanel/DebugData.js +133 -0
- package/dist/editor/sidePanel/SidePanel.js +91 -0
- package/dist/editor/sidePanel/inspector/InspectGrid3.js +82 -0
- package/dist/editor/sidePanel/inspector/InspectGrid4.js +58 -0
- package/dist/editor/sidePanel/inspector/InspectImage.js +100 -0
- package/dist/editor/sidePanel/inspector/InspectNumber.js +76 -0
- package/dist/editor/sidePanel/inspector/InspectVector2.js +154 -0
- package/dist/editor/sidePanel/inspector/Inspector.js +95 -0
- package/dist/editor/sidePanel/inspector/InspectorField.js +128 -0
- package/dist/editor/sidePanel/inspector/InspectorGroup.js +110 -0
- package/dist/editor/sidePanel/inspector/utils/DragNumber.js +27 -0
- package/dist/editor/sidePanel/inspector/utils/InspectAnimation.js +99 -0
- package/dist/editor/sidePanel/inspector/utils/InspectCamera.js +91 -0
- package/dist/editor/sidePanel/inspector/utils/InspectLight.js +85 -0
- package/dist/editor/sidePanel/inspector/utils/InspectMaterial.js +861 -0
- package/dist/editor/sidePanel/inspector/utils/InspectTransform.js +93 -0
- package/dist/editor/sidePanel/utils.js +259 -0
- package/dist/editor/tools/Transform.js +77 -0
- package/dist/editor/tools/splineEditor/Spline.js +348 -0
- package/dist/editor/tools/splineEditor/index.js +193 -0
- package/dist/editor/utils.js +27 -0
- package/dist/hermes.cjs.js +8 -30
- package/dist/{index-BpKOzCuX.js → index-DZmiM5y-.js} +617 -617
- package/dist/index.html +1 -1
- package/dist/index.js +125 -0
- package/dist/utils/ImageSequenceCapturer.js +148 -0
- package/dist/utils/detectSettings.js +46 -0
- package/dist/utils/math.js +68 -0
- package/dist/utils/post.js +206 -0
- package/dist/utils/theatre.js +316 -0
- package/dist/utils/three.js +199 -0
- package/dist/webworkers/EventHandling.js +115 -0
- package/dist/webworkers/ProxyManager.js +76 -0
- package/package.json +13 -7
- package/types/core/remote/RemoteThree.d.ts +10 -1
- package/dist/.vite/manifest.json +0 -12
- package/dist/hermes.es.js +0 -8077
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as g } from "react";
|
|
3
|
+
import { SkeletonHelper as v } from "three";
|
|
4
|
+
import A from "../InspectorGroup.js";
|
|
5
|
+
import S from "../../../multiView/MultiView.js";
|
|
6
|
+
import { dispose as b } from "../../../../utils/three.js";
|
|
7
|
+
function I(a) {
|
|
8
|
+
const t = a.object, i = a.three;
|
|
9
|
+
function l() {
|
|
10
|
+
return `${i.name}_animation`;
|
|
11
|
+
}
|
|
12
|
+
const s = localStorage.getItem(l()), h = s !== null ? s === "open" : !1;
|
|
13
|
+
function x(e) {
|
|
14
|
+
localStorage.setItem(l(), e ? "open" : "closed");
|
|
15
|
+
}
|
|
16
|
+
const r = [], m = [];
|
|
17
|
+
let u = 0;
|
|
18
|
+
t.animations.forEach((e) => {
|
|
19
|
+
u = Math.max(u, e.duration), e.duration > 0 && m.push({
|
|
20
|
+
title: e.name,
|
|
21
|
+
items: [
|
|
22
|
+
{
|
|
23
|
+
title: "Duration",
|
|
24
|
+
type: "number",
|
|
25
|
+
value: e.duration,
|
|
26
|
+
disabled: !0
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Blend Mode",
|
|
30
|
+
type: "option",
|
|
31
|
+
disabled: !0,
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
title: "Normal",
|
|
35
|
+
value: 2500
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Additive",
|
|
39
|
+
value: 2501
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}), r.push({
|
|
46
|
+
title: "Animations",
|
|
47
|
+
items: m
|
|
48
|
+
});
|
|
49
|
+
let o;
|
|
50
|
+
const d = i.getScene(t.uuid);
|
|
51
|
+
if (d !== null) {
|
|
52
|
+
const e = d.getObjectByProperty("uuid", t.uuid);
|
|
53
|
+
if (e !== void 0) {
|
|
54
|
+
const n = e.mixer;
|
|
55
|
+
if (n !== void 0) {
|
|
56
|
+
const c = [
|
|
57
|
+
{
|
|
58
|
+
title: "Time Scale",
|
|
59
|
+
type: "range",
|
|
60
|
+
value: n.timeScale,
|
|
61
|
+
step: 0.01,
|
|
62
|
+
min: -1,
|
|
63
|
+
max: 2,
|
|
64
|
+
onChange: (y, p) => {
|
|
65
|
+
n.timeScale = p, i.updateObject(t.uuid, "mixer.timeScale", p);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
c.push({
|
|
70
|
+
title: "Stop All",
|
|
71
|
+
type: "button",
|
|
72
|
+
onChange: () => {
|
|
73
|
+
n.stopAllAction(), i.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
|
|
74
|
+
}
|
|
75
|
+
}), r.push({
|
|
76
|
+
title: "Mixer",
|
|
77
|
+
items: c
|
|
78
|
+
}), o = new v(e), S.instance?.scene.add(o);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return g(() => () => {
|
|
83
|
+
o !== void 0 && b(o);
|
|
84
|
+
}, []), /* @__PURE__ */ f(
|
|
85
|
+
A,
|
|
86
|
+
{
|
|
87
|
+
three: a.three,
|
|
88
|
+
title: "Animation",
|
|
89
|
+
items: r,
|
|
90
|
+
expanded: h,
|
|
91
|
+
onToggle: (e) => {
|
|
92
|
+
x(e);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
I as default
|
|
99
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import g from "../InspectorGroup.js";
|
|
3
|
+
import { setItemProps as p } from "../../utils.js";
|
|
4
|
+
function d(e) {
|
|
5
|
+
switch (e) {
|
|
6
|
+
case "fov":
|
|
7
|
+
return "FOV";
|
|
8
|
+
case "zoom":
|
|
9
|
+
return "Zoom";
|
|
10
|
+
case "near":
|
|
11
|
+
return "Near";
|
|
12
|
+
case "far":
|
|
13
|
+
return "Far";
|
|
14
|
+
case "focus":
|
|
15
|
+
return "Focus";
|
|
16
|
+
case "aspect":
|
|
17
|
+
return "Aspect";
|
|
18
|
+
case "filmGauge":
|
|
19
|
+
return "Film Gauge";
|
|
20
|
+
case "filmOffset":
|
|
21
|
+
return "Film Offset";
|
|
22
|
+
case "left":
|
|
23
|
+
return "Left";
|
|
24
|
+
case "right":
|
|
25
|
+
return "Right";
|
|
26
|
+
case "top":
|
|
27
|
+
return "Top";
|
|
28
|
+
case "bottom":
|
|
29
|
+
return "Bottom";
|
|
30
|
+
}
|
|
31
|
+
return e;
|
|
32
|
+
}
|
|
33
|
+
function C(e, r) {
|
|
34
|
+
function s() {
|
|
35
|
+
return `${r.name}_camera`;
|
|
36
|
+
}
|
|
37
|
+
const c = localStorage.getItem(s()), f = c !== null ? c === "open" : !1;
|
|
38
|
+
function m(t) {
|
|
39
|
+
localStorage.setItem(s(), t ? "open" : "closed");
|
|
40
|
+
}
|
|
41
|
+
const i = [];
|
|
42
|
+
if (e.perspectiveCameraInfo !== void 0)
|
|
43
|
+
for (const t in e.perspectiveCameraInfo)
|
|
44
|
+
i.push({
|
|
45
|
+
title: d(t),
|
|
46
|
+
prop: t,
|
|
47
|
+
type: "number",
|
|
48
|
+
step: 0.01,
|
|
49
|
+
value: e.perspectiveCameraInfo[t],
|
|
50
|
+
onChange: (a, o) => {
|
|
51
|
+
r.updateObject(e.uuid, a, o), r.requestMethod(e.uuid, "updateProjectionMatrix");
|
|
52
|
+
const u = r.getScene(e.uuid);
|
|
53
|
+
if (u !== null) {
|
|
54
|
+
const n = u.getObjectByProperty("uuid", e.uuid);
|
|
55
|
+
n !== void 0 && (p(n, a, o), n.updateProjectionMatrix());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
else if (e.orthographicCameraInfo !== void 0)
|
|
60
|
+
for (const t in e.orthographicCameraInfo)
|
|
61
|
+
i.push({
|
|
62
|
+
title: d(t),
|
|
63
|
+
prop: t,
|
|
64
|
+
type: "number",
|
|
65
|
+
step: 0.01,
|
|
66
|
+
value: e.orthographicCameraInfo[t],
|
|
67
|
+
onChange: (a, o) => {
|
|
68
|
+
r.updateObject(e.uuid, a, o), r.requestMethod(e.uuid, "updateProjectionMatrix");
|
|
69
|
+
const u = r.getScene(e.uuid);
|
|
70
|
+
if (u !== null) {
|
|
71
|
+
const n = u.getObjectByProperty("uuid", e.uuid);
|
|
72
|
+
n !== void 0 && (p(n, a, o), n.updateProjectionMatrix());
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ l(
|
|
77
|
+
g,
|
|
78
|
+
{
|
|
79
|
+
three: r,
|
|
80
|
+
title: "Camera",
|
|
81
|
+
items: i,
|
|
82
|
+
expanded: f,
|
|
83
|
+
onToggle: (t) => {
|
|
84
|
+
m(t);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
C as InspectCamera
|
|
91
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { Color as y } from "three";
|
|
3
|
+
import I from "../InspectorGroup.js";
|
|
4
|
+
import { setItemProps as d } from "../../utils.js";
|
|
5
|
+
function p(e) {
|
|
6
|
+
switch (e) {
|
|
7
|
+
case "color":
|
|
8
|
+
return "Color";
|
|
9
|
+
case "intensity":
|
|
10
|
+
return "Intensity";
|
|
11
|
+
case "decay":
|
|
12
|
+
return "Decay";
|
|
13
|
+
case "distance":
|
|
14
|
+
return "Distance";
|
|
15
|
+
case "angle":
|
|
16
|
+
return "Angle";
|
|
17
|
+
case "penumbra":
|
|
18
|
+
return "Penumbra";
|
|
19
|
+
case "groundColor":
|
|
20
|
+
return "Ground Color";
|
|
21
|
+
case "width":
|
|
22
|
+
return "Width";
|
|
23
|
+
case "height":
|
|
24
|
+
return "Height";
|
|
25
|
+
}
|
|
26
|
+
return e;
|
|
27
|
+
}
|
|
28
|
+
function P(e, n) {
|
|
29
|
+
function a() {
|
|
30
|
+
return `${n.name}_light`;
|
|
31
|
+
}
|
|
32
|
+
const l = localStorage.getItem(a()), g = l !== null ? l === "open" : !1;
|
|
33
|
+
function f(t) {
|
|
34
|
+
localStorage.setItem(a(), t ? "open" : "closed");
|
|
35
|
+
}
|
|
36
|
+
const c = [];
|
|
37
|
+
if (e.lightInfo !== void 0)
|
|
38
|
+
for (const t in e.lightInfo) {
|
|
39
|
+
const o = e.lightInfo[t];
|
|
40
|
+
o !== void 0 && (o.isColor !== void 0 ? c.push({
|
|
41
|
+
title: p(t),
|
|
42
|
+
prop: t,
|
|
43
|
+
type: "color",
|
|
44
|
+
value: o,
|
|
45
|
+
onChange: (r, u) => {
|
|
46
|
+
const i = new y(u);
|
|
47
|
+
n.updateObject(e.uuid, r, i);
|
|
48
|
+
const s = n.getScene(e.uuid);
|
|
49
|
+
if (s !== null) {
|
|
50
|
+
const m = s.getObjectByProperty("uuid", e.uuid);
|
|
51
|
+
d(m, r, i);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}) : c.push({
|
|
55
|
+
title: p(t),
|
|
56
|
+
prop: t,
|
|
57
|
+
type: typeof o,
|
|
58
|
+
value: o,
|
|
59
|
+
step: typeof o == "number" ? 0.01 : void 0,
|
|
60
|
+
onChange: (r, u) => {
|
|
61
|
+
n.updateObject(e.uuid, r, u);
|
|
62
|
+
const i = n.getScene(e.uuid);
|
|
63
|
+
if (i !== null) {
|
|
64
|
+
const s = i.getObjectByProperty("uuid", e.uuid);
|
|
65
|
+
d(s, r, u);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
return /* @__PURE__ */ h(
|
|
71
|
+
I,
|
|
72
|
+
{
|
|
73
|
+
three: n,
|
|
74
|
+
title: "Light",
|
|
75
|
+
items: c,
|
|
76
|
+
expanded: g,
|
|
77
|
+
onToggle: (t) => {
|
|
78
|
+
f(t);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
P as InspectLight
|
|
85
|
+
};
|