@combeenation/3d-viewer 12.0.0-alpha2 → 12.0.0-alpha3
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/lib-cjs/api/manager/gltfExportManager.d.ts +1 -1
- package/dist/lib-cjs/api/manager/gltfExportManager.js +5 -5
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/buildinfo.json +1 -1
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/api/manager/gltfExportManager.ts +9 -7
package/package.json
CHANGED
|
@@ -59,6 +59,8 @@ export class GltfExportManager {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
protected async _exportPreProcess(excluded?: ExcludedGeometryList): Promise<void> {
|
|
62
|
+
this.viewer.pauseRendering();
|
|
63
|
+
|
|
62
64
|
// handle materials
|
|
63
65
|
this.viewer.scene.materials
|
|
64
66
|
.filter(material => this._shouldReplaceMaterial(material))
|
|
@@ -75,7 +77,7 @@ export class GltfExportManager {
|
|
|
75
77
|
|
|
76
78
|
// reset transformation of all "TransformNodes", which couldn't be handled by the geometry baking algorithm
|
|
77
79
|
// it's important that this is done AFTER all geometries have been baked
|
|
78
|
-
this.viewer.scene.transformNodes
|
|
80
|
+
[...this.viewer.scene.transformNodes, ...this.viewer.scene.meshes]
|
|
79
81
|
.filter(node => !!node.metadata?.[GltfExportManager._METADATA_PROPS.exportNode])
|
|
80
82
|
.forEach(node => resetTransformation(node as TransformNode));
|
|
81
83
|
}
|
|
@@ -89,6 +91,8 @@ export class GltfExportManager {
|
|
|
89
91
|
this.viewer.scene.materials
|
|
90
92
|
.filter(mat => !!mat.metadata?.[GltfExportManager._METADATA_PROPS.deleteAfterExport])
|
|
91
93
|
.forEach(material => material.dispose(false, false));
|
|
94
|
+
|
|
95
|
+
this.viewer.resumeRendering();
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
protected _gltfExportOptions(): IExportOptions {
|
|
@@ -176,12 +180,12 @@ export class GltfExportManager {
|
|
|
176
180
|
/**
|
|
177
181
|
* Create an export-friendly replacement material for a material using refraction.
|
|
178
182
|
*/
|
|
179
|
-
protected _createRefractionMaterialReplacement(material: PBRMaterial)
|
|
183
|
+
protected _createRefractionMaterialReplacement(material: PBRMaterial) {
|
|
180
184
|
const newName = `${material.name}_clone`;
|
|
181
|
-
|
|
182
|
-
const clonedMaterial = material.clone(newName);
|
|
185
|
+
|
|
186
|
+
const clonedMaterial = material.clone(newName);
|
|
183
187
|
clonedMaterial.refractionTexture = null;
|
|
184
|
-
clonedMaterial.metallicReflectanceTexture = null;
|
|
188
|
+
clonedMaterial.metallicReflectanceTexture = null;
|
|
185
189
|
clonedMaterial.alpha = 0.7;
|
|
186
190
|
clonedMaterial.albedoColor = new Color3(0.3, 0.3, 0.3);
|
|
187
191
|
clonedMaterial.transparencyMode = PBRMaterial.PBRMATERIAL_ALPHABLEND;
|
|
@@ -190,7 +194,5 @@ export class GltfExportManager {
|
|
|
190
194
|
|
|
191
195
|
injectMetadata(material, { [GltfExportManager._METADATA_PROPS.exchangeMaterialWith]: newName });
|
|
192
196
|
injectMetadata(clonedMaterial, { [GltfExportManager._METADATA_PROPS.deleteAfterExport]: true });
|
|
193
|
-
|
|
194
|
-
return clonedMaterial;
|
|
195
197
|
}
|
|
196
198
|
}
|