@babylonjs/inspector 8.46.2-preview → 8.47.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/package.json CHANGED
@@ -1,18 +1,27 @@
1
1
  {
2
2
  "name": "@babylonjs/inspector",
3
- "version": "8.46.2-preview",
4
- "type": "module",
5
- "main": "lib/index.js",
6
- "module": "lib/index.js",
7
- "esnext": "lib/index.js",
8
- "types": "lib/index.d.ts",
3
+ "version": "8.47.0",
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
- "lib/**/*.js",
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",
@@ -21,24 +30,31 @@
21
30
  "@babylonjs/loaders": "^8.0.0",
22
31
  "@babylonjs/materials": "^8.0.0",
23
32
  "@babylonjs/serializers": "^8.0.0",
24
- "@fluentui-contrib/react-virtualizer": "^0.5.3",
25
- "@fluentui/react-components": "^9.70.0",
26
- "@fluentui/react-icons": "^2.0.310",
27
- "react": ">=16.14.0 <20.0.0",
28
- "react-dom": ">=16.14.0 <20.0.0",
29
- "usehooks-ts": "^3.1.1"
33
+ "@types/react": ">=16.7.3",
34
+ "@types/react-dom": ">=16.0.9"
35
+ },
36
+ "devDependencies": {
37
+ "@babylonjs/addons": "^8.47.0",
38
+ "@babylonjs/core": "^8.47.0",
39
+ "@babylonjs/gui": "^8.47.0",
40
+ "@babylonjs/gui-editor": "^8.47.0",
41
+ "@babylonjs/loaders": "^8.47.0",
42
+ "@babylonjs/materials": "^8.47.0",
43
+ "@babylonjs/serializers": "^8.47.0",
44
+ "@dev/inspector": "1.0.0",
45
+ "@lts/gui": "1.0.0",
46
+ "react": "^18.2.0",
47
+ "react-dom": "^18.2.0"
30
48
  },
31
49
  "keywords": [
32
50
  "3D",
33
51
  "javascript",
34
52
  "html5",
35
53
  "webgl",
36
- "babylon.js",
37
- "inspector",
38
- "diagnostic",
39
- "debug"
54
+ "babylon.js"
40
55
  ],
41
56
  "license": "Apache-2.0",
57
+ "sideEffects": true,
42
58
  "homepage": "https://www.babylonjs.com",
43
59
  "repository": {
44
60
  "type": "git",
@@ -47,4 +63,4 @@
47
63
  "bugs": {
48
64
  "url": "https://github.com/BabylonJS/Babylon.js/issues"
49
65
  }
50
- }
66
+ }
package/readme.md CHANGED
@@ -1,23 +1,26 @@
1
- # BabylonJS Inspector
1
+ # Babylon.js inspector module
2
2
 
3
- The Babylon Inspector is a diagnostic tool that makes it possible to view and edit the scene graph, properties of entities within the scene, and more.
3
+ For usage documentation please visit https://doc.babylonjs.com/how_to/debug_layer.
4
4
 
