@tomorrowevening/hermes 0.0.7 → 0.0.9
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/hermes.js +1588 -1494
- package/dist/hermes.umd.cjs +52 -14
- package/package.json +3 -1
- package/src/editor/sceneHierarchy/inspector/Inspector.tsx +5 -3
- package/src/editor/sceneHierarchy/inspector/MultiView/MultiView.tsx +13 -69
- package/src/editor/sceneHierarchy/inspector/MultiView/MultiViewData.ts +67 -0
- package/src/editor/sceneHierarchy/inspector/MultiView/UVMaterial.ts +55 -0
- package/src/editor/sceneHierarchy/inspector/utils/InspectCamera.tsx +1 -1
- package/src/editor/sceneHierarchy/inspector/utils/InspectLight.tsx +3 -3
- package/src/editor/sceneHierarchy/inspector/utils/InspectMaterial.tsx +24 -8
- package/src/editor/sceneHierarchy/utils.ts +29 -23
- package/src/index.ts +2 -1
- package/types/editor/sceneHierarchy/inspector/MultiView/MultiView.d.ts +1 -1
- package/types/editor/sceneHierarchy/inspector/MultiView/MultiViewData.d.ts +16 -0
- package/types/editor/sceneHierarchy/inspector/MultiView/UVMaterial.d.ts +4 -0
- package/types/editor/sceneHierarchy/inspector/utils/InspectCamera.d.ts +1 -1
- package/types/editor/sceneHierarchy/inspector/utils/InspectLight.d.ts +1 -1
- package/types/editor/sceneHierarchy/inspector/utils/InspectMaterial.d.ts +1 -1
- package/types/index.d.ts +2 -1
@@ -1,69 +1,25 @@
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
2
|
-
import { AxesHelper, Camera, CameraHelper,
|
2
|
+
import { AxesHelper, Camera, CameraHelper, OrthographicCamera, PerspectiveCamera, Scene, Vector2, WebGLRenderer } from 'three';
|
3
3
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
4
4
|
import CameraWindow, { Dropdown } from './CameraWindow';
|
5
5
|
import InfiniteGridHelper from './InfiniteGridHelper';
|
6
|
+
import { cameraOptions, cameras, controls, helpers, ModeOptions, MultiViewMode, normalsMaterial, RenderMode, renderOptions, uvMaterial, wireframeMaterial } from './MultiViewData';
|
6
7
|
import './MultiView.scss';
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
let currentRenderMode: RenderMode = 'Default';
|
10
|
+
|
11
|
+
const scene = new Scene();
|
12
|
+
let tlCam = cameras.get('Debug')!;
|
13
|
+
let trCam = cameras.get('Orthographic')!;
|
14
|
+
let blCam = cameras.get('Front')!;
|
15
|
+
let brCam = cameras.get('Top')!;
|
16
|
+
|
15
17
|
interface MultiViewProps {
|
16
18
|
scene: Scene;
|
17
19
|
renderer: WebGLRenderer;
|
18
20
|
cameras: Camera[];
|
19
21
|
mode?: MultiViewMode;
|
20
22
|
}
|
21
|
-
|
22
|
-
const cameras: Map<string, Camera> = new Map();
|
23
|
-
const controls: Map<string, OrbitControls> = new Map();
|
24
|
-
const helpers: Map<string, CameraHelper> = new Map();
|
25
|
-
|
26
|
-
function createOrtho(name: string, position: Vector3) {
|
27
|
-
const camera = new OrthographicCamera(-100, 100, 100, -100, 50, 3000);
|
28
|
-
camera.name = name;
|
29
|
-
camera.position.copy(position);
|
30
|
-
camera.lookAt(0, 0, 0);
|
31
|
-
cameras.set(name, camera);
|
32
|
-
return camera;
|
33
|
-
}
|
34
|
-
|
35
|
-
// Cameras
|
36
|
-
|
37
|
-
createOrtho('Top', new Vector3(0, 1000, 0));
|
38
|
-
createOrtho('Bottom', new Vector3(0, -1000, 0));
|
39
|
-
createOrtho('Left', new Vector3(-1000, 0, 0));
|
40
|
-
createOrtho('Right', new Vector3(1000, 0, 0));
|
41
|
-
createOrtho('Front', new Vector3(0, 0, 1000));
|
42
|
-
createOrtho('Back', new Vector3(0, 0, -1000));
|
43
|
-
createOrtho('Orthographic', new Vector3(1000, 1000, 1000));
|
44
|
-
|
45
|
-
const debugCamera = new PerspectiveCamera(60, 1, 50, 3000);
|
46
|
-
debugCamera.name = 'Debug';
|
47
|
-
debugCamera.position.set(500, 500, 500);
|
48
|
-
debugCamera.lookAt(0, 0, 0);
|
49
|
-
cameras.set('Debug', debugCamera);
|
50
|
-
|
51
|
-
type RenderMode = 'Default' | 'Normals' | 'Wireframe';
|
52
|
-
let currentRenderMode: RenderMode = 'Default';
|
53
|
-
const renderOptions: RenderMode[] = [
|
54
|
-
'Default',
|
55
|
-
'Normals',
|
56
|
-
'Wireframe',
|
57
|
-
];
|
58
|
-
const normalsMaterial = new MeshNormalMaterial();
|
59
|
-
const wireframeMaterial = new MeshBasicMaterial({
|
60
|
-
opacity: 0.33,
|
61
|
-
transparent: true,
|
62
|
-
wireframe: true
|
63
|
-
});
|
64
|
-
|
65
|
-
const scene = new Scene();
|
66
|
-
|
67
23
|
export default function MultiView(props: MultiViewProps) {
|
68
24
|
const [mode, setMode] = useState<MultiViewMode>(props.mode !== undefined ? props.mode : 'Quad');
|
69
25
|
|
@@ -72,11 +28,6 @@ export default function MultiView(props: MultiViewProps) {
|
|
72
28
|
const blWindow = useRef<HTMLDivElement>(null);
|
73
29
|
const brWindow = useRef<HTMLDivElement>(null);
|
74
30
|
|
75
|
-
let tlCam = cameras.get('Debug')!;
|
76
|
-
let trCam = cameras.get('Orthographic')!;
|
77
|
-
let blCam = cameras.get('Front')!;
|
78
|
-
let brCam = cameras.get('Top')!;
|
79
|
-
|
80
31
|
const createControls = (camera: Camera, element: HTMLDivElement) => {
|
81
32
|
// Previous items
|
82
33
|
const prevControls = controls.get(camera.name);
|
@@ -316,16 +267,6 @@ export default function MultiView(props: MultiViewProps) {
|
|
316
267
|
};
|
317
268
|
}, [mode]);
|
318
269
|
|
319
|
-
const cameraOptions: string[] = [
|
320
|
-
'Top',
|
321
|
-
'Bottom',
|
322
|
-
'Left',
|
323
|
-
'Right',
|
324
|
-
'Front',
|
325
|
-
'Back',
|
326
|
-
'Orthographic',
|
327
|
-
'Debug',
|
328
|
-
];
|
329
270
|
props.cameras.forEach((camera: Camera) => {
|
330
271
|
cameras.set(camera.name, camera);
|
331
272
|
cameraOptions.push(camera.name);
|
@@ -441,6 +382,9 @@ export default function MultiView(props: MultiViewProps) {
|
|
441
382
|
case 'Wireframe':
|
442
383
|
scene.overrideMaterial = wireframeMaterial;
|
443
384
|
break;
|
385
|
+
case 'UVs':
|
386
|
+
scene.overrideMaterial = uvMaterial;
|
387
|
+
break;
|
444
388
|
}
|
445
389
|
}}
|
446
390
|
/>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { Camera, CameraHelper, MeshBasicMaterial, MeshNormalMaterial, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
|
2
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
3
|
+
import UVMaterial from './UVMaterial';
|
4
|
+
|
5
|
+
export type MultiViewMode = 'Single' | 'Side by Side' | 'Stacked' |'Quad';
|
6
|
+
export const ModeOptions: MultiViewMode[] = [
|
7
|
+
'Single',
|
8
|
+
'Side by Side',
|
9
|
+
'Stacked',
|
10
|
+
'Quad'
|
11
|
+
];
|
12
|
+
|
13
|
+
// Cameras
|
14
|
+
|
15
|
+
export const cameras: Map<string, Camera> = new Map();
|
16
|
+
export const controls: Map<string, OrbitControls> = new Map();
|
17
|
+
export const helpers: Map<string, CameraHelper> = new Map();
|
18
|
+
export const cameraOptions: string[] = [
|
19
|
+
'Top',
|
20
|
+
'Bottom',
|
21
|
+
'Left',
|
22
|
+
'Right',
|
23
|
+
'Front',
|
24
|
+
'Back',
|
25
|
+
'Orthographic',
|
26
|
+
'Debug',
|
27
|
+
];
|
28
|
+
|
29
|
+
export function createOrtho(name: string, position: Vector3) {
|
30
|
+
const camera = new OrthographicCamera(-100, 100, 100, -100, 50, 3000);
|
31
|
+
camera.name = name;
|
32
|
+
camera.position.copy(position);
|
33
|
+
camera.lookAt(0, 0, 0);
|
34
|
+
cameras.set(name, camera);
|
35
|
+
return camera;
|
36
|
+
}
|
37
|
+
|
38
|
+
createOrtho('Top', new Vector3(0, 1000, 0));
|
39
|
+
createOrtho('Bottom', new Vector3(0, -1000, 0));
|
40
|
+
createOrtho('Left', new Vector3(-1000, 0, 0));
|
41
|
+
createOrtho('Right', new Vector3(1000, 0, 0));
|
42
|
+
createOrtho('Front', new Vector3(0, 0, 1000));
|
43
|
+
createOrtho('Back', new Vector3(0, 0, -1000));
|
44
|
+
createOrtho('Orthographic', new Vector3(1000, 1000, 1000));
|
45
|
+
|
46
|
+
export const debugCamera = new PerspectiveCamera(60, 1, 50, 3000);
|
47
|
+
debugCamera.name = 'Debug';
|
48
|
+
debugCamera.position.set(500, 500, 500);
|
49
|
+
debugCamera.lookAt(0, 0, 0);
|
50
|
+
cameras.set('Debug', debugCamera);
|
51
|
+
|
52
|
+
// Rendering
|
53
|
+
|
54
|
+
export type RenderMode = 'Default' | 'Normals' | 'Wireframe' | 'UVs';
|
55
|
+
export const renderOptions: RenderMode[] = [
|
56
|
+
'Default',
|
57
|
+
'Normals',
|
58
|
+
'Wireframe',
|
59
|
+
'UVs',
|
60
|
+
];
|
61
|
+
export const normalsMaterial = new MeshNormalMaterial();
|
62
|
+
export const wireframeMaterial = new MeshBasicMaterial({
|
63
|
+
opacity: 0.33,
|
64
|
+
transparent: true,
|
65
|
+
wireframe: true
|
66
|
+
});
|
67
|
+
export const uvMaterial = new UVMaterial();
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import { ShaderMaterial } from "three";
|
2
|
+
|
3
|
+
const vertex = `#include <common>
|
4
|
+
#include <batching_pars_vertex>
|
5
|
+
#include <uv_pars_vertex>
|
6
|
+
#include <color_pars_vertex>
|
7
|
+
#include <morphtarget_pars_vertex>
|
8
|
+
#include <skinning_pars_vertex>
|
9
|
+
#include <logdepthbuf_pars_vertex>
|
10
|
+
#include <clipping_planes_pars_vertex>
|
11
|
+
|
12
|
+
void main() {
|
13
|
+
#include <uv_vertex>
|
14
|
+
#include <color_vertex>
|
15
|
+
#include <morphcolor_vertex>
|
16
|
+
#include <batching_vertex>
|
17
|
+
|
18
|
+
#if defined ( USE_SKINNING )
|
19
|
+
#include <beginnormal_vertex>
|
20
|
+
#include <morphnormal_vertex>
|
21
|
+
#include <skinbase_vertex>
|
22
|
+
#include <skinnormal_vertex>
|
23
|
+
#include <defaultnormal_vertex>
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#include <begin_vertex>
|
27
|
+
#include <morphtarget_vertex>
|
28
|
+
#include <skinning_vertex>
|
29
|
+
#include <project_vertex>
|
30
|
+
#include <logdepthbuf_vertex>
|
31
|
+
#include <clipping_planes_vertex>
|
32
|
+
#include <worldpos_vertex>
|
33
|
+
}`;
|
34
|
+
|
35
|
+
const fragment = `
|
36
|
+
#include <common>
|
37
|
+
#include <uv_pars_fragment>
|
38
|
+
#include <clipping_planes_pars_fragment>
|
39
|
+
|
40
|
+
void main() {
|
41
|
+
#include <clipping_planes_fragment>
|
42
|
+
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
43
|
+
}`;
|
44
|
+
|
45
|
+
export default class UVMaterial extends ShaderMaterial {
|
46
|
+
constructor() {
|
47
|
+
super({
|
48
|
+
defines: {
|
49
|
+
USE_UV: ''
|
50
|
+
},
|
51
|
+
vertexShader: vertex,
|
52
|
+
fragmentShader: fragment,
|
53
|
+
});
|
54
|
+
}
|
55
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import RemoteThree from '@/core/remote/RemoteThree';
|
2
2
|
import InspectorGroup from '../InspectorGroup';
|
3
|
-
import { RemoteObject } from
|
3
|
+
import { RemoteObject } from '../../types';
|
4
4
|
import { setItemProps } from '../../utils';
|
5
5
|
|
6
6
|
function prettyName(name: string): string {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import
|
2
|
-
import { RemoteObject } from "../../types";
|
1
|
+
import { Color } from 'three';
|
3
2
|
import RemoteThree from '@/core/remote/RemoteThree';
|
3
|
+
import InspectorGroup from '../InspectorGroup';
|
4
|
+
import { RemoteObject } from '../../types';
|
4
5
|
import { setItemProps } from '../../utils';
|
5
|
-
import { Color } from 'three';
|
6
6
|
|
7
7
|
function prettyName(value: string): string {
|
8
8
|
switch (value) {
|
@@ -38,17 +38,21 @@ export function acceptedMaterialNames(name: string): boolean {
|
|
38
38
|
);
|
39
39
|
}
|
40
40
|
|
41
|
-
export function
|
41
|
+
export function prettyName(name: string): string {
|
42
42
|
switch (name) {
|
43
43
|
case 'alphaMap': return 'Alpha Map';
|
44
|
+
case 'anisotropyMap': return 'Anisotropy Map';
|
44
45
|
case 'anisotropyRotation': return 'Anisotropy Rotation';
|
45
46
|
case 'aoMap': return 'AO Map';
|
46
47
|
case 'aoMapIntensity': return 'AO Map Intensity';
|
47
48
|
case 'attenuationColor': return 'Attenuation Color';
|
48
49
|
case 'bumpMap': return 'Bump Map';
|
49
50
|
case 'bumpScale': return 'Bump Scale';
|
51
|
+
case 'clearcoatMap': return 'Clearcoat Map';
|
52
|
+
case 'clearcoatNormalMap': return 'Clearcoat Normal Map';
|
50
53
|
case 'clearcoatNormalScale': return 'Clearcoat Normal Scale';
|
51
54
|
case 'clearcoatRoughness': return 'Clearcoat Roughness';
|
55
|
+
case 'clearcoatRoughnessMap': return 'Clearcoat Roughness Map';
|
52
56
|
case 'color': return 'Color';
|
53
57
|
case 'defines': return 'Defines';
|
54
58
|
case 'depthTest': return 'Depth Test';
|
@@ -58,6 +62,7 @@ export function niceMaterialNames(name: string): string {
|
|
58
62
|
case 'displacementScale': return 'Displacement Scale';
|
59
63
|
case 'dithering': return 'Dithering';
|
60
64
|
case 'emissive': return 'Emissive';
|
65
|
+
case 'emissiveMap': return 'Emissive Map';
|
61
66
|
case 'emissiveIntensity': return 'Emissive Intensity';
|
62
67
|
case 'envMap': return 'Environment Map';
|
63
68
|
case 'envMapIntensity': return 'Environment Map Intensity';
|
@@ -68,6 +73,8 @@ export function niceMaterialNames(name: string): string {
|
|
68
73
|
case 'gradientMap': return 'Gradient Map';
|
69
74
|
case 'ior': return 'IOR';
|
70
75
|
case 'iridescenceIOR': return 'Iridescence IOR';
|
76
|
+
case 'iridescenceMap': return 'Iridescence Map';
|
77
|
+
case 'iridescenceThicknessMap': return 'Iridescence Thickness Map';
|
71
78
|
case 'iridescenceThicknessRange': return 'Iridescence Thickness Range';
|
72
79
|
case 'lights': return 'Lights';
|
73
80
|
case 'lightMap': return 'Light Map';
|
@@ -75,6 +82,7 @@ export function niceMaterialNames(name: string): string {
|
|
75
82
|
case 'map': return 'Map';
|
76
83
|
case 'matcap': return 'Matcap';
|
77
84
|
case 'metalness': return 'Metalness';
|
85
|
+
case 'metalnessMap': return 'Metalness Map';
|
78
86
|
case 'name': return 'Name';
|
79
87
|
case 'normalMap': return 'Normal Map';
|
80
88
|
case 'normalScale': return 'Normal Scale';
|
@@ -82,13 +90,21 @@ export function niceMaterialNames(name: string): string {
|
|
82
90
|
case 'reflectivity': return 'Reflectivity';
|
83
91
|
case 'refractionRatio': return 'Refraction Ratio';
|
84
92
|
case 'roughness': return 'Roughness';
|
93
|
+
case 'roughnessMap': return 'Roughness Map';
|
85
94
|
case 'sheenColor': return 'Sheen Color';
|
95
|
+
case 'sheenColorMap': return 'Sheen Color Map';
|
86
96
|
case 'sheenRoughness': return 'Sheen Roughness';
|
97
|
+
case 'sheenRoughnessMap': return 'Sheen Roughness Map';
|
87
98
|
case 'shininess': return 'Shininess';
|
88
99
|
case 'specular': return 'Specular';
|
89
100
|
case 'specularColor': return 'Specular Color';
|
101
|
+
case 'specularColorMap': return 'Specular Color Map';
|
90
102
|
case 'specularIntensity': return 'Specular Intensity';
|
103
|
+
case 'specularIntensityMap': return 'Specular Map Intensity';
|
91
104
|
case 'thickness': return 'Thickness';
|
105
|
+
case 'thicknessMap': return 'Thickness Map';
|
106
|
+
case 'transmission': return 'Transmission';
|
107
|
+
case 'transmissionMap': return 'Transmission Map';
|
92
108
|
case 'transparent': return 'Transparent';
|
93
109
|
case 'type': return 'Type';
|
94
110
|
case 'uuid': return 'UUID';
|
@@ -147,7 +163,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
147
163
|
const value = material[i];
|
148
164
|
if (propType === 'boolean' || propType === 'number' || propType === 'string') {
|
149
165
|
const newField = {
|
150
|
-
title:
|
166
|
+
title: prettyName(i),
|
151
167
|
prop: i,
|
152
168
|
type: propType,
|
153
169
|
value: value,
|
@@ -176,7 +192,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
176
192
|
} else if (propType === 'object') {
|
177
193
|
if (value.isColor) {
|
178
194
|
items.push({
|
179
|
-
title:
|
195
|
+
title: prettyName(i),
|
180
196
|
prop: i,
|
181
197
|
type: 'color',
|
182
198
|
value: value,
|
@@ -204,7 +220,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
204
220
|
});
|
205
221
|
}
|
206
222
|
items.push({
|
207
|
-
title:
|
223
|
+
title: prettyName(i),
|
208
224
|
items: subChildren,
|
209
225
|
});
|
210
226
|
} else {
|
@@ -218,7 +234,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
218
234
|
case 'string':
|
219
235
|
if (n === 'src') {
|
220
236
|
items.push({
|
221
|
-
title:
|
237
|
+
title: prettyName(i),
|
222
238
|
type: 'image',
|
223
239
|
value: propValue,
|
224
240
|
onChange: (prop: string, value: any) => {
|
@@ -235,7 +251,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
235
251
|
});
|
236
252
|
} else {
|
237
253
|
subChildren.push({
|
238
|
-
title: `${
|
254
|
+
title: `${prettyName(n)}`,
|
239
255
|
prop: `material.${i}.${n}`,
|
240
256
|
type: `${typeof material[i][n]}`,
|
241
257
|
value: value[n],
|
@@ -252,7 +268,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
252
268
|
// Uniform textures
|
253
269
|
if (propValue.value !== undefined && propValue.value.src !== undefined) {
|
254
270
|
subChildren.push({
|
255
|
-
title:
|
271
|
+
title: prettyName(n),
|
256
272
|
type: 'image',
|
257
273
|
value: propValue.value.src,
|
258
274
|
onChange: (prop: string, value: any) => {
|
@@ -285,7 +301,7 @@ export function inspectMaterialItems(material: RemoteMaterial, object: RemoteObj
|
|
285
301
|
|
286
302
|
if (subChildren.length > 0) {
|
287
303
|
items.push({
|
288
|
-
title:
|
304
|
+
title: prettyName(i),
|
289
305
|
items: subChildren,
|
290
306
|
});
|
291
307
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { CubeTexture, Material, Mesh, Object3D, RepeatWrapping, Texture } from 'three';
|
2
2
|
import { MinimumObject, RemoteMaterial, RemoteObject } from './types';
|
3
3
|
|
4
4
|
export function determineIcon(obj: Object3D): string {
|
@@ -132,9 +132,15 @@ export function stripObject(obj: Object3D): RemoteObject {
|
|
132
132
|
uuid: obj.uuid,
|
133
133
|
visible: obj.visible,
|
134
134
|
matrix: obj.matrix.elements,
|
135
|
+
material: undefined,
|
136
|
+
perspectiveCameraInfo: undefined,
|
137
|
+
orthographicCameraInfo: undefined,
|
138
|
+
lightInfo: undefined,
|
135
139
|
};
|
136
140
|
|
137
|
-
|
141
|
+
const type = obj.type.toLowerCase();
|
142
|
+
|
143
|
+
if (type.search('mesh') > -1) {
|
138
144
|
const mesh = obj as Mesh;
|
139
145
|
if (Array.isArray(mesh.material)) {
|
140
146
|
const data: RemoteMaterial[] = [];
|
@@ -145,33 +151,33 @@ export function stripObject(obj: Object3D): RemoteObject {
|
|
145
151
|
} else {
|
146
152
|
stripped.material = stripMaterialData(mesh.material);
|
147
153
|
}
|
148
|
-
} else if (
|
149
|
-
if (obj
|
154
|
+
} else if (type.search('camera') > -1) {
|
155
|
+
if (obj.type === 'PerspectiveCamera') {
|
150
156
|
stripped.perspectiveCameraInfo = {
|
151
|
-
fov: obj
|
152
|
-
zoom: obj
|
153
|
-
near: obj
|
154
|
-
far: obj
|
155
|
-
focus: obj
|
156
|
-
aspect: obj
|
157
|
-
filmGauge: obj
|
158
|
-
filmOffset: obj
|
157
|
+
fov: obj['fov'],
|
158
|
+
zoom: obj['zoom'],
|
159
|
+
near: obj['near'],
|
160
|
+
far: obj['far'],
|
161
|
+
focus: obj['focus'],
|
162
|
+
aspect: obj['aspect'],
|
163
|
+
filmGauge: obj['filmGauge'],
|
164
|
+
filmOffset: obj['filmOffset'],
|
159
165
|
};
|
160
|
-
} else if (obj
|
166
|
+
} else if (obj.type === 'OrthographicCamera') {
|
161
167
|
stripped.orthographicCameraInfo = {
|
162
|
-
zoom: obj
|
163
|
-
near: obj
|
164
|
-
far: obj
|
165
|
-
left: obj
|
166
|
-
right: obj
|
167
|
-
top: obj
|
168
|
-
bottom: obj
|
168
|
+
zoom: obj['zoom'],
|
169
|
+
near: obj['near'],
|
170
|
+
far: obj['far'],
|
171
|
+
left: obj['left'],
|
172
|
+
right: obj['right'],
|
173
|
+
top: obj['top'],
|
174
|
+
bottom: obj['bottom'],
|
169
175
|
};
|
170
176
|
}
|
171
|
-
} else if (
|
177
|
+
} else if (type.search('light') > -1) {
|
172
178
|
stripped.lightInfo = {
|
173
|
-
color: obj
|
174
|
-
intensity: obj
|
179
|
+
color: obj['color'],
|
180
|
+
intensity: obj['intensity'],
|
175
181
|
decay: obj['decay'],
|
176
182
|
distance: obj['distance'],
|
177
183
|
angle: obj['angle'],
|
package/src/index.ts
CHANGED
@@ -15,6 +15,8 @@ export { default as DropdownItem } from './editor/components/DropdownItem';
|
|
15
15
|
export { default as Dropdown } from './editor/components/Dropdown';
|
16
16
|
export { default as RemoteController } from './core/RemoteController';
|
17
17
|
// RemoteThree
|
18
|
+
export { default as InfiniteGridHelper } from './editor/sceneHierarchy/inspector/MultiView/InfiniteGridHelper';
|
19
|
+
export { default as UVMaterial } from './editor/sceneHierarchy/inspector/MultiView/UVMaterial';
|
18
20
|
export { default as SceneHierarchy } from './editor/sceneHierarchy/SceneHierarchy';
|
19
21
|
export { default as Accordion } from './editor/sceneHierarchy/Accordion';
|
20
22
|
export { default as ChildObject } from './editor/sceneHierarchy/ChildObject';
|
@@ -22,5 +24,4 @@ export { default as ContainerObject } from './editor/sceneHierarchy/ContainerObj
|
|
22
24
|
export { default as Inspector } from './editor/sceneHierarchy/inspector/Inspector';
|
23
25
|
export { default as SceneInspector } from './editor/sceneHierarchy/inspector/SceneInspector';
|
24
26
|
export { default as MultiView } from './editor/sceneHierarchy/inspector/MultiView/MultiView';
|
25
|
-
export { default as InfiniteGridHelper } from './editor/sceneHierarchy/inspector/MultiView/InfiniteGridHelper';
|
26
27
|
export { default as Editor } from './editor/Editor';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Camera, Scene, WebGLRenderer } from 'three';
|
2
|
+
import { MultiViewMode } from './MultiViewData';
|
2
3
|
import './MultiView.scss';
|
3
|
-
type MultiViewMode = 'Single' | 'Side by Side' | 'Stacked' | 'Quad';
|
4
4
|
interface MultiViewProps {
|
5
5
|
scene: Scene;
|
6
6
|
renderer: WebGLRenderer;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Camera, CameraHelper, MeshBasicMaterial, MeshNormalMaterial, OrthographicCamera, PerspectiveCamera, Vector3 } from 'three';
|
2
|
+
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
|
3
|
+
import UVMaterial from './UVMaterial';
|
4
|
+
export type MultiViewMode = 'Single' | 'Side by Side' | 'Stacked' | 'Quad';
|
5
|
+
export declare const ModeOptions: MultiViewMode[];
|
6
|
+
export declare const cameras: Map<string, Camera>;
|
7
|
+
export declare const controls: Map<string, OrbitControls>;
|
8
|
+
export declare const helpers: Map<string, CameraHelper>;
|
9
|
+
export declare const cameraOptions: string[];
|
10
|
+
export declare function createOrtho(name: string, position: Vector3): OrthographicCamera;
|
11
|
+
export declare const debugCamera: PerspectiveCamera;
|
12
|
+
export type RenderMode = 'Default' | 'Normals' | 'Wireframe' | 'UVs';
|
13
|
+
export declare const renderOptions: RenderMode[];
|
14
|
+
export declare const normalsMaterial: MeshNormalMaterial;
|
15
|
+
export declare const wireframeMaterial: MeshBasicMaterial;
|
16
|
+
export declare const uvMaterial: UVMaterial;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { RemoteMaterial, RemoteObject } from "../../types";
|
2
2
|
import RemoteThree from '@/core/remote/RemoteThree';
|
3
3
|
export declare function acceptedMaterialNames(name: string): boolean;
|
4
|
-
export declare function
|
4
|
+
export declare function prettyName(name: string): string;
|
5
5
|
export declare function clampedNames(name: string): boolean;
|
6
6
|
export declare function uploadLocalImage(): Promise<string>;
|
7
7
|
export declare function inspectMaterialItems(material: RemoteMaterial, object: RemoteObject, three: RemoteThree): any[];
|
package/types/index.d.ts
CHANGED
@@ -12,6 +12,8 @@ export { default as Draggable } from './editor/components/Draggable';
|
|
12
12
|
export { default as DropdownItem } from './editor/components/DropdownItem';
|
13
13
|
export { default as Dropdown } from './editor/components/Dropdown';
|
14
14
|
export { default as RemoteController } from './core/RemoteController';
|
15
|
+
export { default as InfiniteGridHelper } from './editor/sceneHierarchy/inspector/MultiView/InfiniteGridHelper';
|
16
|
+
export { default as UVMaterial } from './editor/sceneHierarchy/inspector/MultiView/UVMaterial';
|
15
17
|
export { default as SceneHierarchy } from './editor/sceneHierarchy/SceneHierarchy';
|
16
18
|
export { default as Accordion } from './editor/sceneHierarchy/Accordion';
|
17
19
|
export { default as ChildObject } from './editor/sceneHierarchy/ChildObject';
|
@@ -19,5 +21,4 @@ export { default as ContainerObject } from './editor/sceneHierarchy/ContainerObj
|
|
19
21
|
export { default as Inspector } from './editor/sceneHierarchy/inspector/Inspector';
|
20
22
|
export { default as SceneInspector } from './editor/sceneHierarchy/inspector/SceneInspector';
|
21
23
|
export { default as MultiView } from './editor/sceneHierarchy/inspector/MultiView/MultiView';
|
22
|
-
export { default as InfiniteGridHelper } from './editor/sceneHierarchy/inspector/MultiView/InfiniteGridHelper';
|
23
24
|
export { default as Editor } from './editor/Editor';
|