@tomorrowevening/hermes 0.0.7 → 0.0.8
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 +540 -502
- package/dist/hermes.umd.cjs +12 -12
- package/package.json +1 -1
- package/src/editor/sceneHierarchy/inspector/Inspector.tsx +5 -3
- 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/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
@@ -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'],
|
@@ -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[];
|