@babylonjs/inspector 8.39.0-preview → 8.39.1
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/babylon.inspector.bundle.js +3 -0
- package/dist/babylon.inspector.bundle.js.LICENSE.txt +72 -0
- package/dist/babylon.inspector.bundle.js.map +1 -0
- package/dist/babylon.inspector.bundle.max.js +3 -0
- package/dist/babylon.inspector.module.d.ts +9236 -0
- package/package.json +36 -20
- package/readme.md +17 -14
- package/lib/captureService-BNAvQLVs.js +0 -192
- package/lib/captureService-BNAvQLVs.js.map +0 -1
- package/lib/exportService-BqnzQ5KY.js +0 -242
- package/lib/exportService-BqnzQ5KY.js.map +0 -1
- package/lib/extensionsListService-CvofHYEa.js +0 -327
- package/lib/extensionsListService-CvofHYEa.js.map +0 -1
- package/lib/importService-Bv9STG4_.js +0 -174
- package/lib/importService-Bv9STG4_.js.map +0 -1
- package/lib/index-DUdNW7K3.js +0 -10323
- package/lib/index-DUdNW7K3.js.map +0 -1
- package/lib/index.d.ts +0 -72149
- package/lib/index.js +0 -110
- package/lib/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babylonjs/inspector",
|
|
3
|
-
"version": "8.39.
|
|
4
|
-
"
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"types": "lib/index.d.ts",
|
|
3
|
+
"version": "8.39.1",
|
|
4
|
+
"module": "dist/babylon.inspector.bundle.js",
|
|
5
|
+
"main": "dist/babylon.inspector.bundle.js",
|
|
6
|
+
"esnext": "dist/babylon.inspector.bundle.js",
|
|
7
|
+
"typings": "dist/babylon.inspector.module.d.ts",
|
|
9
8
|
"files": [
|
|
10
|
-
"
|
|
11
|
-
"lib/**/*.d.ts",
|
|
12
|
-
"lib/**/*.map",
|
|
9
|
+
"dist/**/*.*",
|
|
13
10
|
"readme.md",
|
|
14
11
|
"license.md"
|
|
15
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "npm run clean && npm run build:prod && npm run build:declaration",
|
|
15
|
+
"build:dev": "webpack --env development",
|
|
16
|
+
"build:prod": "webpack --env production",
|
|
17
|
+
"build:declaration": "build-tools -c pud --config ./config.json",
|
|
18
|
+
"clean": "rimraf dist"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@fortawesome/fontawesome-svg-core": "^6.1.0",
|
|
22
|
+
"@fortawesome/free-regular-svg-icons": "^6.0.0",
|
|
23
|
+
"@fortawesome/free-solid-svg-icons": "^6.0.0"
|
|
24
|
+
},
|
|
16
25
|
"peerDependencies": {
|
|
17
26
|
"@babylonjs/addons": "^8.0.0",
|
|
18
27
|
"@babylonjs/core": "^8.0.0",
|
|
19
28
|
"@babylonjs/gui": "^8.0.0",
|
|
29
|
+
"@babylonjs/gui-editor": "^8.0.0",
|
|
20
30
|
"@babylonjs/loaders": "^8.0.0",
|
|
21
31
|
"@babylonjs/materials": "^8.0.0",
|
|
22
32
|
"@babylonjs/serializers": "^8.0.0",
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
33
|
+
"@types/react": ">=16.7.3",
|
|
34
|
+
"@types/react-dom": ">=16.0.9"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@babylonjs/addons": "^8.39.1",
|
|
38
|
+
"@babylonjs/core": "^8.39.1",
|
|
39
|
+
"@babylonjs/gui": "^8.39.1",
|
|
40
|
+
"@babylonjs/gui-editor": "^8.39.1",
|
|
41
|
+
"@babylonjs/loaders": "^8.39.1",
|
|
42
|
+
"@babylonjs/materials": "^8.39.1",
|
|
43
|
+
"@babylonjs/serializers": "^8.39.1",
|
|
44
|
+
"@lts/gui": "1.0.0",
|
|
45
|
+
"react": "^18.2.0",
|
|
46
|
+
"react-dom": "^18.2.0"
|
|
29
47
|
},
|
|
30
48
|
"keywords": [
|
|
31
49
|
"3D",
|
|
32
50
|
"javascript",
|
|
33
51
|
"html5",
|
|
34
52
|
"webgl",
|
|
35
|
-
"babylon.js"
|
|
36
|
-
"inspector",
|
|
37
|
-
"diagnostic",
|
|
38
|
-
"debug"
|
|
53
|
+
"babylon.js"
|
|
39
54
|
],
|
|
40
55
|
"license": "Apache-2.0",
|
|
56
|
+
"sideEffects": true,
|
|
41
57
|
"homepage": "https://www.babylonjs.com",
|
|
42
58
|
"repository": {
|
|
43
59
|
"type": "git",
|
|
@@ -46,4 +62,4 @@
|
|
|
46
62
|
"bugs": {
|
|
47
63
|
"url": "https://github.com/BabylonJS/Babylon.js/issues"
|
|
48
64
|
}
|
|
49
|
-
}
|
|
65
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Babylon.js inspector module
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
For usage documentation please visit https://doc.babylonjs.com/how_to/debug_layer.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
# Installation instructions
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
To install using npm :
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @babylonjs/inspector@preview
|
|
9
|
+
```shell
|
|
10
|
+
npm install @babylonjs/core @babylonjs/inspector
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import { ShowInspector } from "@babylonjs/inspector";
|
|
13
|
+
# How to use
|
|
19
14
|
|
|
20
|
-
|
|
15
|
+
Afterwards it can be imported to your project using:
|
|
21
16
|
|
|
22
|
-
|
|
17
|
+
```javascript
|
|
18
|
+
import "@babylonjs/core/Debug/debugLayer";
|
|
19
|
+
import "@babylonjs/inspector";
|
|
23
20
|
```
|
|
21
|
+
|
|
22
|
+
The first line will ensure you can access the property debugLayer of the scene while the second will ensure the inspector can be used within your scene.
|
|
23
|
+
|
|
24
|
+
This is a great example where code splitting or conditional loading could be used to ensure you are not delivering the inspector if not part of your final app.
|
|
25
|
+
|
|
26
|
+
For more information you can have a look at our [ES6 dedicated documentation](https://doc.babylonjs.com/features/es6_support).
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { B as ButtonLine, a as SyncedSliderPropertyLine, S as SwitchPropertyLine, C as Collapse, T as ToolsServiceIdentity } from './index-DUdNW7K3.js';
|
|
3
|
-
import { useState, useRef, useCallback } from 'react';
|
|
4
|
-
import { Tools } from '@babylonjs/core/Misc/tools.js';
|
|
5
|
-
import { VideoRecorder } from '@babylonjs/core/Misc/videoRecorder.js';
|
|
6
|
-
import { captureEquirectangularFromScene } from '@babylonjs/core/Misc/equirectangularCapture.js';
|
|
7
|
-
import { CameraRegular, RecordStopRegular, RecordRegular } from '@fluentui/react-icons';
|
|
8
|
-
import { FrameGraphUtils } from '@babylonjs/core/FrameGraph/frameGraphUtils.js';
|
|
9
|
-
import '@babylonjs/core/Maths/math.color.js';
|
|
10
|
-
import '@babylonjs/core/Maths/math.vector.js';
|
|
11
|
-
import '@babylonjs/core/Misc/observable.js';
|
|
12
|
-
import '@fluentui/react-components';
|
|
13
|
-
import '@fluentui/react-motion-components-preview';
|
|
14
|
-
import '@babylonjs/core/Misc/typeStore.js';
|
|
15
|
-
import 'usehooks-ts';
|
|
16
|
-
import '@babylonjs/core/Misc/asyncLock.js';
|
|
17
|
-
import '@babylonjs/core/Misc/deferred.js';
|
|
18
|
-
import '@babylonjs/core/Maths/math.scalar.functions.js';
|
|
19
|
-
import '@fluentui-contrib/react-virtualizer';
|
|
20
|
-
import '@babylonjs/addons/msdfText/fontAsset.js';
|
|
21
|
-
import '@babylonjs/addons/msdfText/textRenderer.js';
|
|
22
|
-
import '@babylonjs/core/Debug/physicsViewer.js';
|
|
23
|
-
import '@babylonjs/core/Materials/Textures/texture.js';
|
|
24
|
-
import '@babylonjs/core/Materials/materialFlags.js';
|
|
25
|
-
import '@babylonjs/core/Materials/standardMaterial.js';
|
|
26
|
-
import '@babylonjs/core/Meshes/Builders/groundBuilder.js';
|
|
27
|
-
import '@babylonjs/core/Rendering/utilityLayerRenderer.js';
|
|
28
|
-
import '@babylonjs/materials/grid/gridMaterial.js';
|
|
29
|
-
import '@babylonjs/core/Misc/dataStorage.js';
|
|
30
|
-
import '@babylonjs/core/Instrumentation/engineInstrumentation.js';
|
|
31
|
-
import '@babylonjs/core/Instrumentation/sceneInstrumentation.js';
|
|
32
|
-
import '@babylonjs/core/Engines/AbstractEngine/abstractEngine.timeQuery.js';
|
|
33
|
-
import '@babylonjs/core/Engines/Extensions/engine.query.js';
|
|
34
|
-
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js';
|
|
35
|
-
import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js';
|
|
36
|
-
import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js';
|
|
37
|
-
import '@babylonjs/core/Misc/pressureObserverWrapper.js';
|
|
38
|
-
import '@babylonjs/core/Engines/abstractEngine.js';
|
|
39
|
-
import 'react-dom/client';
|
|
40
|
-
import '@babylonjs/core/Misc/logger.js';
|
|
41
|
-
import '@babylonjs/core/Gizmos/cameraGizmo.js';
|
|
42
|
-
import '@babylonjs/core/Gizmos/lightGizmo.js';
|
|
43
|
-
import '@babylonjs/core/Bones/bone.js';
|
|
44
|
-
import '@babylonjs/core/Cameras/camera.js';
|
|
45
|
-
import '@babylonjs/core/Gizmos/gizmoManager.js';
|
|
46
|
-
import '@babylonjs/core/Lights/light.js';
|
|
47
|
-
import '@babylonjs/core/Meshes/abstractMesh.js';
|
|
48
|
-
import '@babylonjs/core/node.js';
|
|
49
|
-
import '@babylonjs/core/Animations/animationGroup.js';
|
|
50
|
-
import '@babylonjs/core/Animations/animationPropertiesOverride.js';
|
|
51
|
-
import '@babylonjs/addons/atmosphere/atmosphere.js';
|
|
52
|
-
import '@babylonjs/core/Cameras/arcRotateCamera.js';
|
|
53
|
-
import '@babylonjs/core/Cameras/followCamera.js';
|
|
54
|
-
import '@babylonjs/core/Cameras/freeCamera.js';
|
|
55
|
-
import '@babylonjs/core/Cameras/targetCamera.js';
|
|
56
|
-
import '@babylonjs/core/scene.js';
|
|
57
|
-
import '@babylonjs/core/FrameGraph/frameGraph.js';
|
|
58
|
-
import '@babylonjs/core/Lights/directionalLight.js';
|
|
59
|
-
import '@babylonjs/core/Lights/hemisphericLight.js';
|
|
60
|
-
import '@babylonjs/core/Lights/pointLight.js';
|
|
61
|
-
import '@babylonjs/core/Lights/rectAreaLight.js';
|
|
62
|
-
import '@babylonjs/core/Lights/shadowLight.js';
|
|
63
|
-
import '@babylonjs/core/Lights/spotLight.js';
|
|
64
|
-
import '@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js';
|
|
65
|
-
import '@babylonjs/core/Lights/Shadows/shadowGenerator.js';
|
|
66
|
-
import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js';
|
|
67
|
-
import '@babylonjs/core/Materials/material.js';
|
|
68
|
-
import '@babylonjs/core/Materials/multiMaterial.js';
|
|
69
|
-
import '@babylonjs/core/Materials/PBR/pbrBaseMaterial.js';
|
|
70
|
-
import '@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js';
|
|
71
|
-
import '@babylonjs/core/Materials/PBR/pbrMaterial.js';
|
|
72
|
-
import '@babylonjs/core/Materials/PBR/openpbrMaterial.js';
|
|
73
|
-
import '@babylonjs/materials/sky/skyMaterial.js';
|
|
74
|
-
import '@babylonjs/core/Engines/constants.js';
|
|
75
|
-
import '@babylonjs/core/Engines/engine.js';
|
|
76
|
-
import '@babylonjs/core/Particles/particleSystem.js';
|
|
77
|
-
import '@babylonjs/core/Misc/fileTools.js';
|
|
78
|
-
import '@babylonjs/core/Meshes/mesh.js';
|
|
79
|
-
import '@babylonjs/core/Debug/skeletonViewer.js';
|
|
80
|
-
import '@babylonjs/core/Meshes/buffer.js';
|
|
81
|
-
import '@babylonjs/core/Meshes/Builders/linesBuilder.js';
|
|
82
|
-
import '@babylonjs/core/Meshes/instancedMesh.js';
|
|
83
|
-
import '@babylonjs/core/Rendering/renderingManager.js';
|
|
84
|
-
import '@babylonjs/core/Rendering/edgesRenderer.js';
|
|
85
|
-
import '@babylonjs/core/Rendering/outlineRenderer.js';
|
|
86
|
-
import '@babylonjs/core/Meshes/GaussianSplatting/gaussianSplattingMesh.js';
|
|
87
|
-
import '@babylonjs/core/Misc/gradients.js';
|
|
88
|
-
import '@babylonjs/core/Materials/Node/Blocks/gradientBlock.js';
|
|
89
|
-
import '@babylonjs/core/Particles/attractor.js';
|
|
90
|
-
import '@babylonjs/core/Meshes/Builders/sphereBuilder.js';
|
|
91
|
-
import '@babylonjs/core/Meshes/transformNode.js';
|
|
92
|
-
import '@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js';
|
|
93
|
-
import '@babylonjs/core/Physics/v2/physicsEngineComponent.js';
|
|
94
|
-
import '@babylonjs/core/PostProcesses/postProcess.js';
|
|
95
|
-
import '@babylonjs/core/Materials/Textures/cubeTexture.js';
|
|
96
|
-
import '@babylonjs/core/Materials/imageProcessingConfiguration.js';
|
|
97
|
-
import '@babylonjs/core/Bones/skeleton.js';
|
|
98
|
-
import '@babylonjs/core/Sprites/sprite.js';
|
|
99
|
-
import '@babylonjs/core/Sprites/spriteManager.js';
|
|
100
|
-
import '@babylonjs/core/Materials/Textures/baseTexture.js';
|
|
101
|
-
import '@babylonjs/core/Materials/Textures/multiRenderTarget.js';
|
|
102
|
-
import '@babylonjs/core/Materials/Textures/renderTargetTexture.js';
|
|
103
|
-
import '@babylonjs/core/Materials/Textures/thinTexture.js';
|
|
104
|
-
import '@babylonjs/core/Misc/textureTools.js';
|
|
105
|
-
import '@babylonjs/core/Rendering/boundingBoxRenderer.js';
|
|
106
|
-
import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js';
|
|
107
|
-
import '@babylonjs/core/Sprites/spriteSceneComponent.js';
|
|
108
|
-
import '@babylonjs/core/Materials/Textures/dynamicTexture.js';
|
|
109
|
-
import '@babylonjs/core/Events/pointerEvents.js';
|
|
110
|
-
import '@babylonjs/core/Engines/engineStore.js';
|
|
111
|
-
import '@babylonjs/core/Misc/uniqueIdGenerator.js';
|
|
112
|
-
|
|
113
|
-
const CaptureRttTools = ({ scene }) => {
|
|
114
|
-
const [useWidthHeight, setUseWidthHeight] = useState(false);
|
|
115
|
-
const [screenshotSize, setScreenshotSize] = useState({ precision: 1 });
|
|
116
|
-
const captureRender = useCallback(async () => {
|
|
117
|
-
const sizeToUse = { ...screenshotSize };
|
|
118
|
-
if (!useWidthHeight) {
|
|
119
|
-
sizeToUse.width = undefined;
|
|
120
|
-
sizeToUse.height = undefined;
|
|
121
|
-
}
|
|
122
|
-
if (scene.activeCamera) {
|
|
123
|
-
Tools.CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, sizeToUse, undefined, undefined, 4);
|
|
124
|
-
}
|
|
125
|
-
}, [scene, screenshotSize, useWidthHeight]);
|
|
126
|
-
return (jsxs(Fragment, { children: [jsx(ButtonLine, { label: "Capture", icon: CameraRegular, onClick: captureRender }), jsx(SyncedSliderPropertyLine, { label: "Precision", value: screenshotSize.precision ?? 1, onChange: (value) => setScreenshotSize({ ...screenshotSize, precision: value ?? 1 }), min: 0.1, max: 10, step: 0.1 }), jsx(SwitchPropertyLine, { label: "Use Custom Width/Height", value: useWidthHeight, onChange: (value) => setUseWidthHeight(value) }), jsxs(Collapse, { visible: useWidthHeight, children: [jsx(SyncedSliderPropertyLine, { label: "Width", value: screenshotSize.width ?? 512, onChange: (data) => setScreenshotSize({ ...screenshotSize, width: data ?? 512 }), min: 1, step: 1 }), jsx(SyncedSliderPropertyLine, { label: "Height", value: screenshotSize.height ?? 512, onChange: (data) => setScreenshotSize({ ...screenshotSize, height: data ?? 512 }), min: 1, step: 1 })] })] }));
|
|
127
|
-
};
|
|
128
|
-
const CaptureScreenshotTools = ({ scene }) => {
|
|
129
|
-
const [isRecording, setIsRecording] = useState(false);
|
|
130
|
-
const videoRecorder = useRef();
|
|
131
|
-
const captureScreenshot = useCallback(() => {
|
|
132
|
-
const camera = scene.frameGraph ? FrameGraphUtils.FindMainCamera(scene.frameGraph) : scene.activeCamera;
|
|
133
|
-
if (camera) {
|
|
134
|
-
Tools.CreateScreenshot(scene.getEngine(), camera, { precision: 1 });
|
|
135
|
-
}
|
|
136
|
-
}, [scene]);
|
|
137
|
-
const captureEquirectangularAsync = useCallback(async () => {
|
|
138
|
-
const currentActiveCamera = scene.activeCamera;
|
|
139
|
-
if (!currentActiveCamera && scene.frameGraph) {
|
|
140
|
-
scene.activeCamera = FrameGraphUtils.FindMainCamera(scene.frameGraph);
|
|
141
|
-
}
|
|
142
|
-
if (scene.activeCamera) {
|
|
143
|
-
await captureEquirectangularFromScene(scene, { size: 1024, filename: "equirectangular_capture.png" });
|
|
144
|
-
}
|
|
145
|
-
// eslint-disable-next-line require-atomic-updates
|
|
146
|
-
scene.activeCamera = currentActiveCamera;
|
|
147
|
-
}, [scene]);
|
|
148
|
-
const recordVideoAsync = useCallback(async () => {
|
|
149
|
-
if (videoRecorder.current && videoRecorder.current.isRecording) {
|
|
150
|
-
videoRecorder.current.stopRecording();
|
|
151
|
-
setIsRecording(false);
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (!videoRecorder.current) {
|
|
155
|
-
videoRecorder.current = new VideoRecorder(scene.getEngine());
|
|
156
|
-
}
|
|
157
|
-
void videoRecorder.current.startRecording();
|
|
158
|
-
setIsRecording(true);
|
|
159
|
-
}, [scene]);
|
|
160
|
-
return (jsxs(Fragment, { children: [jsx(ButtonLine, { label: "Capture", icon: CameraRegular, onClick: captureScreenshot }), jsx(ButtonLine, { label: "Capture Equirectangular", icon: CameraRegular, onClick: captureEquirectangularAsync }), jsx(ButtonLine, { label: isRecording ? "Stop Recording" : "Record Video", icon: isRecording ? RecordStopRegular : RecordRegular, onClick: recordVideoAsync })] }));
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
const CaptureServiceDefinition = {
|
|
164
|
-
friendlyName: "Capture Tools",
|
|
165
|
-
consumes: [ToolsServiceIdentity],
|
|
166
|
-
factory: (toolsService) => {
|
|
167
|
-
const contentRegistrations = [];
|
|
168
|
-
// Screenshot capture content
|
|
169
|
-
contentRegistrations.push(toolsService.addSectionContent({
|
|
170
|
-
key: "Screenshot Capture",
|
|
171
|
-
section: "Screenshot Capture",
|
|
172
|
-
component: ({ context }) => jsx(CaptureScreenshotTools, { scene: context }),
|
|
173
|
-
}));
|
|
174
|
-
// RTT capture content
|
|
175
|
-
contentRegistrations.push(toolsService.addSectionContent({
|
|
176
|
-
key: "RTT Capture",
|
|
177
|
-
section: "RTT Capture",
|
|
178
|
-
component: ({ context }) => jsx(CaptureRttTools, { scene: context }),
|
|
179
|
-
}));
|
|
180
|
-
return {
|
|
181
|
-
dispose: () => {
|
|
182
|
-
contentRegistrations.forEach((registration) => registration.dispose());
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
var captureService = {
|
|
188
|
-
serviceDefinitions: [CaptureServiceDefinition],
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export { CaptureServiceDefinition, captureService as default };
|
|
192
|
-
//# sourceMappingURL=captureService-BNAvQLVs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"captureService-BNAvQLVs.js","sources":["../../../../../../../../dev/inspector-v2/src/components/tools/captureTools.tsx","../../../../../../../../dev/inspector-v2/src/services/panes/tools/captureService.tsx"],"sourcesContent":["import { ButtonLine } from \"shared-ui-components/fluent/hoc/buttonLine\";\r\nimport { useState, useRef, useCallback } from \"react\";\r\nimport type { FunctionComponent } from \"react\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { SyncedSliderPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/syncedSliderPropertyLine\";\r\nimport type { IScreenshotSize } from \"core/Misc/interfaces/screenshotSize\";\r\nimport { SwitchPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/switchPropertyLine\";\r\nimport { VideoRecorder } from \"core/Misc/videoRecorder\";\r\nimport { captureEquirectangularFromScene } from \"core/Misc/equirectangularCapture\";\r\nimport { Collapse } from \"shared-ui-components/fluent/primitives/collapse\";\r\nimport { CameraRegular, RecordRegular, RecordStopRegular } from \"@fluentui/react-icons\";\r\nimport { FrameGraphUtils } from \"core/FrameGraph/frameGraphUtils\";\r\n\r\nexport const CaptureRttTools: FunctionComponent<{ scene: Scene }> = ({ scene }) => {\r\n const [useWidthHeight, setUseWidthHeight] = useState(false);\r\n const [screenshotSize, setScreenshotSize] = useState<IScreenshotSize>({ precision: 1 });\r\n\r\n const captureRender = useCallback(async () => {\r\n const sizeToUse: IScreenshotSize = { ...screenshotSize };\r\n if (!useWidthHeight) {\r\n sizeToUse.width = undefined;\r\n sizeToUse.height = undefined;\r\n }\r\n\r\n if (scene.activeCamera) {\r\n Tools.CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, sizeToUse, undefined, undefined, 4);\r\n }\r\n }, [scene, screenshotSize, useWidthHeight]);\r\n\r\n return (\r\n <>\r\n <ButtonLine label=\"Capture\" icon={CameraRegular} onClick={captureRender} />\r\n <SyncedSliderPropertyLine\r\n label=\"Precision\"\r\n value={screenshotSize.precision ?? 1}\r\n onChange={(value) => setScreenshotSize({ ...screenshotSize, precision: value ?? 1 })}\r\n min={0.1}\r\n max={10}\r\n step={0.1}\r\n />\r\n <SwitchPropertyLine label=\"Use Custom Width/Height\" value={useWidthHeight} onChange={(value) => setUseWidthHeight(value)} />\r\n <Collapse visible={useWidthHeight}>\r\n <SyncedSliderPropertyLine\r\n label=\"Width\"\r\n value={screenshotSize.width ?? 512}\r\n onChange={(data) => setScreenshotSize({ ...screenshotSize, width: data ?? 512 })}\r\n min={1}\r\n step={1}\r\n />\r\n <SyncedSliderPropertyLine\r\n label=\"Height\"\r\n value={screenshotSize.height ?? 512}\r\n onChange={(data) => setScreenshotSize({ ...screenshotSize, height: data ?? 512 })}\r\n min={1}\r\n step={1}\r\n />\r\n </Collapse>\r\n </>\r\n );\r\n};\r\n\r\nexport const CaptureScreenshotTools: FunctionComponent<{ scene: Scene }> = ({ scene }) => {\r\n const [isRecording, setIsRecording] = useState(false);\r\n const videoRecorder = useRef<VideoRecorder>();\r\n\r\n const captureScreenshot = useCallback(() => {\r\n const camera = scene.frameGraph ? FrameGraphUtils.FindMainCamera(scene.frameGraph) : scene.activeCamera;\r\n if (camera) {\r\n Tools.CreateScreenshot(scene.getEngine(), camera, { precision: 1 });\r\n }\r\n }, [scene]);\r\n\r\n const captureEquirectangularAsync = useCallback(async () => {\r\n const currentActiveCamera = scene.activeCamera;\r\n if (!currentActiveCamera && scene.frameGraph) {\r\n scene.activeCamera = FrameGraphUtils.FindMainCamera(scene.frameGraph);\r\n }\r\n if (scene.activeCamera) {\r\n await captureEquirectangularFromScene(scene, { size: 1024, filename: \"equirectangular_capture.png\" });\r\n }\r\n // eslint-disable-next-line require-atomic-updates\r\n scene.activeCamera = currentActiveCamera;\r\n }, [scene]);\r\n\r\n const recordVideoAsync = useCallback(async () => {\r\n if (videoRecorder.current && videoRecorder.current.isRecording) {\r\n videoRecorder.current.stopRecording();\r\n setIsRecording(false);\r\n return;\r\n }\r\n\r\n if (!videoRecorder.current) {\r\n videoRecorder.current = new VideoRecorder(scene.getEngine());\r\n }\r\n\r\n void videoRecorder.current.startRecording();\r\n setIsRecording(true);\r\n }, [scene]);\r\n\r\n return (\r\n <>\r\n <ButtonLine label=\"Capture\" icon={CameraRegular} onClick={captureScreenshot} />\r\n <ButtonLine label=\"Capture Equirectangular\" icon={CameraRegular} onClick={captureEquirectangularAsync} />\r\n <ButtonLine label={isRecording ? \"Stop Recording\" : \"Record Video\"} icon={isRecording ? RecordStopRegular : RecordRegular} onClick={recordVideoAsync} />\r\n </>\r\n );\r\n};\r\n","import type { ServiceDefinition } from \"../../../modularity/serviceDefinition\";\r\nimport { ToolsServiceIdentity } from \"../toolsService\";\r\nimport type { IToolsService } from \"../toolsService\";\r\nimport type { IDisposable } from \"core/scene\";\r\nimport { CaptureRttTools, CaptureScreenshotTools } from \"../../../components/tools/captureTools\";\r\n\r\nexport const CaptureServiceDefinition: ServiceDefinition<[], [IToolsService]> = {\r\n friendlyName: \"Capture Tools\",\r\n consumes: [ToolsServiceIdentity],\r\n factory: (toolsService) => {\r\n const contentRegistrations: IDisposable[] = [];\r\n\r\n // Screenshot capture content\r\n contentRegistrations.push(\r\n toolsService.addSectionContent({\r\n key: \"Screenshot Capture\",\r\n section: \"Screenshot Capture\",\r\n component: ({ context }) => <CaptureScreenshotTools scene={context} />,\r\n })\r\n );\r\n\r\n // RTT capture content\r\n contentRegistrations.push(\r\n toolsService.addSectionContent({\r\n key: \"RTT Capture\",\r\n section: \"RTT Capture\",\r\n component: ({ context }) => <CaptureRttTools scene={context} />,\r\n })\r\n );\r\n\r\n return {\r\n dispose: () => {\r\n contentRegistrations.forEach((registration) => registration.dispose());\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n serviceDefinitions: [CaptureServiceDefinition],\r\n} as const;\r\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,eAAe,GAAwC,CAAC,EAAE,KAAK,EAAE,KAAI;IAC9E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC3D,IAAA,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAkB,EAAE,SAAS,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AAA,CACzJ;AAEX,CAAC;;ACrGY,MAAA,wBAAwB,GAA2C;AAC5E,IAAA,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,CAAC,oBAAoB,CAAC;AAChC,IAAA,OAAO,EAAE,CAAC,YAAY,KAAI;QACtB,MAAM,oBAAoB,GAAkB,EAAE;;AAG9C,QAAA,oBAAoB,CAAC,IAAI,CACrB,YAAY,CAAC,iBAAiB,CAAC;AAC3B,YAAA,GAAG,EAAE,oBAAoB;AACzB,YAAA,OAAO,EAAE,oBAAoB;AAC7B,YAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAKA,GAAA,CAAC,sBAAsB,EAAA,EAAC,KAAK,EAAE,OAAO,EAAI,CAAA;AACzE,SAAA,CAAC,CACL;;AAGD,QAAA,oBAAoB,CAAC,IAAI,CACrB,YAAY,CAAC,iBAAiB,CAAC;AAC3B,YAAA,GAAG,EAAE,aAAa;AAClB,YAAA,OAAO,EAAE,aAAa;AACtB,YAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAKA,GAAA,CAAC,eAAe,EAAA,EAAC,KAAK,EAAE,OAAO,EAAI,CAAA;AAClE,SAAA,CAAC,CACL;QAED,OAAO;YACH,OAAO,EAAE,MAAK;AACV,gBAAA,oBAAoB,CAAC,OAAO,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,OAAO,EAAE,CAAC;aACzE;SACJ;KACJ;;AAGL,qBAAe;IACX,kBAAkB,EAAE,CAAC,wBAAwB,CAAC;CACxC;;;;"}
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { M as MakeLazyComponent, B as ButtonLine, S as SwitchPropertyLine, N as NumberDropdownPropertyLine, C as Collapse, a as SyncedSliderPropertyLine, T as ToolsServiceIdentity } from './index-DUdNW7K3.js';
|
|
3
|
-
import { SceneSerializer } from '@babylonjs/core/Misc/sceneSerializer.js';
|
|
4
|
-
import { Tools } from '@babylonjs/core/Misc/tools.js';
|
|
5
|
-
import { EnvironmentTextureTools } from '@babylonjs/core/Misc/environmentTextureTools.js';
|
|
6
|
-
import { Logger } from '@babylonjs/core/Misc/logger.js';
|
|
7
|
-
import { useState, useCallback } from 'react';
|
|
8
|
-
import { Mesh } from '@babylonjs/core/Meshes/mesh.js';
|
|
9
|
-
import { Texture } from '@babylonjs/core/Materials/Textures/texture.js';
|
|
10
|
-
import { Camera } from '@babylonjs/core/Cameras/camera.js';
|
|
11
|
-
import { Light } from '@babylonjs/core/Lights/light.js';
|
|
12
|
-
import { ArrowDownloadRegular } from '@fluentui/react-icons';
|
|
13
|
-
import '@babylonjs/core/Maths/math.color.js';
|
|
14
|
-
import '@babylonjs/core/Maths/math.vector.js';
|
|
15
|
-
import '@babylonjs/core/Misc/observable.js';
|
|
16
|
-
import '@fluentui/react-components';
|
|
17
|
-
import '@fluentui/react-motion-components-preview';
|
|
18
|
-
import '@babylonjs/core/Misc/typeStore.js';
|
|
19
|
-
import 'usehooks-ts';
|
|
20
|
-
import '@babylonjs/core/Misc/asyncLock.js';
|
|
21
|
-
import '@babylonjs/core/Misc/deferred.js';
|
|
22
|
-
import '@babylonjs/core/Maths/math.scalar.functions.js';
|
|
23
|
-
import '@fluentui-contrib/react-virtualizer';
|
|
24
|
-
import '@babylonjs/addons/msdfText/fontAsset.js';
|
|
25
|
-
import '@babylonjs/addons/msdfText/textRenderer.js';
|
|
26
|
-
import '@babylonjs/core/Debug/physicsViewer.js';
|
|
27
|
-
import '@babylonjs/core/Materials/materialFlags.js';
|
|
28
|
-
import '@babylonjs/core/Materials/standardMaterial.js';
|
|
29
|
-
import '@babylonjs/core/Meshes/Builders/groundBuilder.js';
|
|
30
|
-
import '@babylonjs/core/Rendering/utilityLayerRenderer.js';
|
|
31
|
-
import '@babylonjs/materials/grid/gridMaterial.js';
|
|
32
|
-
import '@babylonjs/core/Misc/dataStorage.js';
|
|
33
|
-
import '@babylonjs/core/Instrumentation/engineInstrumentation.js';
|
|
34
|
-
import '@babylonjs/core/Instrumentation/sceneInstrumentation.js';
|
|
35
|
-
import '@babylonjs/core/Engines/AbstractEngine/abstractEngine.timeQuery.js';
|
|
36
|
-
import '@babylonjs/core/Engines/Extensions/engine.query.js';
|
|
37
|
-
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js';
|
|
38
|
-
import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js';
|
|
39
|
-
import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js';
|
|
40
|
-
import '@babylonjs/core/Misc/pressureObserverWrapper.js';
|
|
41
|
-
import '@babylonjs/core/Engines/abstractEngine.js';
|
|
42
|
-
import 'react-dom/client';
|
|
43
|
-
import '@babylonjs/core/FrameGraph/frameGraphUtils.js';
|
|
44
|
-
import '@babylonjs/core/Gizmos/cameraGizmo.js';
|
|
45
|
-
import '@babylonjs/core/Gizmos/lightGizmo.js';
|
|
46
|
-
import '@babylonjs/core/Bones/bone.js';
|
|
47
|
-
import '@babylonjs/core/Gizmos/gizmoManager.js';
|
|
48
|
-
import '@babylonjs/core/Meshes/abstractMesh.js';
|
|
49
|
-
import '@babylonjs/core/node.js';
|
|
50
|
-
import '@babylonjs/core/Animations/animationGroup.js';
|
|
51
|
-
import '@babylonjs/core/Animations/animationPropertiesOverride.js';
|
|
52
|
-
import '@babylonjs/addons/atmosphere/atmosphere.js';
|
|
53
|
-
import '@babylonjs/core/Cameras/arcRotateCamera.js';
|
|
54
|
-
import '@babylonjs/core/Cameras/followCamera.js';
|
|
55
|
-
import '@babylonjs/core/Cameras/freeCamera.js';
|
|
56
|
-
import '@babylonjs/core/Cameras/targetCamera.js';
|
|
57
|
-
import '@babylonjs/core/scene.js';
|
|
58
|
-
import '@babylonjs/core/FrameGraph/frameGraph.js';
|
|
59
|
-
import '@babylonjs/core/Lights/directionalLight.js';
|
|
60
|
-
import '@babylonjs/core/Lights/hemisphericLight.js';
|
|
61
|
-
import '@babylonjs/core/Lights/pointLight.js';
|
|
62
|
-
import '@babylonjs/core/Lights/rectAreaLight.js';
|
|
63
|
-
import '@babylonjs/core/Lights/shadowLight.js';
|
|
64
|
-
import '@babylonjs/core/Lights/spotLight.js';
|
|
65
|
-
import '@babylonjs/core/Lights/Shadows/cascadedShadowGenerator.js';
|
|
66
|
-
import '@babylonjs/core/Lights/Shadows/shadowGenerator.js';
|
|
67
|
-
import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js';
|
|
68
|
-
import '@babylonjs/core/Materials/material.js';
|
|
69
|
-
import '@babylonjs/core/Materials/multiMaterial.js';
|
|
70
|
-
import '@babylonjs/core/Materials/PBR/pbrBaseMaterial.js';
|
|
71
|
-
import '@babylonjs/core/Materials/PBR/pbrBaseSimpleMaterial.js';
|
|
72
|
-
import '@babylonjs/core/Materials/PBR/pbrMaterial.js';
|
|
73
|
-
import '@babylonjs/core/Materials/PBR/openpbrMaterial.js';
|
|
74
|
-
import '@babylonjs/materials/sky/skyMaterial.js';
|
|
75
|
-
import '@babylonjs/core/Engines/constants.js';
|
|
76
|
-
import '@babylonjs/core/Engines/engine.js';
|
|
77
|
-
import '@babylonjs/core/Particles/particleSystem.js';
|
|
78
|
-
import '@babylonjs/core/Misc/fileTools.js';
|
|
79
|
-
import '@babylonjs/core/Debug/skeletonViewer.js';
|
|
80
|
-
import '@babylonjs/core/Meshes/buffer.js';
|
|
81
|
-
import '@babylonjs/core/Meshes/Builders/linesBuilder.js';
|
|
82
|
-
import '@babylonjs/core/Meshes/instancedMesh.js';
|
|
83
|
-
import '@babylonjs/core/Rendering/renderingManager.js';
|
|
84
|
-
import '@babylonjs/core/Rendering/edgesRenderer.js';
|
|
85
|
-
import '@babylonjs/core/Rendering/outlineRenderer.js';
|
|
86
|
-
import '@babylonjs/core/Meshes/GaussianSplatting/gaussianSplattingMesh.js';
|
|
87
|
-
import '@babylonjs/core/Misc/gradients.js';
|
|
88
|
-
import '@babylonjs/core/Materials/Node/Blocks/gradientBlock.js';
|
|
89
|
-
import '@babylonjs/core/Particles/attractor.js';
|
|
90
|
-
import '@babylonjs/core/Meshes/Builders/sphereBuilder.js';
|
|
91
|
-
import '@babylonjs/core/Meshes/transformNode.js';
|
|
92
|
-
import '@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js';
|
|
93
|
-
import '@babylonjs/core/Physics/v2/physicsEngineComponent.js';
|
|
94
|
-
import '@babylonjs/core/PostProcesses/postProcess.js';
|
|
95
|
-
import '@babylonjs/core/Materials/Textures/cubeTexture.js';
|
|
96
|
-
import '@babylonjs/core/Materials/imageProcessingConfiguration.js';
|
|
97
|
-
import '@babylonjs/core/Bones/skeleton.js';
|
|
98
|
-
import '@babylonjs/core/Sprites/sprite.js';
|
|
99
|
-
import '@babylonjs/core/Sprites/spriteManager.js';
|
|
100
|
-
import '@babylonjs/core/Materials/Textures/baseTexture.js';
|
|
101
|
-
import '@babylonjs/core/Materials/Textures/multiRenderTarget.js';
|
|
102
|
-
import '@babylonjs/core/Materials/Textures/renderTargetTexture.js';
|
|
103
|
-
import '@babylonjs/core/Materials/Textures/thinTexture.js';
|
|
104
|
-
import '@babylonjs/core/Misc/textureTools.js';
|
|
105
|
-
import '@babylonjs/core/Rendering/boundingBoxRenderer.js';
|
|
106
|
-
import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js';
|
|
107
|
-
import '@babylonjs/core/Sprites/spriteSceneComponent.js';
|
|
108
|
-
import '@babylonjs/core/Materials/Textures/dynamicTexture.js';
|
|
109
|
-
import '@babylonjs/core/Events/pointerEvents.js';
|
|
110
|
-
import '@babylonjs/core/Engines/engineStore.js';
|
|
111
|
-
import '@babylonjs/core/Misc/uniqueIdGenerator.js';
|
|
112
|
-
|
|
113
|
-
const EnvExportImageTypes = [
|
|
114
|
-
{ label: "PNG", value: 0, imageType: "image/png" },
|
|
115
|
-
{ label: "WebP", value: 1, imageType: "image/webp" },
|
|
116
|
-
];
|
|
117
|
-
const ExportBabylonTools = ({ scene }) => {
|
|
118
|
-
const [babylonExportOptions, setBabylonExportOptions] = useState({
|
|
119
|
-
imageTypeIndex: 0,
|
|
120
|
-
imageQuality: 0.8,
|
|
121
|
-
iblDiffuse: false,
|
|
122
|
-
});
|
|
123
|
-
const exportBabylon = useCallback(async () => {
|
|
124
|
-
const strScene = JSON.stringify(SceneSerializer.Serialize(scene));
|
|
125
|
-
const blob = new Blob([strScene], { type: "octet/stream" });
|
|
126
|
-
Tools.Download(blob, "scene.babylon");
|
|
127
|
-
}, [scene]);
|
|
128
|
-
const createEnvTexture = useCallback(async () => {
|
|
129
|
-
if (!scene.environmentTexture) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
const buffer = await EnvironmentTextureTools.CreateEnvTextureAsync(scene.environmentTexture, {
|
|
134
|
-
imageType: EnvExportImageTypes[babylonExportOptions.imageTypeIndex].imageType,
|
|
135
|
-
imageQuality: babylonExportOptions.imageQuality,
|
|
136
|
-
disableIrradianceTexture: !babylonExportOptions.iblDiffuse,
|
|
137
|
-
});
|
|
138
|
-
const blob = new Blob([buffer], { type: "octet/stream" });
|
|
139
|
-
Tools.Download(blob, "environment.env");
|
|
140
|
-
}
|
|
141
|
-
catch (error) {
|
|
142
|
-
Logger.Error(error);
|
|
143
|
-
alert(error);
|
|
144
|
-
}
|
|
145
|
-
}, [scene, babylonExportOptions]);
|
|
146
|
-
return (jsxs(Fragment, { children: [jsx(ButtonLine, { label: "Export to Babylon", icon: ArrowDownloadRegular, onClick: exportBabylon }), !scene.getEngine().premultipliedAlpha && scene.environmentTexture && scene.environmentTexture._prefiltered && scene.activeCamera && (jsxs(Fragment, { children: [jsx(ButtonLine, { label: "Generate .env texture", icon: ArrowDownloadRegular, onClick: createEnvTexture }), scene.environmentTexture.irradianceTexture && (jsx(SwitchPropertyLine, { label: "Diffuse Texture", description: "Export diffuse texture for IBL", value: babylonExportOptions.iblDiffuse, onChange: (value) => {
|
|
147
|
-
setBabylonExportOptions((prev) => ({ ...prev, iblDiffuse: value }));
|
|
148
|
-
} }, "iblDiffuse")), jsx(NumberDropdownPropertyLine, { label: "Image type", options: EnvExportImageTypes, value: babylonExportOptions.imageTypeIndex, onChange: (val) => {
|
|
149
|
-
setBabylonExportOptions((prev) => ({ ...prev, imageTypeIndex: val }));
|
|
150
|
-
} }), jsx(Collapse, { visible: babylonExportOptions.imageTypeIndex > 0, children: jsx(SyncedSliderPropertyLine, { label: "Quality", value: babylonExportOptions.imageQuality, onChange: (value) => setBabylonExportOptions((prev) => ({ ...prev, imageQuality: value })), min: 0, max: 1 }) })] }))] }));
|
|
151
|
-
};
|
|
152
|
-
const ExportGltfTools = MakeLazyComponent(async () => {
|
|
153
|
-
// Defer importing anything from the serializers package until this component is actually mounted.
|
|
154
|
-
const { GLTF2Export } = await import('@babylonjs/serializers/glTF/2.0/glTFSerializer.js');
|
|
155
|
-
return (props) => {
|
|
156
|
-
const [isExportingGltf, setIsExportingGltf] = useState(false);
|
|
157
|
-
const [gltfExportOptions, setGltfExportOptions] = useState({
|
|
158
|
-
exportDisabledNodes: false,
|
|
159
|
-
exportSkyboxes: false,
|
|
160
|
-
exportCameras: false,
|
|
161
|
-
exportLights: false,
|
|
162
|
-
dracoCompression: false,
|
|
163
|
-
});
|
|
164
|
-
const exportGLTF = useCallback(async () => {
|
|
165
|
-
setIsExportingGltf(true);
|
|
166
|
-
const shouldExport = (node) => {
|
|
167
|
-
if (!gltfExportOptions.exportDisabledNodes) {
|
|
168
|
-
if (!node.isEnabled()) {
|
|
169
|
-
return false;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (!gltfExportOptions.exportSkyboxes) {
|
|
173
|
-
if (node instanceof Mesh) {
|
|
174
|
-
if (node.material) {
|
|
175
|
-
const material = node.material;
|
|
176
|
-
const reflectionTexture = material.reflectionTexture;
|
|
177
|
-
if (reflectionTexture && reflectionTexture.coordinatesMode === Texture.SKYBOX_MODE) {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (!gltfExportOptions.exportCameras) {
|
|
184
|
-
if (node instanceof Camera) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (!gltfExportOptions.exportLights) {
|
|
189
|
-
if (node instanceof Light) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return true;
|
|
194
|
-
};
|
|
195
|
-
try {
|
|
196
|
-
const glb = await GLTF2Export.GLBAsync(props.scene, "scene", {
|
|
197
|
-
meshCompressionMethod: gltfExportOptions.dracoCompression ? "Draco" : undefined,
|
|
198
|
-
shouldExportNode: (node) => shouldExport(node),
|
|
199
|
-
});
|
|
200
|
-
glb.downloadFiles();
|
|
201
|
-
}
|
|
202
|
-
catch (reason) {
|
|
203
|
-
Logger.Error(`Failed to export GLB: ${reason}`);
|
|
204
|
-
}
|
|
205
|
-
finally {
|
|
206
|
-
setIsExportingGltf(false);
|
|
207
|
-
}
|
|
208
|
-
}, [gltfExportOptions, props.scene]);
|
|
209
|
-
return (jsxs(Fragment, { children: [jsx(SwitchPropertyLine, { label: "Export Disabled Nodes", description: "Whether to export nodes that are disabled in the scene.", value: gltfExportOptions.exportDisabledNodes, onChange: (checked) => setGltfExportOptions({ ...gltfExportOptions, exportDisabledNodes: checked }) }, "GLTFExportDisabledNodes"), jsx(SwitchPropertyLine, { label: "Export Skyboxes", description: "Whether to export skybox nodes in the scene.", value: gltfExportOptions.exportSkyboxes, onChange: (checked) => setGltfExportOptions({ ...gltfExportOptions, exportSkyboxes: checked }) }, "GLTFExportSkyboxes"), jsx(SwitchPropertyLine, { label: "Export Cameras", description: "Whether to export cameras in the scene.", value: gltfExportOptions.exportCameras, onChange: (checked) => setGltfExportOptions({ ...gltfExportOptions, exportCameras: checked }) }, "GLTFExportCameras"), jsx(SwitchPropertyLine, { label: "Export Lights", description: "Whether to export lights in the scene.", value: gltfExportOptions.exportLights, onChange: (checked) => setGltfExportOptions({ ...gltfExportOptions, exportLights: checked }) }, "GLTFExportLights"), jsx(SwitchPropertyLine, { label: "Draco Compression", description: "Whether to apply Draco compression to geometry.", value: gltfExportOptions.dracoCompression, onChange: (checked) => setGltfExportOptions({ ...gltfExportOptions, dracoCompression: checked }) }, "GLTFDracoCompression"), jsx(ButtonLine, { label: "Export to GLB", icon: ArrowDownloadRegular, onClick: exportGLTF, disabled: isExportingGltf })] }));
|
|
210
|
-
};
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
const ExportServiceDefinition = {
|
|
214
|
-
friendlyName: "Export Tools",
|
|
215
|
-
consumes: [ToolsServiceIdentity],
|
|
216
|
-
factory: (toolsService) => {
|
|
217
|
-
const contentRegistrations = [];
|
|
218
|
-
// glTF export content
|
|
219
|
-
contentRegistrations.push(toolsService.addSectionContent({
|
|
220
|
-
key: "glTF Export",
|
|
221
|
-
section: "glTF Export",
|
|
222
|
-
component: ({ context }) => jsx(ExportGltfTools, { scene: context }),
|
|
223
|
-
}));
|
|
224
|
-
// Babylon export content
|
|
225
|
-
contentRegistrations.push(toolsService.addSectionContent({
|
|
226
|
-
key: "Babylon Export",
|
|
227
|
-
section: "Babylon Export",
|
|
228
|
-
component: ({ context }) => jsx(ExportBabylonTools, { scene: context }),
|
|
229
|
-
}));
|
|
230
|
-
return {
|
|
231
|
-
dispose: () => {
|
|
232
|
-
contentRegistrations.forEach((registration) => registration.dispose());
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
var exportService = {
|
|
238
|
-
serviceDefinitions: [ExportServiceDefinition],
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export { ExportServiceDefinition, exportService as default };
|
|
242
|
-
//# sourceMappingURL=exportService-BqnzQ5KY.js.map
|