5
- You can learn more in the Inspector [documentation](https://doc.babylonjs.com/toolsAndResources/inspectorv2/).
5
+ # Installation instructions
6
6
 
7
- ## Installation
7
+ To install using npm :
8
8
 
9
- Install the package using npm:
10
-
11
- ```bash
12
- npm install @babylonjs/inspector@preview
9
+ ```shell
10
+ npm install @babylonjs/core @babylonjs/inspector
13
11
  ```
14
12
 
15
- The simplest way to use `Inspector` is to call the `ShowInspector` function, passing in your scene:
16
-
17
- ```ts
18
- import { ShowInspector } from "@babylonjs/inspector";
13
+ # How to use
19
14
 
20
- // Your code that sets up a Babylon.js scene...
15
+ Afterwards it can be imported to your project using:
21
16
 
22
- ShowInspector(scene);
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,218 +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-CxcZXjGK.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 '@babylonjs/core/Misc/typeStore.js';
13
- import '@fluentui/react-components';
14
- import '@fluentui/react-motion-components-preview';
15
- import 'usehooks-ts';
16
- import '@babylonjs/core/Misc/asyncLock.js';
17
- import '@babylonjs/core/Misc/deferred.js';
18
- import '@babylonjs/core/Misc/logger.js';
19
- import '@babylonjs/core/Maths/math.scalar.functions.js';
20
- import '@fluentui-contrib/react-virtualizer';
21
- import '@babylonjs/addons/msdfText/fontAsset.js';
22
- import '@babylonjs/addons/msdfText/textRenderer.js';
23
- import '@babylonjs/core/Debug/physicsViewer.js';
24
- import '@babylonjs/core/Materials/Textures/texture.js';
25
- import '@babylonjs/core/Materials/materialFlags.js';
26
- import '@babylonjs/core/Materials/standardMaterial.js';
27
- import '@babylonjs/core/Meshes/Builders/groundBuilder.js';
28
- import '@babylonjs/core/Rendering/utilityLayerRenderer.js';
29
- import '@babylonjs/materials/grid/gridMaterial.js';
30
- import '@babylonjs/core/Misc/dataStorage.js';
31
- import '@babylonjs/core/Instrumentation/engineInstrumentation.js';
32
- import '@babylonjs/core/Instrumentation/sceneInstrumentation.js';
33
- import '@babylonjs/core/Engines/AbstractEngine/abstractEngine.timeQuery.js';
34
- import '@babylonjs/core/Engines/Extensions/engine.query.js';
35
- import '@babylonjs/core/Engines/WebGPU/Extensions/engine.query.js';
36
- import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js';
37
- import '@babylonjs/core/Misc/PerformanceViewer/performanceViewerSceneExtension.js';
38
- import '@babylonjs/core/Misc/pressureObserverWrapper.js';
39
- import '@babylonjs/core/Engines/abstractEngine.js';
40
- import 'react-dom/client';
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/geospatialCamera.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/Debug/directionalLightFrustumViewer.js';
67
- import '@babylonjs/core/Lights/Shadows/shadowGenerator.js';
68
- import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js';
69
- import '@babylonjs/core/Materials/material.js';
70
- import '@babylonjs/core/Materials/multiMaterial.js';
71
- import '@babylonjs/core/Materials/Node/nodeMaterial.js';
72
- import '@babylonjs/core/Materials/PBR/openpbrMaterial.js';
73
- import '@babylonjs/core/Materials/PBR/pbrBaseMaterial.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/Materials/Node/Blocks/gradientBlock.js';
79
- import '@babylonjs/core/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes.js';
80
- import '@babylonjs/core/Misc/gradients.js';
81
- import '@babylonjs/core/Misc/fileTools.js';
82
- import '@babylonjs/core/Materials/Textures/cubeTexture.js';
83
- import '@babylonjs/core/Meshes/GaussianSplatting/gaussianSplattingMesh.js';
84
- import '@babylonjs/core/Meshes/mesh.js';
85
- import '@babylonjs/core/Debug/skeletonViewer.js';
86
- import '@babylonjs/core/Meshes/buffer.js';
87
- import '@babylonjs/core/Meshes/Builders/linesBuilder.js';
88
- import '@babylonjs/core/Meshes/instancedMesh.js';
89
- import '@babylonjs/core/Rendering/renderingManager.js';
90
- import '@babylonjs/core/Rendering/edgesRenderer.js';
91
- import '@babylonjs/core/Rendering/outlineRenderer.js';
92
- import '@babylonjs/core/Particles/EmitterTypes/boxParticleEmitter.js';
93
- import '@babylonjs/core/Particles/EmitterTypes/coneParticleEmitter.js';
94
- import '@babylonjs/core/Particles/EmitterTypes/cylinderParticleEmitter.js';
95
- import '@babylonjs/core/Particles/EmitterTypes/hemisphericParticleEmitter.js';
96
- import '@babylonjs/core/Particles/EmitterTypes/meshParticleEmitter.js';
97
- import '@babylonjs/core/Particles/EmitterTypes/pointParticleEmitter.js';
98
- import '@babylonjs/core/Particles/EmitterTypes/sphereParticleEmitter.js';
99
- import '@babylonjs/core/Particles/Node/nodeParticleSystemSet.helper.js';
100
- import '@babylonjs/core/Particles/gpuParticleSystem.js';
101
- import '@babylonjs/core/Particles/particleHelper.js';
102
- import '@babylonjs/core/Particles/attractor.js';
103
- import '@babylonjs/core/Meshes/Builders/sphereBuilder.js';
104
- import '@babylonjs/core/Meshes/transformNode.js';
105
- import '@babylonjs/core/Physics/v2/IPhysicsEnginePlugin.js';
106
- import '@babylonjs/core/Physics/v2/physicsEngineComponent.js';
107
- import '@babylonjs/core/PostProcesses/postProcess.js';
108
- import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipeline.js';
109
- import '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js';
110
- import '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js';
111
- import '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js';
112
- import '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js';
113
- import '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js';
114
- import '@babylonjs/core/Rendering/IBLShadows/iblShadowsRenderPipeline.js';
115
- import '@babylonjs/core/Materials/imageProcessingConfiguration.js';
116
- import '@babylonjs/core/Bones/skeleton.js';
117
- import '@babylonjs/core/Sprites/sprite.js';
118
- import '@babylonjs/core/Sprites/spriteManager.js';
119
- import '@babylonjs/core/Misc/textureTools.js';
120
- import '@babylonjs/core/Materials/Textures/baseTexture.js';
121
- import '@babylonjs/core/Materials/Textures/multiRenderTarget.js';
122
- import '@babylonjs/core/Materials/Textures/renderTargetTexture.js';
123
- import '@babylonjs/core/Materials/Textures/thinTexture.js';
124
- import '@babylonjs/core/Events/keyboardEvents.js';
125
- import '@babylonjs/core/Events/pointerEvents.js';
126
- import '@babylonjs/core/Materials/Textures/htmlElementTexture.js';
127
- import '@babylonjs/core/Materials/shaderMaterial.js';
128
- import '@babylonjs/core/Meshes/Builders/planeBuilder.js';
129
- import '@babylonjs/core/Lights/Clustered/clusteredLightContainer.js';
130
- import '@babylonjs/core/Rendering/boundingBoxRenderer.js';
131
- import '@babylonjs/core/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js';
132
- import '@babylonjs/core/Sprites/spriteSceneComponent.js';
133
- import '@babylonjs/core/Materials/Textures/dynamicTexture.js';
134
- import '@babylonjs/core/Engines/engineStore.js';
135
- import '@babylonjs/core/Misc/uniqueIdGenerator.js';
136
- import '@babylonjs/core/Debug/debugLayer.js';
137
- import '@babylonjs/core/Misc/lazy.js';
138
-
139
- const CaptureRttTools = ({ scene }) => {
140
- const [useWidthHeight, setUseWidthHeight] = useState(false);
141
- const [screenshotSize, setScreenshotSize] = useState({ precision: 1 });
142
- const captureRender = useCallback(async () => {
143
- const sizeToUse = { ...screenshotSize };
144
- if (!useWidthHeight) {
145
- sizeToUse.width = undefined;
146
- sizeToUse.height = undefined;
147
- }
148
- if (scene.activeCamera) {
149
- Tools.CreateScreenshotUsingRenderTarget(scene.getEngine(), scene.activeCamera, sizeToUse, undefined, undefined, 4);
150
- }
151
- }, [scene, screenshotSize, useWidthHeight]);
152
- 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 })] })] }));
153
- };
154
- const CaptureScreenshotTools = ({ scene }) => {
155
- const [isRecording, setIsRecording] = useState(false);
156
- const videoRecorder = useRef();
157
- const captureScreenshot = useCallback(() => {
158
- const camera = scene.frameGraph ? FrameGraphUtils.FindMainCamera(scene.frameGraph) : scene.activeCamera;
159
- if (camera) {
160
- Tools.CreateScreenshot(scene.getEngine(), camera, { precision: 1 });
161
- }
162
- }, [scene]);
163
- const captureEquirectangularAsync = useCallback(async () => {
164
- const currentActiveCamera = scene.activeCamera;
165
- if (!currentActiveCamera && scene.frameGraph) {
166
- scene.activeCamera = FrameGraphUtils.FindMainCamera(scene.frameGraph);
167
- }
168
- if (scene.activeCamera) {
169
- await captureEquirectangularFromScene(scene, { size: 1024, filename: "equirectangular_capture.png" });
170
- }
171
- // eslint-disable-next-line require-atomic-updates
172
- scene.activeCamera = currentActiveCamera;
173
- }, [scene]);
174
- const recordVideoAsync = useCallback(async () => {
175
- if (videoRecorder.current && videoRecorder.current.isRecording) {
176
- videoRecorder.current.stopRecording();
177
- setIsRecording(false);
178
- return;
179
- }
180
- if (!videoRecorder.current) {
181
- videoRecorder.current = new VideoRecorder(scene.getEngine());
182
- }
183
- void videoRecorder.current.startRecording();
184
- setIsRecording(true);
185
- }, [scene]);
186
- 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 })] }));
187
- };
188
-
189
- const CaptureServiceDefinition = {
190
- friendlyName: "Capture Tools",
191
- consumes: [ToolsServiceIdentity],
192
- factory: (toolsService) => {
193
- const contentRegistrations = [];
194
- // Screenshot capture content
195
- contentRegistrations.push(toolsService.addSectionContent({
196
- key: "Screenshot Capture",
197
- section: "Screenshot Capture",
198
- component: ({ context }) => jsx(CaptureScreenshotTools, { scene: context }),
199
- }));
200
- // RTT capture content
201
- contentRegistrations.push(toolsService.addSectionContent({
202
- key: "RTT Capture",
203
- section: "RTT Capture",
204
- component: ({ context }) => jsx(CaptureRttTools, { scene: context }),
205
- }));
206
- return {
207
- dispose: () => {
208
- contentRegistrations.forEach((registration) => registration.dispose());
209
- },
210
- };
211
- },
212
- };
213
- var captureService = {
214
- serviceDefinitions: [CaptureServiceDefinition],
215
- };
216
-
217
- export { CaptureServiceDefinition, captureService as default };
218
- //# sourceMappingURL=captureService-CW8jU858.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"captureService-CW8jU858.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,EAAE,CAAC,EAAE,CAAC;AAEvF,IAAA,MAAM,aAAa,GAAG,WAAW,CAAC,YAAW;AACzC,QAAA,MAAM,SAAS,GAAoB,EAAE,GAAG,cAAc,EAAE;QACxD,IAAI,CAAC,cAAc,EAAE;AACjB,YAAA,SAAS,CAAC,KAAK,GAAG,SAAS;AAC3B,YAAA,SAAS,CAAC,MAAM,GAAG,SAAS;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