door_models 5.2.3 → 5.2.4
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/index.cjs.js +26 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +26 -14
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1985,7 +1985,8 @@ function DoorLeaf(_ref8) {
|
|
|
1985
1985
|
testBackDoorPlaneMaterial,
|
|
1986
1986
|
glassDepth,
|
|
1987
1987
|
cpid,
|
|
1988
|
-
handleParseCpid
|
|
1988
|
+
handleParseCpid,
|
|
1989
|
+
materials
|
|
1989
1990
|
} = useConfigurator();
|
|
1990
1991
|
|
|
1991
1992
|
// here i get material names from context
|
|
@@ -2024,15 +2025,24 @@ function DoorLeaf(_ref8) {
|
|
|
2024
2025
|
} = backDoorPlane;
|
|
2025
2026
|
|
|
2026
2027
|
// --- Material Logic ---
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2028
|
+
const pers = React.useMemo(() => {
|
|
2029
|
+
const dynamicMaterials = {};
|
|
2030
|
+
for (const key in materials) {
|
|
2031
|
+
if (Object.prototype.hasOwnProperty.call(materials, key)) {
|
|
2032
|
+
const value = materials[key];
|
|
2033
|
+
dynamicMaterials[key] = createMaterialFromProp(value);
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
return dynamicMaterials;
|
|
2037
|
+
}, [materials]);
|
|
2038
|
+
// --- Material Logic ---
|
|
2039
|
+
const doorMaterial = React.useMemo(() => pers.D_SRF_DECOR_2 || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
|
|
2040
|
+
const frameMaterial = React.useMemo(() => pers.D_PRF_COLOR || pers.D_FR_SRF_DECOR || pers.D_FR_SRF_DECOR_S2 || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
|
|
2041
|
+
const gasketMaterial = React.useMemo(() => pers.D_GASKET || availableMaterials.black, [testGasketMaterial, gasketMaterialName]);
|
|
2032
2042
|
React.useMemo(() => {
|
|
2033
|
-
return frameMaterial;
|
|
2043
|
+
return pers.D_PRF_COLOR || pers.D_FR_SRF_DECOR || pers.D_FR_SRF_DECOR_S2 || frameMaterial;
|
|
2034
2044
|
}, [testDoorStopMaterial, doorStopMaterialName, frameType, frameMaterial]);
|
|
2035
|
-
React.useMemo(() => placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
|
|
2045
|
+
React.useMemo(() => pers.D_SRF_DECOR_2 || placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
|
|
2036
2046
|
React.useMemo(() => placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
|
|
2037
2047
|
const occulusInfillMaterial = React.useMemo(() => placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
|
|
2038
2048
|
const glassInfillMaterial = React.useMemo(() => placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
|
|
@@ -2043,8 +2053,8 @@ function DoorLeaf(_ref8) {
|
|
|
2043
2053
|
}), [testHingeMaterial, hingeMaterialName]);
|
|
2044
2054
|
React.useMemo(() => placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
|
|
2045
2055
|
React.useMemo(() => placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
|
|
2046
|
-
|
|
2047
|
-
|
|
2056
|
+
React.useMemo(() => placeholderMaterial, [testFrontDoorPlaneMaterial, frontDoorPlaneMaterialName]);
|
|
2057
|
+
React.useMemo(() => placeholderMaterial, [testBackDoorPlaneMaterial, backDoorPlaneMaterialName]);
|
|
2048
2058
|
const hingeAccentMaterial = React.useMemo(() => new THREE__namespace.MeshStandardMaterial({
|
|
2049
2059
|
color: "#1a1a1a",
|
|
2050
2060
|
roughness: 0.1
|
|
@@ -2232,7 +2242,8 @@ function DoorLeaf(_ref8) {
|
|
|
2232
2242
|
|
|
2233
2243
|
// --- DYNAMIC TEXTURE MATERIALS ---
|
|
2234
2244
|
const dynamicFrontDoorPlaneMaterial = React.useMemo(() => {
|
|
2235
|
-
const
|
|
2245
|
+
const sourceMaterial = pers.D_SRF_DECOR_2 || placeholderMaterial;
|
|
2246
|
+
const newMaterial = sourceMaterial.clone();
|
|
2236
2247
|
if (newMaterial.map) {
|
|
2237
2248
|
newMaterial.map = newMaterial.map.clone();
|
|
2238
2249
|
newMaterial.map.needsUpdate = true;
|
|
@@ -2246,9 +2257,10 @@ function DoorLeaf(_ref8) {
|
|
|
2246
2257
|
console.log(repeatX, repeatY);
|
|
2247
2258
|
}
|
|
2248
2259
|
return newMaterial;
|
|
2249
|
-
}, [
|
|
2260
|
+
}, [pers.D_SRF_DECOR_2, mainDoorHeightM, doorWidthM]);
|
|
2250
2261
|
const dynamicBackDoorPlaneMaterial = React.useMemo(() => {
|
|
2251
|
-
const
|
|
2262
|
+
const sourceMaterial = pers.D_SRF_DECOR || placeholderMaterial;
|
|
2263
|
+
const newMaterial = sourceMaterial.clone();
|
|
2252
2264
|
if (newMaterial.map) {
|
|
2253
2265
|
newMaterial.map = newMaterial.map.clone();
|
|
2254
2266
|
newMaterial.map.needsUpdate = true;
|
|
@@ -2261,7 +2273,7 @@ function DoorLeaf(_ref8) {
|
|
|
2261
2273
|
newMaterial.map.repeat.set(repeatX, repeatY * 2);
|
|
2262
2274
|
}
|
|
2263
2275
|
return newMaterial;
|
|
2264
|
-
}, [
|
|
2276
|
+
}, [pers.D_SRF_DECOR, mainDoorHeightM, doorWidthM]);
|
|
2265
2277
|
return /*#__PURE__*/jsxRuntime.jsxs("group", {
|
|
2266
2278
|
"position-x": xOffset,
|
|
2267
2279
|
children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxRuntime.jsxs("group", {
|