@babylonjs/inspector 9.30.0 → 9.31.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/bin/inspector-bridge.mjs +4730 -4446
- package/bin/inspector-cli.mjs +4765 -3866
- package/lib/components/curveEditor/animatableAnimations.d.ts +27 -0
- package/lib/components/properties/nodes/gaussianSplattingProperties.d.ts +13 -2
- package/lib/{extensionsListService-DfE1ZOnF.js → extensionsListService-O8zrOnmL.js} +5 -2
- package/lib/{extensionsListService-DfE1ZOnF.js.map → extensionsListService-O8zrOnmL.js.map} +1 -1
- package/lib/gif-ut7hgn9U.js +45 -0
- package/lib/gif-ut7hgn9U.js.map +1 -0
- package/lib/{index-CZ1-Y-Rv.js → index-DbbhJJ1G.js} +321 -85
- package/lib/index-DbbhJJ1G.js.map +1 -0
- package/lib/index.js +4 -1
- package/lib/index.js.map +1 -1
- package/lib/lite/animationProperties-BKVw6_ls.js +95 -0
- package/lib/lite/animationProperties-BKVw6_ls.js.map +1 -0
- package/lib/lite/animationUtils.d.ts +47 -0
- package/lib/lite/components/properties/animationProperties.d.ts +48 -0
- package/lib/lite/directTextureBinding-C5MB2OV2.js +99 -0
- package/lib/lite/directTextureBinding-C5MB2OV2.js.map +1 -0
- package/lib/lite/dynamicMaterialField-L_nQAxAA.js +107 -0
- package/lib/lite/dynamicMaterialField-L_nQAxAA.js.map +1 -0
- package/lib/lite/engineExplorerService.d.ts +3 -1
- package/lib/lite/{extensionsListService-D1JivcAu.js → extensionsListService-Bl1rTNl1.js} +2 -2
- package/lib/lite/{extensionsListService-D1JivcAu.js.map → extensionsListService-Bl1rTNl1.js.map} +1 -1
- package/lib/lite/{index-D8vFySa7.js → index-Cy8gzpYG.js} +1453 -394
- package/lib/lite/index-Cy8gzpYG.js.map +1 -0
- package/lib/lite/index.js +1 -1
- package/lib/lite/nodeMaterialProperties-ELFMlzS1.js +182 -0
- package/lib/lite/nodeMaterialProperties-ELFMlzS1.js.map +1 -0
- package/lib/lite/pbrMaterialProperties-jfJddBxY.js +614 -0
- package/lib/lite/pbrMaterialProperties-jfJddBxY.js.map +1 -0
- package/lib/lite/services/panes/properties/animationPropertiesService.d.ts +5 -0
- package/lib/lite/services/panes/properties/materialPropertiesService.d.ts +3 -1
- package/lib/lite/services/panes/properties/materials/directTextureBinding.d.ts +29 -0
- package/lib/lite/services/panes/properties/materials/dynamicMaterialField.d.ts +35 -0
- package/lib/lite/services/panes/properties/materials/materialAdapterTypes.d.ts +11 -0
- package/lib/lite/services/panes/properties/materials/materialReachability.d.ts +9 -0
- package/lib/lite/services/panes/properties/materials/nodeMaterialProperties.d.ts +8 -0
- package/lib/lite/services/panes/properties/materials/pbrMaterialProperties.d.ts +8 -0
- package/lib/lite/services/panes/properties/materials/shaderMaterialProperties.d.ts +8 -0
- package/lib/lite/services/panes/properties/materials/standardMaterialProperties.d.ts +8 -0
- package/lib/lite/services/panes/properties/materials/useDirectMaterialOperations.d.ts +31 -0
- package/lib/lite/services/panes/properties/textureMetadataProperties.d.ts +14 -0
- package/lib/lite/services/panes/properties/texturePropertiesService.d.ts +3 -1
- package/lib/lite/services/panes/properties/useLatestAsyncOperation.d.ts +24 -0
- package/lib/lite/services/panes/scene/animationGroupExplorerService.d.ts +7 -0
- package/lib/lite/services/panes/scene/materialExplorerService.d.ts +2 -1
- package/lib/lite/services/panes/scene/materialTopologyBindings.d.ts +13 -0
- package/lib/lite/services/panes/scene/sceneResourceIndexService.d.ts +36 -0
- package/lib/lite/services/panes/scene/sceneResources.d.ts +55 -11
- package/lib/lite/services/panes/scene/textureExplorerService.d.ts +2 -1
- package/lib/lite/services/pickingService.d.ts +10 -0
- package/lib/lite/shaderMaterialProperties-CTH_KfBK.js +229 -0
- package/lib/lite/shaderMaterialProperties-CTH_KfBK.js.map +1 -0
- package/lib/lite/standardMaterialProperties-BbYdFX86.js +287 -0
- package/lib/lite/standardMaterialProperties-BbYdFX86.js.map +1 -0
- package/lib/lite/textureMetadataProperties-BdNmp0Pk.js +221 -0
- package/lib/lite/textureMetadataProperties-BdNmp0Pk.js.map +1 -0
- package/lib/lite/useDirectMaterialOperations-D6V7OtC1.js +83 -0
- package/lib/lite/useDirectMaterialOperations-D6V7OtC1.js.map +1 -0
- package/lib/lite/useLatestAsyncOperation-k59AgA3B.js +78 -0
- package/lib/lite/useLatestAsyncOperation-k59AgA3B.js.map +1 -0
- package/lib/{quickCreateToolsService-owfaw163.js → quickCreateToolsService-Cs46Amv7.js} +5 -2
- package/lib/{quickCreateToolsService-owfaw163.js.map → quickCreateToolsService-Cs46Amv7.js.map} +1 -1
- package/lib/{reflectorService-oIAxxpQt.js → reflectorService-C43FgOiC.js} +5 -2
- package/lib/{reflectorService-oIAxxpQt.js.map → reflectorService-C43FgOiC.js.map} +1 -1
- package/lib/services/panes/properties/gaussianSplattingDebugController.d.ts +46 -0
- package/package.json +8 -8
- package/lib/gif-5DieAkSF.js +0 -38
- package/lib/gif-5DieAkSF.js.map +0 -1
- package/lib/index-CZ1-Y-Rv.js.map +0 -1
- package/lib/lite/index-D8vFySa7.js.map +0 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { getStandardEmissiveTexture, getStandardBumpTexture, getStandardSpecularTexture, getStandardAmbientTexture, getStandardLightmapTexture, getStandardOpacityTexture, getStandardReflectionTexture, getStandardReflectionCubeTexture, enableStandardUvOffset, setStandardReflectionCubeTexture, setStandardReflectionTexture, setStandardOpacityTexture, setStandardLightmapTexture, setStandardAmbientTexture, setStandardSpecularTexture, setStandardBumpTexture, setStandardEmissiveTexture, enableMaterialStencil } from '@babylonjs/lite';
|
|
3
|
+
import { Body1 } from '@fluentui/react-components';
|
|
4
|
+
import { T as TextPropertyLine, D as DerivedProperty, k as TextInputPropertyLine, f as SwitchPropertyLine, N as NumberInputPropertyLine, l as Color3PropertyLine, m as NumberDropdownPropertyLine, V as Vector2PropertyLine, C as ComputedProperty, n as StringDropdownPropertyLine } from './index-Cy8gzpYG.js';
|
|
5
|
+
import { D as DirectTextureBinding } from './directTextureBinding-C5MB2OV2.js';
|
|
6
|
+
import { u as useDirectMaterialOperations } from './useDirectMaterialOperations-D6V7OtC1.js';
|
|
7
|
+
import '@babylonjs/core/Misc/observable.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import '@fluentui/react-icons';
|
|
10
|
+
import '@babylonjs/core/Misc/dataStorage.js';
|
|
11
|
+
import '@babylonjs/core/Misc/asyncLock.js';
|
|
12
|
+
import '@babylonjs/core/Misc/deferred.js';
|
|
13
|
+
import '@fluentui-contrib/react-resize-handle';
|
|
14
|
+
import '@fluentui/react-motion-components-preview';
|
|
15
|
+
import '@babylonjs/core/Misc/logger.js';
|
|
16
|
+
import 'react-dom/client';
|
|
17
|
+
import '@fluentui-contrib/react-virtualizer';
|
|
18
|
+
import '@babylonjs/core/Misc/uniqueIdGenerator.js';
|
|
19
|
+
import '@babylonjs/core/Maths/math.color.js';
|
|
20
|
+
import '@babylonjs/core/Maths/math.vector.js';
|
|
21
|
+
import './useLatestAsyncOperation-k59AgA3B.js';
|
|
22
|
+
|
|
23
|
+
const UvOptions = [
|
|
24
|
+
{ value: 0, label: "UV1" },
|
|
25
|
+
{ value: 1, label: "UV2" },
|
|
26
|
+
];
|
|
27
|
+
const ReflectionOptions = [
|
|
28
|
+
{ value: 1, label: "Spherical" },
|
|
29
|
+
{ value: 2, label: "Planar" },
|
|
30
|
+
];
|
|
31
|
+
const StencilCompareOptions = [
|
|
32
|
+
{ value: "never", label: "Never" },
|
|
33
|
+
{ value: "less", label: "Less" },
|
|
34
|
+
{ value: "equal", label: "Equal" },
|
|
35
|
+
{ value: "less-equal", label: "Less or Equal" },
|
|
36
|
+
{ value: "greater", label: "Greater" },
|
|
37
|
+
{ value: "not-equal", label: "Not Equal" },
|
|
38
|
+
{ value: "greater-equal", label: "Greater or Equal" },
|
|
39
|
+
{ value: "always", label: "Always" },
|
|
40
|
+
];
|
|
41
|
+
const StencilOperationOptions = [
|
|
42
|
+
{ value: "keep", label: "Keep" },
|
|
43
|
+
{ value: "zero", label: "Zero" },
|
|
44
|
+
{ value: "replace", label: "Replace" },
|
|
45
|
+
{ value: "invert", label: "Invert" },
|
|
46
|
+
{ value: "increment-clamp", label: "Increment Clamp" },
|
|
47
|
+
{ value: "decrement-clamp", label: "Decrement Clamp" },
|
|
48
|
+
{ value: "increment-wrap", label: "Increment Wrap" },
|
|
49
|
+
{ value: "decrement-wrap", label: "Decrement Wrap" },
|
|
50
|
+
];
|
|
51
|
+
const StandardTextureSlots = [
|
|
52
|
+
{ id: "standard.diffuse", label: "Diffuse Texture", kind: "2d", get: (material) => material.diffuseTexture },
|
|
53
|
+
{ id: "standard.emissive", label: "Emissive Texture", kind: "2d", get: getStandardEmissiveTexture, sampleCategory: "float-or-depth" },
|
|
54
|
+
{ id: "standard.bump", label: "Bump Texture", kind: "2d", get: getStandardBumpTexture },
|
|
55
|
+
{ id: "standard.specular", label: "Specular Texture", kind: "2d", get: getStandardSpecularTexture },
|
|
56
|
+
{ id: "standard.ambient", label: "Ambient Texture", kind: "2d", get: getStandardAmbientTexture },
|
|
57
|
+
{ id: "standard.lightmap", label: "Lightmap Texture", kind: "2d", get: getStandardLightmapTexture },
|
|
58
|
+
{ id: "standard.opacity", label: "Opacity Texture", kind: "2d", get: getStandardOpacityTexture },
|
|
59
|
+
{ id: "standard.reflection2d", label: "Reflection Texture", kind: "2d", get: getStandardReflectionTexture },
|
|
60
|
+
{ id: "standard.reflectionCube", label: "Reflection Cube Texture", kind: "cube", get: getStandardReflectionCubeTexture },
|
|
61
|
+
];
|
|
62
|
+
function SetStandardTexture(material, id, texture) {
|
|
63
|
+
if (id === "standard.reflectionCube") {
|
|
64
|
+
setStandardReflectionCubeTexture(material, texture);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const value = texture;
|
|
68
|
+
switch (id) {
|
|
69
|
+
case "standard.diffuse":
|
|
70
|
+
material.diffuseTexture = value;
|
|
71
|
+
return;
|
|
72
|
+
case "standard.emissive":
|
|
73
|
+
setStandardEmissiveTexture(material, value);
|
|
74
|
+
return;
|
|
75
|
+
case "standard.bump":
|
|
76
|
+
setStandardBumpTexture(material, value);
|
|
77
|
+
return;
|
|
78
|
+
case "standard.specular":
|
|
79
|
+
setStandardSpecularTexture(material, value);
|
|
80
|
+
return;
|
|
81
|
+
case "standard.ambient":
|
|
82
|
+
setStandardAmbientTexture(material, value);
|
|
83
|
+
return;
|
|
84
|
+
case "standard.lightmap":
|
|
85
|
+
setStandardLightmapTexture(material, value);
|
|
86
|
+
return;
|
|
87
|
+
case "standard.opacity":
|
|
88
|
+
setStandardOpacityTexture(material, value);
|
|
89
|
+
return;
|
|
90
|
+
case "standard.reflection2d":
|
|
91
|
+
setStandardReflectionTexture(material, value);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const FieldStatus = (props) => {
|
|
96
|
+
const { label, state, children } = props;
|
|
97
|
+
return (jsxs("div", { "aria-busy": state?.pending ?? false, children: [children, state?.pending ? jsx(Body1, { role: "status", children: `Applying ${label}…` }) : undefined, state?.error ? jsx(Body1, { role: "alert", children: state.error }) : undefined] }));
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Lazily loaded Standard material section properties.
|
|
101
|
+
* @param props The selected material section and instance services.
|
|
102
|
+
* @returns Standard material property content.
|
|
103
|
+
*/
|
|
104
|
+
const StandardMaterialAdapter = (props) => {
|
|
105
|
+
const { material, section, resourceIndexService, selectionService } = props;
|
|
106
|
+
const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);
|
|
107
|
+
const standard = material;
|
|
108
|
+
if (!record) {
|
|
109
|
+
return jsx(TextPropertyLine, { label: "Error", value: "This material is no longer available in an inspected scene." });
|
|
110
|
+
}
|
|
111
|
+
if (section === "textures") {
|
|
112
|
+
return (jsx(Fragment, { children: StandardTextureSlots.map((slot) => (jsx(DirectTextureBinding, { id: slot.id, label: slot.label, record: record, resourceIndexService: resourceIndexService, selectionService: selectionService, operations: operations, commit: commit, value: slot.get(standard), read: () => slot.get(standard), acceptedKinds: [slot.kind], sampleCategory: "sampleCategory" in slot ? slot.sampleCategory : undefined, invalidate: "rebuild", apply: (texture) => SetStandardTexture(standard, slot.id, texture) }, slot.id))) }));
|
|
113
|
+
}
|
|
114
|
+
if (section === "general") {
|
|
115
|
+
return (jsxs(Fragment, { children: [jsx(TextPropertyLine, { label: "Family", value: "standard" }), jsx(TextPropertyLine, { label: "Selection", value: source === material ? "Material" : "MaterialView" }), source !== material ? jsx(TextPropertyLine, { label: "Source", value: record.displayName }) : undefined, jsx(FieldStatus, { label: "Name", state: operations["material.name"], children: jsx(DerivedProperty, { component: TextInputPropertyLine, target: standard, getValue: (target) => target.name ?? "", setValue: (target, value) => commit({
|
|
116
|
+
id: "material.name",
|
|
117
|
+
oldValue: target.name ?? "",
|
|
118
|
+
newValue: value,
|
|
119
|
+
apply: () => {
|
|
120
|
+
target.name = value;
|
|
121
|
+
},
|
|
122
|
+
invalidate: "owned",
|
|
123
|
+
}), label: "Name", uniqueId: "material.name", disabled: operations["material.name"]?.pending, description: operations["material.name"]?.error }) }), [
|
|
124
|
+
["standard.backFaceCulling", "Back Face Culling", "backFaceCulling"],
|
|
125
|
+
["standard.disableLighting", "Disable Lighting", "disableLighting"],
|
|
126
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: SwitchPropertyLine, target: standard, getValue: (target) => target[key], setValue: (target, value) => commit({
|
|
127
|
+
id,
|
|
128
|
+
oldValue: target[key],
|
|
129
|
+
newValue: value,
|
|
130
|
+
apply: () => {
|
|
131
|
+
target[key] = value;
|
|
132
|
+
},
|
|
133
|
+
invalidate: "rebuild",
|
|
134
|
+
}), label: label, uniqueId: id, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id)))] }));
|
|
135
|
+
}
|
|
136
|
+
if (section === "transparency") {
|
|
137
|
+
return (jsxs(Fragment, { children: [jsx(FieldStatus, { label: "Alpha", state: operations["standard.alpha"], children: jsx(DerivedProperty, { component: NumberInputPropertyLine, target: standard, getValue: (target) => target.alpha, setValue: (target, value) => commit({
|
|
138
|
+
id: "standard.alpha",
|
|
139
|
+
oldValue: target.alpha,
|
|
140
|
+
newValue: value,
|
|
141
|
+
apply: () => {
|
|
142
|
+
target.alpha = value;
|
|
143
|
+
},
|
|
144
|
+
invalidate: target.alpha < 1 === value < 1 ? "ubo" : "rebuild",
|
|
145
|
+
}), label: "Alpha", uniqueId: "standard.alpha", disabled: operations["standard.alpha"]?.pending, description: operations["standard.alpha"]?.error }) }), jsx(FieldStatus, { label: "Alpha Cutoff", state: operations["standard.alphaCutOff"], children: jsx(DerivedProperty, { component: NumberInputPropertyLine, target: standard, getValue: (target) => target.alphaCutOff, setValue: (target, value) => commit({
|
|
146
|
+
id: "standard.alphaCutOff",
|
|
147
|
+
oldValue: target.alphaCutOff,
|
|
148
|
+
newValue: value,
|
|
149
|
+
apply: () => {
|
|
150
|
+
target.alphaCutOff = value;
|
|
151
|
+
},
|
|
152
|
+
invalidate: "ubo",
|
|
153
|
+
}), label: "Alpha Cutoff", uniqueId: "standard.alphaCutOff", disabled: operations["standard.alphaCutOff"]?.pending, description: operations["standard.alphaCutOff"]?.error }) })] }));
|
|
154
|
+
}
|
|
155
|
+
if (section === "lighting-colors") {
|
|
156
|
+
return (jsxs(Fragment, { children: [[
|
|
157
|
+
["standard.diffuseColor", "Diffuse Color", "diffuseColor"],
|
|
158
|
+
["standard.specularColor", "Specular Color", "specularColor"],
|
|
159
|
+
["standard.emissiveColor", "Emissive Color", "emissiveColor"],
|
|
160
|
+
["standard.ambientColor", "Ambient Color", "ambientColor"],
|
|
161
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: Color3PropertyLine, target: standard, getValue: (target) => target[key], setValue: (target, next) => {
|
|
162
|
+
const value = "r" in next ? [next.r, next.g, next.b] : [...next];
|
|
163
|
+
commit({
|
|
164
|
+
id,
|
|
165
|
+
oldValue: [...target[key]],
|
|
166
|
+
newValue: value,
|
|
167
|
+
apply: () => {
|
|
168
|
+
target[key] = value;
|
|
169
|
+
},
|
|
170
|
+
invalidate: "ubo",
|
|
171
|
+
});
|
|
172
|
+
}, label: label, uniqueId: id, disabled: operations[id]?.pending, description: operations[id]?.error, isLinearMode: true }) }, id))), jsx(FieldStatus, { label: "Specular Power", state: operations["standard.specularPower"], children: jsx(DerivedProperty, { component: NumberInputPropertyLine, target: standard, getValue: (target) => target.specularPower, setValue: (target, value) => commit({
|
|
173
|
+
id: "standard.specularPower",
|
|
174
|
+
oldValue: target.specularPower,
|
|
175
|
+
newValue: value,
|
|
176
|
+
apply: () => {
|
|
177
|
+
target.specularPower = value;
|
|
178
|
+
},
|
|
179
|
+
invalidate: "ubo",
|
|
180
|
+
}), label: "Specular Power", uniqueId: "standard.specularPower", min: 0, disabled: operations["standard.specularPower"]?.pending, description: operations["standard.specularPower"]?.error }) })] }));
|
|
181
|
+
}
|
|
182
|
+
if (section === "texture-settings") {
|
|
183
|
+
return (jsxs(Fragment, { children: [[
|
|
184
|
+
["standard.diffuseCoordIndex", "Diffuse Coordinates", "diffuseCoordIndex"],
|
|
185
|
+
["standard.specularCoordIndex", "Specular Coordinates", "specularCoordIndex"],
|
|
186
|
+
["standard.ambientCoordIndex", "Ambient Coordinates", "ambientCoordIndex"],
|
|
187
|
+
["standard.lightmapCoordIndex", "Lightmap Coordinates", "lightmapCoordIndex"],
|
|
188
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: NumberDropdownPropertyLine, target: standard, getValue: (target) => target[key], setValue: (target, value) => commit({
|
|
189
|
+
id,
|
|
190
|
+
oldValue: target[key],
|
|
191
|
+
newValue: value,
|
|
192
|
+
apply: () => {
|
|
193
|
+
target[key] = value;
|
|
194
|
+
},
|
|
195
|
+
invalidate: "rebuild",
|
|
196
|
+
}), label: label, uniqueId: id, options: UvOptions, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id))), [
|
|
197
|
+
["standard.bumpLevel", "Bump Level", "bumpLevel"],
|
|
198
|
+
["standard.ambientTexLevel", "Ambient Texture Level", "ambientTexLevel"],
|
|
199
|
+
["standard.lightmapLevel", "Lightmap Level", "lightmapLevel"],
|
|
200
|
+
["standard.opacityLevel", "Opacity Level", "opacityLevel"],
|
|
201
|
+
["standard.reflectionLevel", "Reflection Level", "reflectionLevel"],
|
|
202
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: NumberInputPropertyLine, target: standard, getValue: (target) => target[key], setValue: (target, value) => commit({
|
|
203
|
+
id,
|
|
204
|
+
oldValue: target[key],
|
|
205
|
+
newValue: value,
|
|
206
|
+
apply: () => {
|
|
207
|
+
target[key] = value;
|
|
208
|
+
},
|
|
209
|
+
invalidate: "ubo",
|
|
210
|
+
}), label: label, uniqueId: id, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id))), jsx(FieldStatus, { label: "Reflection Coordinates", state: operations["standard.reflectionCoordMode"], children: jsx(DerivedProperty, { component: NumberDropdownPropertyLine, target: standard, getValue: (target) => target.reflectionCoordMode, setValue: (target, value) => commit({
|
|
211
|
+
id: "standard.reflectionCoordMode",
|
|
212
|
+
oldValue: target.reflectionCoordMode,
|
|
213
|
+
newValue: value,
|
|
214
|
+
apply: () => {
|
|
215
|
+
target.reflectionCoordMode = value;
|
|
216
|
+
},
|
|
217
|
+
invalidate: "ubo",
|
|
218
|
+
}), label: "Reflection Coordinates", uniqueId: "standard.reflectionCoordMode", options: ReflectionOptions, disabled: operations["standard.reflectionCoordMode"]?.pending, description: operations["standard.reflectionCoordMode"]?.error }) }), [
|
|
219
|
+
["standard.useLightmapAsShadowmap", "Use Lightmap as Shadowmap", "useLightmapAsShadowmap"],
|
|
220
|
+
["standard.opacityFromRGB", "Opacity from RGB", "opacityFromRGB"],
|
|
221
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: SwitchPropertyLine, target: standard, getValue: (target) => target[key], setValue: (target, value) => commit({
|
|
222
|
+
id,
|
|
223
|
+
oldValue: target[key],
|
|
224
|
+
newValue: value,
|
|
225
|
+
apply: () => {
|
|
226
|
+
target[key] = value;
|
|
227
|
+
},
|
|
228
|
+
invalidate: "rebuild",
|
|
229
|
+
}), label: label, uniqueId: id, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id)))] }));
|
|
230
|
+
}
|
|
231
|
+
if (section === "transform") {
|
|
232
|
+
return (jsx(Fragment, { children: [
|
|
233
|
+
["standard.uvScale", "UV Scale", "uvScale"],
|
|
234
|
+
["standard.uvOffset", "UV Offset", "uvOffset"],
|
|
235
|
+
].map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: Vector2PropertyLine, target: standard, getValue: (target) => target[key] ?? [0, 0], setValue: (target, next) => {
|
|
236
|
+
const value = "x" in next ? [next.x, next.y] : [...next];
|
|
237
|
+
commit({
|
|
238
|
+
id,
|
|
239
|
+
oldValue: [...(target[key] ?? [0, 0])],
|
|
240
|
+
newValue: value,
|
|
241
|
+
apply: () => {
|
|
242
|
+
if (key === "uvOffset") {
|
|
243
|
+
enableStandardUvOffset();
|
|
244
|
+
}
|
|
245
|
+
target[key] = value;
|
|
246
|
+
},
|
|
247
|
+
invalidate: "rebuild",
|
|
248
|
+
});
|
|
249
|
+
}, label: label, uniqueId: id, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id))) }));
|
|
250
|
+
}
|
|
251
|
+
if (section === "stencil") {
|
|
252
|
+
const stencilFields = [
|
|
253
|
+
["standard.stencil.compare", "Stencil Compare", "compare", StencilCompareOptions],
|
|
254
|
+
["standard.stencil.passOp", "Stencil Pass Operation", "passOp", StencilOperationOptions],
|
|
255
|
+
["standard.stencil.failOp", "Stencil Fail Operation", "failOp", StencilOperationOptions],
|
|
256
|
+
["standard.stencil.depthFailOp", "Stencil Depth Fail Operation", "depthFailOp", StencilOperationOptions],
|
|
257
|
+
];
|
|
258
|
+
const maskFields = [
|
|
259
|
+
["standard.stencil.readMask", "Stencil Read Mask", "readMask"],
|
|
260
|
+
["standard.stencil.writeMask", "Stencil Write Mask", "writeMask"],
|
|
261
|
+
];
|
|
262
|
+
if (!standard.stencil) {
|
|
263
|
+
return (jsx(Fragment, { children: [...stencilFields, ...maskFields].map(([id, label]) => (jsx(ComputedProperty, { component: TextPropertyLine, target: standard, getValue: () => "Not configured", label: label, uniqueId: id }, id))) }));
|
|
264
|
+
}
|
|
265
|
+
const updateStencil = (id, key, value) => {
|
|
266
|
+
const current = standard.stencil;
|
|
267
|
+
commit({
|
|
268
|
+
id,
|
|
269
|
+
oldValue: current?.[key],
|
|
270
|
+
newValue: value,
|
|
271
|
+
apply: () => {
|
|
272
|
+
if ((key === "readMask" || key === "writeMask") && (typeof value !== "number" || !Number.isInteger(value) || value < 0 || value > 0xffffffff)) {
|
|
273
|
+
throw new RangeError(`Property "${id}" requires an integer mask between 0 and 4294967295.`);
|
|
274
|
+
}
|
|
275
|
+
enableMaterialStencil();
|
|
276
|
+
standard.stencil = { ...current, [key]: value };
|
|
277
|
+
},
|
|
278
|
+
invalidate: "rebuild",
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
return (jsxs(Fragment, { children: [stencilFields.map(([id, label, key, options]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: StringDropdownPropertyLine, target: standard, getValue: (target) => target.stencil?.[key] ?? (key === "compare" ? "always" : "keep"), setValue: (_target, value) => updateStencil(id, key, value), label: label, uniqueId: id, options: options, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id))), maskFields.map(([id, label, key]) => (jsx(FieldStatus, { label: label, state: operations[id], children: jsx(DerivedProperty, { component: NumberInputPropertyLine, target: standard, getValue: (target) => target.stencil?.[key] ?? 0xff, setValue: (_target, value) => updateStencil(id, key, value), label: label, uniqueId: id, min: 0, max: 0xffffffff, step: 1, forceInt: true, disabled: operations[id]?.pending, description: operations[id]?.error }) }, id)))] }));
|
|
282
|
+
}
|
|
283
|
+
return null;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export { StandardMaterialAdapter };
|
|
287
|
+
//# sourceMappingURL=standardMaterialProperties-BbYdFX86.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standardMaterialProperties-BbYdFX86.js","sources":["../../../../../../../../../../dev/inspector-v2/src/lite/services/panes/properties/materials/standardMaterialProperties.tsx"],"sourcesContent":["import {\n enableMaterialStencil,\n enableStandardUvOffset,\n getStandardAmbientTexture,\n getStandardBumpTexture,\n getStandardEmissiveTexture,\n getStandardLightmapTexture,\n getStandardOpacityTexture,\n getStandardReflectionCubeTexture,\n getStandardReflectionTexture,\n getStandardSpecularTexture,\n setStandardAmbientTexture,\n setStandardBumpTexture,\n setStandardEmissiveTexture,\n setStandardLightmapTexture,\n setStandardOpacityTexture,\n setStandardReflectionCubeTexture,\n setStandardReflectionTexture,\n setStandardSpecularTexture,\n type CubeTexture,\n type StandardMaterialProps,\n type StencilState,\n type Texture2D,\n} from \"@babylonjs/lite\";\nimport { Body1 } from \"@fluentui/react-components\";\nimport { type FunctionComponent, type ReactNode } from \"react\";\n\nimport { NumberDropdownPropertyLine, StringDropdownPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/dropdownPropertyLine\";\nimport { NumberInputPropertyLine, TextInputPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/inputPropertyLine\";\nimport { SwitchPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/switchPropertyLine\";\nimport { TextPropertyLine } from \"shared-ui-components/fluent/hoc/propertyLines/textPropertyLine\";\nimport { Color3PropertyLine } from \"shared-ui-components/lite/fluent/hoc/propertyLines/colorPropertyLine\";\nimport { Vector2PropertyLine } from \"shared-ui-components/lite/fluent/hoc/propertyLines/vectorPropertyLine\";\n\nimport { ComputedProperty, DerivedProperty } from \"../../../../../components/properties/boundProperty\";\nimport { DirectTextureBinding } from \"./directTextureBinding\";\nimport { type MaterialAdapterProps } from \"./materialAdapterTypes\";\nimport { useDirectMaterialOperations } from \"./useDirectMaterialOperations\";\n\nconst UvOptions = [\n { value: 0, label: \"UV1\" },\n { value: 1, label: \"UV2\" },\n];\nconst ReflectionOptions = [\n { value: 1, label: \"Spherical\" },\n { value: 2, label: \"Planar\" },\n];\nconst StencilCompareOptions = [\n { value: \"never\", label: \"Never\" },\n { value: \"less\", label: \"Less\" },\n { value: \"equal\", label: \"Equal\" },\n { value: \"less-equal\", label: \"Less or Equal\" },\n { value: \"greater\", label: \"Greater\" },\n { value: \"not-equal\", label: \"Not Equal\" },\n { value: \"greater-equal\", label: \"Greater or Equal\" },\n { value: \"always\", label: \"Always\" },\n];\nconst StencilOperationOptions = [\n { value: \"keep\", label: \"Keep\" },\n { value: \"zero\", label: \"Zero\" },\n { value: \"replace\", label: \"Replace\" },\n { value: \"invert\", label: \"Invert\" },\n { value: \"increment-clamp\", label: \"Increment Clamp\" },\n { value: \"decrement-clamp\", label: \"Decrement Clamp\" },\n { value: \"increment-wrap\", label: \"Increment Wrap\" },\n { value: \"decrement-wrap\", label: \"Decrement Wrap\" },\n];\n\ntype StandardMaterial = StandardMaterialProps;\ntype DirectOperations = ReturnType<typeof useDirectMaterialOperations>;\n\nconst StandardTextureSlots = [\n { id: \"standard.diffuse\", label: \"Diffuse Texture\", kind: \"2d\", get: (material: StandardMaterial) => material.diffuseTexture },\n { id: \"standard.emissive\", label: \"Emissive Texture\", kind: \"2d\", get: getStandardEmissiveTexture, sampleCategory: \"float-or-depth\" },\n { id: \"standard.bump\", label: \"Bump Texture\", kind: \"2d\", get: getStandardBumpTexture },\n { id: \"standard.specular\", label: \"Specular Texture\", kind: \"2d\", get: getStandardSpecularTexture },\n { id: \"standard.ambient\", label: \"Ambient Texture\", kind: \"2d\", get: getStandardAmbientTexture },\n { id: \"standard.lightmap\", label: \"Lightmap Texture\", kind: \"2d\", get: getStandardLightmapTexture },\n { id: \"standard.opacity\", label: \"Opacity Texture\", kind: \"2d\", get: getStandardOpacityTexture },\n { id: \"standard.reflection2d\", label: \"Reflection Texture\", kind: \"2d\", get: getStandardReflectionTexture },\n { id: \"standard.reflectionCube\", label: \"Reflection Cube Texture\", kind: \"cube\", get: getStandardReflectionCubeTexture },\n] as const;\n\nfunction SetStandardTexture(material: StandardMaterial, id: (typeof StandardTextureSlots)[number][\"id\"], texture: object | null): void {\n if (id === \"standard.reflectionCube\") {\n setStandardReflectionCubeTexture(material, texture as CubeTexture | null);\n return;\n }\n const value = texture as Texture2D | null;\n switch (id) {\n case \"standard.diffuse\":\n material.diffuseTexture = value;\n return;\n case \"standard.emissive\":\n setStandardEmissiveTexture(material, value);\n return;\n case \"standard.bump\":\n setStandardBumpTexture(material, value);\n return;\n case \"standard.specular\":\n setStandardSpecularTexture(material, value);\n return;\n case \"standard.ambient\":\n setStandardAmbientTexture(material, value);\n return;\n case \"standard.lightmap\":\n setStandardLightmapTexture(material, value);\n return;\n case \"standard.opacity\":\n setStandardOpacityTexture(material, value);\n return;\n case \"standard.reflection2d\":\n setStandardReflectionTexture(material, value);\n return;\n }\n}\n\nconst FieldStatus: FunctionComponent<{ label: string; state: DirectOperations[\"operations\"][string]; children: ReactNode }> = (props) => {\n const { label, state, children } = props;\n return (\n <div aria-busy={state?.pending ?? false}>\n {children}\n {state?.pending ? <Body1 role=\"status\">{`Applying ${label}…`}</Body1> : undefined}\n {state?.error ? <Body1 role=\"alert\">{state.error}</Body1> : undefined}\n </div>\n );\n};\n\n/**\n * Lazily loaded Standard material section properties.\n * @param props The selected material section and instance services.\n * @returns Standard material property content.\n */\nexport const StandardMaterialAdapter: FunctionComponent<MaterialAdapterProps> = (props) => {\n const { material, section, resourceIndexService, selectionService } = props;\n const { source, record, operations, commit } = useDirectMaterialOperations(material, resourceIndexService, selectionService);\n const standard = material as StandardMaterial;\n\n if (!record) {\n return <TextPropertyLine label=\"Error\" value=\"This material is no longer available in an inspected scene.\" />;\n }\n\n if (section === \"textures\") {\n return (\n <>\n {StandardTextureSlots.map((slot) => (\n <DirectTextureBinding\n key={slot.id}\n id={slot.id}\n label={slot.label}\n record={record}\n resourceIndexService={resourceIndexService}\n selectionService={selectionService}\n operations={operations}\n commit={commit}\n value={slot.get(standard)}\n read={() => slot.get(standard)}\n acceptedKinds={[slot.kind]}\n sampleCategory={\"sampleCategory\" in slot ? slot.sampleCategory : undefined}\n invalidate=\"rebuild\"\n apply={(texture) => SetStandardTexture(standard, slot.id, texture)}\n />\n ))}\n </>\n );\n }\n\n if (section === \"general\") {\n return (\n <>\n <TextPropertyLine label=\"Family\" value=\"standard\" />\n <TextPropertyLine label=\"Selection\" value={source === material ? \"Material\" : \"MaterialView\"} />\n {source !== material ? <TextPropertyLine label=\"Source\" value={record.displayName} /> : undefined}\n <FieldStatus label=\"Name\" state={operations[\"material.name\"]}>\n <DerivedProperty\n component={TextInputPropertyLine}\n target={standard}\n getValue={(target) => target.name ?? \"\"}\n setValue={(target, value) =>\n commit({\n id: \"material.name\",\n oldValue: target.name ?? \"\",\n newValue: value,\n apply: () => {\n target.name = value;\n },\n invalidate: \"owned\",\n })\n }\n label=\"Name\"\n uniqueId=\"material.name\"\n disabled={operations[\"material.name\"]?.pending}\n description={operations[\"material.name\"]?.error}\n />\n </FieldStatus>\n {(\n [\n [\"standard.backFaceCulling\", \"Back Face Culling\", \"backFaceCulling\"],\n [\"standard.disableLighting\", \"Disable Lighting\", \"disableLighting\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={SwitchPropertyLine}\n target={standard}\n getValue={(target) => target[key]}\n setValue={(target, value) =>\n commit({\n id,\n oldValue: target[key],\n newValue: value,\n apply: () => {\n target[key] = value;\n },\n invalidate: \"rebuild\",\n })\n }\n label={label}\n uniqueId={id}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n </>\n );\n }\n\n if (section === \"transparency\") {\n return (\n <>\n <FieldStatus label=\"Alpha\" state={operations[\"standard.alpha\"]}>\n <DerivedProperty\n component={NumberInputPropertyLine}\n target={standard}\n getValue={(target) => target.alpha}\n setValue={(target, value) =>\n commit({\n id: \"standard.alpha\",\n oldValue: target.alpha,\n newValue: value,\n apply: () => {\n target.alpha = value;\n },\n invalidate: target.alpha < 1 === value < 1 ? \"ubo\" : \"rebuild\",\n })\n }\n label=\"Alpha\"\n uniqueId=\"standard.alpha\"\n disabled={operations[\"standard.alpha\"]?.pending}\n description={operations[\"standard.alpha\"]?.error}\n />\n </FieldStatus>\n <FieldStatus label=\"Alpha Cutoff\" state={operations[\"standard.alphaCutOff\"]}>\n <DerivedProperty\n component={NumberInputPropertyLine}\n target={standard}\n getValue={(target) => target.alphaCutOff}\n setValue={(target, value) =>\n commit({\n id: \"standard.alphaCutOff\",\n oldValue: target.alphaCutOff,\n newValue: value,\n apply: () => {\n target.alphaCutOff = value;\n },\n invalidate: \"ubo\",\n })\n }\n label=\"Alpha Cutoff\"\n uniqueId=\"standard.alphaCutOff\"\n disabled={operations[\"standard.alphaCutOff\"]?.pending}\n description={operations[\"standard.alphaCutOff\"]?.error}\n />\n </FieldStatus>\n </>\n );\n }\n\n if (section === \"lighting-colors\") {\n return (\n <>\n {(\n [\n [\"standard.diffuseColor\", \"Diffuse Color\", \"diffuseColor\"],\n [\"standard.specularColor\", \"Specular Color\", \"specularColor\"],\n [\"standard.emissiveColor\", \"Emissive Color\", \"emissiveColor\"],\n [\"standard.ambientColor\", \"Ambient Color\", \"ambientColor\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={Color3PropertyLine}\n target={standard}\n getValue={(target) => target[key]}\n setValue={(target, next) => {\n const value: [number, number, number] = \"r\" in next ? [next.r, next.g, next.b] : [...next];\n commit({\n id,\n oldValue: [...target[key]],\n newValue: value,\n apply: () => {\n target[key] = value;\n },\n invalidate: \"ubo\",\n });\n }}\n label={label}\n uniqueId={id}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n isLinearMode\n />\n </FieldStatus>\n ))}\n <FieldStatus label=\"Specular Power\" state={operations[\"standard.specularPower\"]}>\n <DerivedProperty\n component={NumberInputPropertyLine}\n target={standard}\n getValue={(target) => target.specularPower}\n setValue={(target, value) =>\n commit({\n id: \"standard.specularPower\",\n oldValue: target.specularPower,\n newValue: value,\n apply: () => {\n target.specularPower = value;\n },\n invalidate: \"ubo\",\n })\n }\n label=\"Specular Power\"\n uniqueId=\"standard.specularPower\"\n min={0}\n disabled={operations[\"standard.specularPower\"]?.pending}\n description={operations[\"standard.specularPower\"]?.error}\n />\n </FieldStatus>\n </>\n );\n }\n\n if (section === \"texture-settings\") {\n return (\n <>\n {(\n [\n [\"standard.diffuseCoordIndex\", \"Diffuse Coordinates\", \"diffuseCoordIndex\"],\n [\"standard.specularCoordIndex\", \"Specular Coordinates\", \"specularCoordIndex\"],\n [\"standard.ambientCoordIndex\", \"Ambient Coordinates\", \"ambientCoordIndex\"],\n [\"standard.lightmapCoordIndex\", \"Lightmap Coordinates\", \"lightmapCoordIndex\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={NumberDropdownPropertyLine}\n target={standard}\n getValue={(target) => target[key]}\n setValue={(target, value) =>\n commit({\n id,\n oldValue: target[key],\n newValue: value,\n apply: () => {\n target[key] = value as 0 | 1;\n },\n invalidate: \"rebuild\",\n })\n }\n label={label}\n uniqueId={id}\n options={UvOptions}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n {(\n [\n [\"standard.bumpLevel\", \"Bump Level\", \"bumpLevel\"],\n [\"standard.ambientTexLevel\", \"Ambient Texture Level\", \"ambientTexLevel\"],\n [\"standard.lightmapLevel\", \"Lightmap Level\", \"lightmapLevel\"],\n [\"standard.opacityLevel\", \"Opacity Level\", \"opacityLevel\"],\n [\"standard.reflectionLevel\", \"Reflection Level\", \"reflectionLevel\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={NumberInputPropertyLine}\n target={standard}\n getValue={(target) => target[key]}\n setValue={(target, value) =>\n commit({\n id,\n oldValue: target[key],\n newValue: value,\n apply: () => {\n target[key] = value;\n },\n invalidate: \"ubo\",\n })\n }\n label={label}\n uniqueId={id}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n <FieldStatus label=\"Reflection Coordinates\" state={operations[\"standard.reflectionCoordMode\"]}>\n <DerivedProperty\n component={NumberDropdownPropertyLine}\n target={standard}\n getValue={(target) => target.reflectionCoordMode}\n setValue={(target, value) =>\n commit({\n id: \"standard.reflectionCoordMode\",\n oldValue: target.reflectionCoordMode,\n newValue: value,\n apply: () => {\n target.reflectionCoordMode = value as 1 | 2;\n },\n invalidate: \"ubo\",\n })\n }\n label=\"Reflection Coordinates\"\n uniqueId=\"standard.reflectionCoordMode\"\n options={ReflectionOptions}\n disabled={operations[\"standard.reflectionCoordMode\"]?.pending}\n description={operations[\"standard.reflectionCoordMode\"]?.error}\n />\n </FieldStatus>\n {(\n [\n [\"standard.useLightmapAsShadowmap\", \"Use Lightmap as Shadowmap\", \"useLightmapAsShadowmap\"],\n [\"standard.opacityFromRGB\", \"Opacity from RGB\", \"opacityFromRGB\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={SwitchPropertyLine}\n target={standard}\n getValue={(target) => target[key]}\n setValue={(target, value) =>\n commit({\n id,\n oldValue: target[key],\n newValue: value,\n apply: () => {\n target[key] = value;\n },\n invalidate: \"rebuild\",\n })\n }\n label={label}\n uniqueId={id}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n </>\n );\n }\n\n if (section === \"transform\") {\n return (\n <>\n {(\n [\n [\"standard.uvScale\", \"UV Scale\", \"uvScale\"],\n [\"standard.uvOffset\", \"UV Offset\", \"uvOffset\"],\n ] as const\n ).map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={Vector2PropertyLine}\n target={standard}\n getValue={(target) => target[key] ?? ([0, 0] as const)}\n setValue={(target, next) => {\n const value: [number, number] = \"x\" in next ? [next.x, next.y] : [...next];\n commit({\n id,\n oldValue: [...(target[key] ?? [0, 0])],\n newValue: value,\n apply: () => {\n if (key === \"uvOffset\") {\n enableStandardUvOffset();\n }\n target[key] = value;\n },\n invalidate: \"rebuild\",\n });\n }}\n label={label}\n uniqueId={id}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n </>\n );\n }\n\n if (section === \"stencil\") {\n const stencilFields = [\n [\"standard.stencil.compare\", \"Stencil Compare\", \"compare\", StencilCompareOptions],\n [\"standard.stencil.passOp\", \"Stencil Pass Operation\", \"passOp\", StencilOperationOptions],\n [\"standard.stencil.failOp\", \"Stencil Fail Operation\", \"failOp\", StencilOperationOptions],\n [\"standard.stencil.depthFailOp\", \"Stencil Depth Fail Operation\", \"depthFailOp\", StencilOperationOptions],\n ] as const;\n const maskFields = [\n [\"standard.stencil.readMask\", \"Stencil Read Mask\", \"readMask\"],\n [\"standard.stencil.writeMask\", \"Stencil Write Mask\", \"writeMask\"],\n ] as const;\n if (!standard.stencil) {\n return (\n <>\n {[...stencilFields, ...maskFields].map(([id, label]) => (\n <ComputedProperty key={id} component={TextPropertyLine} target={standard} getValue={() => \"Not configured\"} label={label} uniqueId={id} />\n ))}\n </>\n );\n }\n const updateStencil = (id: string, key: keyof StencilState, value: StencilState[keyof StencilState]) => {\n const current = standard.stencil;\n commit({\n id,\n oldValue: current?.[key],\n newValue: value,\n apply: () => {\n if ((key === \"readMask\" || key === \"writeMask\") && (typeof value !== \"number\" || !Number.isInteger(value) || value < 0 || value > 0xffffffff)) {\n throw new RangeError(`Property \"${id}\" requires an integer mask between 0 and 4294967295.`);\n }\n enableMaterialStencil();\n standard.stencil = { ...current, [key]: value };\n },\n invalidate: \"rebuild\",\n });\n };\n return (\n <>\n {stencilFields.map(([id, label, key, options]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={StringDropdownPropertyLine}\n target={standard}\n getValue={(target) => target.stencil?.[key] ?? (key === \"compare\" ? \"always\" : \"keep\")}\n setValue={(_target, value) => updateStencil(id, key, value as StencilState[typeof key])}\n label={label}\n uniqueId={id}\n options={options}\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n {maskFields.map(([id, label, key]) => (\n <FieldStatus key={id} label={label} state={operations[id]}>\n <DerivedProperty\n component={NumberInputPropertyLine}\n target={standard}\n getValue={(target) => target.stencil?.[key] ?? 0xff}\n setValue={(_target, value) => updateStencil(id, key, value)}\n label={label}\n uniqueId={id}\n min={0}\n max={0xffffffff}\n step={1}\n forceInt\n disabled={operations[id]?.pending}\n description={operations[id]?.error}\n />\n </FieldStatus>\n ))}\n </>\n );\n }\n\n return null;\n};\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,SAAS,GAAG;AACd,IAAA,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;AAC1B,IAAA,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE;CAC7B;AACD,MAAM,iBAAiB,GAAG;AACtB,IAAA,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE;AAChC,IAAA,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE;CAChC;AACD,MAAM,qBAAqB,GAAG;AAC1B,IAAA,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO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CAAC,CAAA,EAAA,CACH;IAEX;AAEA,IAAA,OAAO,IAAI;AACf;;"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { getTextureMetadata, getTextureTransform, getTextureCoordinateIndex, setTextureTransform, hasMaterialUvTransform, enableMaterialUvTransform, markMaterialUboDirty, rebuildMaterial, getMaterialSource } from '@babylonjs/lite';
|
|
3
|
+
import { makeStyles, tokens, Body1 } from '@fluentui/react-components';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { p as usePropertyChangedNotifier, o as useObservableState, T as TextPropertyLine, v as BooleanBadgePropertyLine, g as StringifiedPropertyLine, w as LinkPropertyLine, x as GetMaterialTopologyBindings, D as DerivedProperty, N as NumberInputPropertyLine, q as GetMaterialOwningScenes } from './index-Cy8gzpYG.js';
|
|
6
|
+
import { u as useLatestAsyncOperation } from './useLatestAsyncOperation-k59AgA3B.js';
|
|
7
|
+
import '@babylonjs/core/Misc/observable.js';
|
|
8
|
+
import '@fluentui/react-icons';
|
|
9
|
+
import '@babylonjs/core/Misc/dataStorage.js';
|
|
10
|
+
import '@babylonjs/core/Misc/asyncLock.js';
|
|
11
|
+
import '@babylonjs/core/Misc/deferred.js';
|
|
12
|
+
import '@fluentui-contrib/react-resize-handle';
|
|
13
|
+
import '@fluentui/react-motion-components-preview';
|
|
14
|
+
import '@babylonjs/core/Misc/logger.js';
|
|
15
|
+
import 'react-dom/client';
|
|
16
|
+
import '@fluentui-contrib/react-virtualizer';
|
|
17
|
+
import '@babylonjs/core/Misc/uniqueIdGenerator.js';
|
|
18
|
+
import '@babylonjs/core/Maths/math.color.js';
|
|
19
|
+
import '@babylonjs/core/Maths/math.vector.js';
|
|
20
|
+
|
|
21
|
+
const useStyles = makeStyles({
|
|
22
|
+
section: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
flexDirection: "column",
|
|
25
|
+
gap: tokens.spacingVerticalXS,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
function OptionalRow(id, label, value, units) {
|
|
29
|
+
return value === undefined
|
|
30
|
+
? { id, label, value: null, description: "Not retained by the Lite texture wrapper." }
|
|
31
|
+
: { id, label, value: typeof value === "string" ? value : String(value), units };
|
|
32
|
+
}
|
|
33
|
+
function GetMaterialRecord(resourceIndexService, material) {
|
|
34
|
+
return resourceIndexService.getMaterialRecord(getMaterialSource(material));
|
|
35
|
+
}
|
|
36
|
+
function GetConsumerScenes(record, resourceIndexService) {
|
|
37
|
+
const scenes = new Set();
|
|
38
|
+
for (const consumer of record?.consumers ?? []) {
|
|
39
|
+
const record = GetMaterialRecord(resourceIndexService, consumer.material);
|
|
40
|
+
for (const scene of record ? GetMaterialOwningScenes(record, consumer.material) : []) {
|
|
41
|
+
scenes.add(scene);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return [...scenes];
|
|
45
|
+
}
|
|
46
|
+
function SupportsTransform(record, resourceIndexService) {
|
|
47
|
+
if (!record || record.metadata.kind !== "2d" || getTextureTransform(record.entity) === undefined) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return record.consumers.some((consumer) => {
|
|
51
|
+
const materialRecord = GetMaterialRecord(resourceIndexService, consumer.material);
|
|
52
|
+
return ((materialRecord?.family === "standard" || materialRecord?.family === "pbr") &&
|
|
53
|
+
consumer.bindingId !== "standard.reflection2d" &&
|
|
54
|
+
consumer.bindingId !== "standard.reflectionCube" &&
|
|
55
|
+
(consumer.material === materialRecord.source ? materialRecord.bindings : GetMaterialTopologyBindings(consumer.material)).some((binding) => binding.id === consumer.bindingId && binding.entity === record.entity));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function GetMetadataRows(metadata, ordinal, texture) {
|
|
59
|
+
const rows = [
|
|
60
|
+
{ id: "identity", label: "Identity", value: ordinal === undefined ? "Unindexed texture" : `Texture ${ordinal}` },
|
|
61
|
+
OptionalRow("name", "Name", metadata.name),
|
|
62
|
+
{ id: "kind", label: "Kind", value: metadata.kind },
|
|
63
|
+
OptionalRow("origin", "Origin", metadata.origin),
|
|
64
|
+
OptionalRow("width", "Width", metadata.width, "px"),
|
|
65
|
+
OptionalRow("height", "Height", metadata.height, "px"),
|
|
66
|
+
];
|
|
67
|
+
if (metadata.kind === "2d-array") {
|
|
68
|
+
rows.push(OptionalRow("layers", "Layers", metadata.layers));
|
|
69
|
+
}
|
|
70
|
+
else if (metadata.kind === "3d") {
|
|
71
|
+
rows.push(OptionalRow("depth", "Depth", metadata.depth));
|
|
72
|
+
}
|
|
73
|
+
else if (metadata.kind === "cube") {
|
|
74
|
+
rows.push({ id: "faces", label: "Faces", value: "6" });
|
|
75
|
+
}
|
|
76
|
+
rows.push(OptionalRow("format", "Format", metadata.format), OptionalRow("mip-levels", "Mip Levels", metadata.mipLevelCount), OptionalRow("sample-type", "Sample Type", metadata.sampleType), OptionalRow("color-space", "Color Space", metadata.colorSpace), OptionalRow("invert-y", "Invert Y", metadata.invertY), OptionalRow("address-u", "Address U", metadata.sampler?.addressModeU), OptionalRow("address-v", "Address V", metadata.sampler?.addressModeV), OptionalRow("address-w", "Address W", metadata.sampler?.addressModeW), OptionalRow("min-filter", "Min Filter", metadata.sampler?.minFilter), OptionalRow("mag-filter", "Mag Filter", metadata.sampler?.magFilter), OptionalRow("mipmap-filter", "Mipmap Filter", metadata.sampler?.mipmapFilter), OptionalRow("anisotropy", "Max Anisotropy", metadata.sampler?.maxAnisotropy), OptionalRow("dynamic-update", "Dynamic Update", metadata.capabilities.dynamicUpdate), OptionalRow("render-attachment", "Render Attachment", metadata.capabilities.renderAttachment), OptionalRow("sampled-depth", "Sampled Depth", metadata.capabilities.sampledDepth));
|
|
77
|
+
if (metadata.kind === "2d") {
|
|
78
|
+
rows.push(OptionalRow("coordinates", "Coordinate Index", getTextureCoordinateIndex(texture)));
|
|
79
|
+
}
|
|
80
|
+
if (metadata.width === 0 || metadata.height === 0) {
|
|
81
|
+
rows.push({ id: "availability", label: "Availability", value: "Transient or unavailable" });
|
|
82
|
+
}
|
|
83
|
+
return rows;
|
|
84
|
+
}
|
|
85
|
+
const TransformFields = [
|
|
86
|
+
["uScale", "U Scale"],
|
|
87
|
+
["vScale", "V Scale"],
|
|
88
|
+
["uOffset", "U Offset"],
|
|
89
|
+
["vOffset", "V Offset"],
|
|
90
|
+
["uAng", "Angle"],
|
|
91
|
+
];
|
|
92
|
+
const TextureTransformField = (props) => {
|
|
93
|
+
const { transform, field, pending, error, commit } = props;
|
|
94
|
+
const [key, label] = field;
|
|
95
|
+
const id = `transform-${key}`;
|
|
96
|
+
return (jsxs("div", { "aria-busy": pending, children: [jsx(DerivedProperty, { component: NumberInputPropertyLine, target: transform, getValue: (value) => value[key], setValue: (_, next) => commit(id, key, next), label: label, uniqueId: id, disabled: pending, description: error ? `Error: ${error}` : undefined }), pending ? jsx(Body1, { role: "status", children: `Applying ${label}…` }) : undefined, error ? jsx(Body1, { role: "alert", children: error }) : undefined] }));
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Displays metadata properties for one exact Lite texture wrapper.
|
|
100
|
+
* @param props - The exact texture, resource index, and selection service.
|
|
101
|
+
* @returns The metadata-only texture properties UI.
|
|
102
|
+
*/
|
|
103
|
+
const TextureMetadataProperties = (props) => {
|
|
104
|
+
const { texture, resourceIndexService, selectionService } = props;
|
|
105
|
+
const notifyPropertyChanged = usePropertyChangedNotifier();
|
|
106
|
+
const classes = useStyles();
|
|
107
|
+
const getSnapshot = useCallback(() => {
|
|
108
|
+
const record = resourceIndexService.getTextureRecord(texture);
|
|
109
|
+
try {
|
|
110
|
+
const metadata = getTextureMetadata(texture);
|
|
111
|
+
return metadata ? { metadata, record } : undefined;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
}, [resourceIndexService, texture]);
|
|
117
|
+
const snapshot = useObservableState(getSnapshot, resourceIndexService.onChanged);
|
|
118
|
+
const isResourceIndexDisposed = useCallback(() => resourceIndexService.isDisposed, [resourceIndexService]);
|
|
119
|
+
const [operations, runLatestOperation] = useLatestAsyncOperation(texture, [resourceIndexService.onDisposed, selectionService.onSelectedEntityChanged], isResourceIndexDisposed);
|
|
120
|
+
if (!snapshot) {
|
|
121
|
+
return (jsx("div", { className: classes.section, role: "alert", children: jsx(TextPropertyLine, { label: "Error", value: "This texture is unavailable or malformed." }) }));
|
|
122
|
+
}
|
|
123
|
+
const { metadata, record } = snapshot;
|
|
124
|
+
const canEditTransform = SupportsTransform(record, resourceIndexService);
|
|
125
|
+
const transform = canEditTransform ? getTextureTransform(texture) : undefined;
|
|
126
|
+
const consumersByMaterial = new Map();
|
|
127
|
+
for (const consumer of record?.consumers ?? []) {
|
|
128
|
+
const slots = consumersByMaterial.get(consumer.material);
|
|
129
|
+
if (slots) {
|
|
130
|
+
slots.push(consumer.bindingId);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
consumersByMaterial.set(consumer.material, [consumer.bindingId]);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const commitTransform = (id, key, value) => {
|
|
137
|
+
runLatestOperation({
|
|
138
|
+
id,
|
|
139
|
+
operationAsync: async () => {
|
|
140
|
+
const currentRecord = resourceIndexService.getTextureRecord(texture);
|
|
141
|
+
if (!currentRecord) {
|
|
142
|
+
throw new Error("This texture is no longer available in an inspected scene.");
|
|
143
|
+
}
|
|
144
|
+
const consumerRecords = currentRecord.consumers.map((consumer) => GetMaterialRecord(resourceIndexService, consumer.material));
|
|
145
|
+
if (currentRecord.consumers.some((consumer, index) => !consumerRecords[index] || !GetMaterialOwningScenes(consumerRecords[index], consumer.material).length)) {
|
|
146
|
+
throw new Error("The texture has an incomplete owning scene scope.");
|
|
147
|
+
}
|
|
148
|
+
const scenes = [...GetConsumerScenes(currentRecord, resourceIndexService)];
|
|
149
|
+
const materialRecords = [
|
|
150
|
+
...new Set(consumerRecords.filter((item) => item !== undefined && (item.family === "standard" || item.family === "pbr"))),
|
|
151
|
+
];
|
|
152
|
+
if (scenes.length === 0 || materialRecords.length === 0) {
|
|
153
|
+
throw new Error("The texture has no complete owning scene scope.");
|
|
154
|
+
}
|
|
155
|
+
const currentTransform = getTextureTransform(texture);
|
|
156
|
+
if (!currentTransform) {
|
|
157
|
+
throw new Error("This texture no longer supports UV transforms.");
|
|
158
|
+
}
|
|
159
|
+
if (currentTransform[key] === value) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
const previousValue = currentTransform[key];
|
|
163
|
+
const changed = setTextureTransform(texture, { ...currentTransform, [key]: value });
|
|
164
|
+
if (!changed) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
await Promise.all(materialRecords.flatMap((materialRecord) => {
|
|
168
|
+
const wasEnabled = hasMaterialUvTransform(materialRecord.source);
|
|
169
|
+
enableMaterialUvTransform(materialRecord.source);
|
|
170
|
+
markMaterialUboDirty(materialRecord.source);
|
|
171
|
+
return materialRecord.family === "standard" || !wasEnabled
|
|
172
|
+
? materialRecord.scenes.map(async (scene) =>
|
|
173
|
+
// The repository-pinned Lite declarations predate direct rebuild completion.
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/await-thenable, @typescript-eslint/return-await
|
|
175
|
+
await rebuildMaterial(scene, materialRecord.source, {
|
|
176
|
+
rebuildViews: true,
|
|
177
|
+
rebuildFrameGraph: false,
|
|
178
|
+
}))
|
|
179
|
+
: [];
|
|
180
|
+
}));
|
|
181
|
+
return previousValue;
|
|
182
|
+
},
|
|
183
|
+
onSuccess: (previousValue) => {
|
|
184
|
+
if (previousValue !== undefined) {
|
|
185
|
+
notifyPropertyChanged(texture, key, previousValue, value);
|
|
186
|
+
resourceIndexService.refresh();
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
getErrorMessage: (error) => (error instanceof Error ? error.message : "The texture transform change failed."),
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
return (jsxs("div", { className: classes.section, children: [GetMetadataRows(metadata, record?.ordinal, texture).map((row) => {
|
|
193
|
+
return (jsx("div", { children: typeof row.value === "boolean" ? (jsx(BooleanBadgePropertyLine, { label: row.label, uniqueId: row.id, value: row.value, description: row.description })) : typeof row.value === "number" ? (jsx(StringifiedPropertyLine, { label: row.label, uniqueId: row.id, value: row.value, units: row.units, description: row.description })) : (jsx(TextPropertyLine, { label: row.label, uniqueId: row.id, value: row.value == null ? "Unavailable" : row.value, description: row.description })) }, row.id));
|
|
194
|
+
}), transform
|
|
195
|
+
? TransformFields.map((field) => {
|
|
196
|
+
const id = `transform-${field[0]}`;
|
|
197
|
+
return (jsx(TextureTransformField, { transform: transform, field: field, pending: operations[id]?.pending, error: operations[id]?.error, commit: commitTransform }, id));
|
|
198
|
+
})
|
|
199
|
+
: undefined, [...consumersByMaterial].map(([material, slots], index) => {
|
|
200
|
+
const materialRecord = GetMaterialRecord(resourceIndexService, material);
|
|
201
|
+
const value = materialRecord
|
|
202
|
+
? material === materialRecord.source
|
|
203
|
+
? materialRecord.displayName
|
|
204
|
+
: material.name || materialRecord.displayName
|
|
205
|
+
: "Unavailable material";
|
|
206
|
+
const slotNames = slots.join(", ");
|
|
207
|
+
return (jsx(LinkPropertyLine, { label: slotNames, uniqueId: `consumer-${index}`, value: value, onLink: materialRecord
|
|
208
|
+
? () => {
|
|
209
|
+
const currentRecord = resourceIndexService.getTextureRecord(texture);
|
|
210
|
+
const stillConsumesTexture = currentRecord?.consumers.some((candidate) => candidate.material === material);
|
|
211
|
+
const currentMaterialRecord = stillConsumesTexture && GetMaterialRecord(resourceIndexService, material);
|
|
212
|
+
if (!resourceIndexService.isDisposed && currentMaterialRecord) {
|
|
213
|
+
selectionService.selectedEntity = material;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
: undefined, "aria-label": materialRecord ? `Open material ${value}, slots ${slotNames}` : undefined }, `consumer-${index}`));
|
|
217
|
+
})] }));
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export { TextureMetadataProperties };
|
|
221
|
+
//# sourceMappingURL=textureMetadataProperties-BdNmp0Pk.js.map
|