@combeenation/3d-viewer 18.2.0 → 18.3.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/dist/lib-cjs/buildinfo.json +1 -1
- package/dist/lib-cjs/commonjs.tsconfig.tsbuildinfo +1 -1
- package/dist/lib-cjs/index.d.ts +1 -0
- package/dist/lib-cjs/index.js +1 -0
- package/dist/lib-cjs/index.js.map +1 -1
- package/dist/lib-cjs/internal/export-helper.d.ts +34 -0
- package/dist/lib-cjs/internal/export-helper.js +306 -0
- package/dist/lib-cjs/internal/export-helper.js.map +1 -0
- package/dist/lib-cjs/internal/node-helper.js +2 -2
- package/dist/lib-cjs/internal/node-helper.js.map +1 -1
- package/dist/lib-cjs/manager/camera-manager.js +2 -6
- package/dist/lib-cjs/manager/camera-manager.js.map +1 -1
- package/dist/lib-cjs/manager/dxf-export-manager.d.ts +39 -0
- package/dist/lib-cjs/manager/dxf-export-manager.js +116 -0
- package/dist/lib-cjs/manager/dxf-export-manager.js.map +1 -0
- package/dist/lib-cjs/manager/gltf-export-manager.d.ts +19 -39
- package/dist/lib-cjs/manager/gltf-export-manager.js +38 -179
- package/dist/lib-cjs/manager/gltf-export-manager.js.map +1 -1
- package/dist/lib-cjs/viewer.d.ts +3 -1
- package/dist/lib-cjs/viewer.js +4 -0
- package/dist/lib-cjs/viewer.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/internal/export-helper.ts +378 -0
- package/src/internal/node-helper.ts +2 -2
- package/src/manager/camera-manager.ts +2 -6
- package/src/manager/dxf-export-manager.ts +123 -0
- package/src/manager/gltf-export-manager.ts +38 -231
- package/src/viewer.ts +6 -0
- package/dist/lib-cjs/internal/geometry-helper.d.ts +0 -14
- package/dist/lib-cjs/internal/geometry-helper.js +0 -114
- package/dist/lib-cjs/internal/geometry-helper.js.map +0 -1
- package/src/internal/geometry-helper.ts +0 -144
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;aACtF;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AApGD,4CAoGC"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import { IExportOptions,
|
|
1
|
+
import { IExportOptions, NodeDescription, Viewer } from '../index';
|
|
2
|
+
/**
|
|
3
|
+
* Interface TODOS
|
|
4
|
+
* ===============
|
|
5
|
+
* - create settings object instead of individual input parameters (optimizeForAR, excludeNodes, fileName)
|
|
6
|
+
* - see `DxfExportManager`
|
|
7
|
+
* - much more flexible when adding new parameters
|
|
8
|
+
* - rename functions to create/download, instead of suffixing "ToFile"
|
|
9
|
+
* - also see `DxfExportManager`
|
|
10
|
+
*
|
|
11
|
+
* Viewer control is directly accessing these functions, so introducing breaking changes here is really annoying, as we
|
|
12
|
+
* have to add another version switch in the source code of the viewer control.
|
|
13
|
+
* Maybe there is a chance to update the interface when re-creating the viewer control in the new cfgr editor.
|
|
14
|
+
*/
|
|
2
15
|
/**
|
|
3
16
|
* Manager for gltf export and augmented reality features
|
|
4
17
|
*/
|
|
@@ -12,31 +25,16 @@ export declare class GltfExportManager {
|
|
|
12
25
|
* We could theoretically allow it if AR optimization is not desired, but this may confuse the user.
|
|
13
26
|
*/
|
|
14
27
|
protected static _gltfExportOptions(optimizeForAR: boolean, excludeNodes?: NodeDescription[]): IExportOptions;
|
|
15
|
-
/**
|
|
16
|
-
* Checks if a node should be available in the export
|
|
17
|
-
*/
|
|
18
|
-
protected static _shouldExportNode(node: Node, excludeNodes?: NodeDescription[]): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Creates a clone of the material which should be used for the export.
|
|
21
|
-
* This is mostly required for recreating textures with lower sizes.
|
|
22
|
-
* CAUTION: Material exchanging is not supported for materials that contain certain texture types:
|
|
23
|
-
* - Dynamic textures (Paintables): Cloning dynamic textures doesn't clone the canvas context
|
|
24
|
-
* => so the clone is just empty
|
|
25
|
-
* - Render target textures: Disposing the clone will leave the scene in a "not ready" state
|
|
26
|
-
* => this scenario is not fully analyzed yet, but it's not really worth the effort right now, since this kind of
|
|
27
|
-
* of texture is not really used ATM
|
|
28
|
-
*/
|
|
29
|
-
protected static _exchangeMaterial(material: Material): void;
|
|
30
28
|
/** @internal */
|
|
31
29
|
constructor(viewer: Viewer);
|
|
32
30
|
/**
|
|
33
31
|
* Exports selected nodes to a file.
|
|
34
|
-
* @param
|
|
32
|
+
* @param fileName Optional name of the exported .GLB file.
|
|
35
33
|
* @param optimizeForAR Adjusts the exported GLB so that known issues get automatically fixed, this
|
|
36
34
|
* is mostly targeting Apples .usdz format.
|
|
37
35
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
38
36
|
*/
|
|
39
|
-
exportGlb(
|
|
37
|
+
exportGlb(fileName?: string, optimizeForAR?: boolean, excludeNodes?: NodeDescription[]): Promise<File | undefined>;
|
|
40
38
|
/**
|
|
41
39
|
* Exports selected nodes to GLTF. This may result in more than one file, since textures are exported seperately.
|
|
42
40
|
* @param filename Name of the main (text-based) .GLTF file referring to separate texture files.
|
|
@@ -44,31 +42,13 @@ export declare class GltfExportManager {
|
|
|
44
42
|
* is mostly targeting Apples .usdz format.
|
|
45
43
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
46
44
|
*/
|
|
47
|
-
exportGltfToFile(
|
|
45
|
+
exportGltfToFile(fileName: string, optimizeForAR?: boolean, excludeNodes?: NodeDescription[]): Promise<void>;
|
|
48
46
|
/**
|
|
49
47
|
* Exports selected nodes to GLB. This results in one binary file.
|
|
50
|
-
* @param
|
|
48
|
+
* @param fileName Name of the main (text-based) .GLTF file referring to seperate texture files.
|
|
51
49
|
* @param optimizeForAR Adjusts the exported GLB so that known issues get automatically fixed, this
|
|
52
50
|
* is mostly targeting Apples .usdz format.
|
|
53
51
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
54
52
|
*/
|
|
55
|
-
exportGlbToFile(
|
|
56
|
-
/**
|
|
57
|
-
* Prepares scene for GLB export.
|
|
58
|
-
* This is very important for AR exports, since we have to do a lot of conversions to satisfy Apples .usdz format.
|
|
59
|
-
*/
|
|
60
|
-
protected _exportPreProcess(optimizeForAR: boolean, excludeNodes?: NodeDescription[]): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Cleans up scene after export
|
|
63
|
-
*/
|
|
64
|
-
protected _exportPostProcess(optimizeForAR: boolean): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Creates a clone of the node which should be used for the export.
|
|
67
|
-
* Also switches to the cloned material if required.
|
|
68
|
-
*/
|
|
69
|
-
protected _prepareNodeForExport(node: Node, clonedParent: TransformNode | null, excludeNodes?: NodeDescription[]): void;
|
|
70
|
-
/**
|
|
71
|
-
* Help function for receiving all nodes that are marked for the export
|
|
72
|
-
*/
|
|
73
|
-
protected _getNodesMarkedForExport(meshesOnly?: boolean): TransformNode[];
|
|
53
|
+
exportGlbToFile(fileName: string, optimizeForAR?: boolean, excludeNodes?: NodeDescription[]): Promise<void>;
|
|
74
54
|
}
|
|
@@ -11,10 +11,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GltfExportManager = void 0;
|
|
13
13
|
const index_1 = require("../index");
|
|
14
|
-
const
|
|
15
|
-
const geometry_helper_1 = require("../internal/geometry-helper");
|
|
14
|
+
const export_helper_1 = require("../internal/export-helper");
|
|
16
15
|
const metadata_helper_1 = require("../internal/metadata-helper");
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Interface TODOS
|
|
18
|
+
* ===============
|
|
19
|
+
* - create settings object instead of individual input parameters (optimizeForAR, excludeNodes, fileName)
|
|
20
|
+
* - see `DxfExportManager`
|
|
21
|
+
* - much more flexible when adding new parameters
|
|
22
|
+
* - rename functions to create/download, instead of suffixing "ToFile"
|
|
23
|
+
* - also see `DxfExportManager`
|
|
24
|
+
*
|
|
25
|
+
* Viewer control is directly accessing these functions, so introducing breaking changes here is really annoying, as we
|
|
26
|
+
* have to add another version switch in the source code of the viewer control.
|
|
27
|
+
* Maybe there is a chance to update the interface when re-creating the viewer control in the new cfgr editor.
|
|
28
|
+
*/
|
|
18
29
|
/**
|
|
19
30
|
* Manager for gltf export and augmented reality features
|
|
20
31
|
*/
|
|
@@ -40,79 +51,31 @@ class GltfExportManager {
|
|
|
40
51
|
}
|
|
41
52
|
else {
|
|
42
53
|
// use the default export node check (enabled state, exclusion list, etc...)
|
|
43
|
-
return
|
|
54
|
+
return (0, export_helper_1.isExportableTransformNode)(node, excludeNodes);
|
|
44
55
|
}
|
|
45
56
|
},
|
|
46
57
|
shouldExportAnimation: (animation) => !optimizeForAR,
|
|
47
58
|
};
|
|
48
59
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Checks if a node should be available in the export
|
|
51
|
-
*/
|
|
52
|
-
static _shouldExportNode(node, excludeNodes) {
|
|
53
|
-
if (!(node instanceof index_1.TransformNode)) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
// maybe add some other criterias like "hasInfiniteDistance" and "isGeneratedBackgroundMesh" here as well
|
|
57
|
-
const isExcluded = (0, node_helper_1.nodeMatchesAnyCriteria)(node, {
|
|
58
|
-
isInList: excludeNodes,
|
|
59
|
-
isDisabled: true,
|
|
60
|
-
isHtmlAnchorMesh: true,
|
|
61
|
-
});
|
|
62
|
-
return !isExcluded;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Creates a clone of the material which should be used for the export.
|
|
66
|
-
* This is mostly required for recreating textures with lower sizes.
|
|
67
|
-
* CAUTION: Material exchanging is not supported for materials that contain certain texture types:
|
|
68
|
-
* - Dynamic textures (Paintables): Cloning dynamic textures doesn't clone the canvas context
|
|
69
|
-
* => so the clone is just empty
|
|
70
|
-
* - Render target textures: Disposing the clone will leave the scene in a "not ready" state
|
|
71
|
-
* => this scenario is not fully analyzed yet, but it's not really worth the effort right now, since this kind of
|
|
72
|
-
* of texture is not really used ATM
|
|
73
|
-
*/
|
|
74
|
-
static _exchangeMaterial(material) {
|
|
75
|
-
const baseTextures = material.getActiveTextures();
|
|
76
|
-
const hasDynamicTextures = baseTextures.some(texture => texture instanceof index_1.DynamicTexture);
|
|
77
|
-
const hasRenderTargetTextures = baseTextures.some(texture => texture instanceof index_1.RenderTargetTexture);
|
|
78
|
-
if (hasDynamicTextures || hasRenderTargetTextures) {
|
|
79
|
-
const textureTypesString = [
|
|
80
|
-
hasDynamicTextures ? 'Dynamic Textures' : '',
|
|
81
|
-
hasRenderTargetTextures ? 'Render Target Textures' : '',
|
|
82
|
-
]
|
|
83
|
-
.filter(Boolean)
|
|
84
|
-
.join();
|
|
85
|
-
console.warn(`Couldn't exchange material "${material.name}" in GLB export, as it contains unsupported texture type(s) (${textureTypesString}). The export will still work, but the textures of this material will keep their original size.`);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const newName = `${material.name}_clone`;
|
|
89
|
-
const clonedMaterial = material.clone(newName);
|
|
90
|
-
(0, metadata_helper_1.cloneInternalMetadata)(material, clonedMaterial);
|
|
91
|
-
const clonedTextures = clonedMaterial.getActiveTextures();
|
|
92
|
-
// mark all exported textures, so that they will be deleted after the export
|
|
93
|
-
clonedTextures.forEach(texture => (0, metadata_helper_1.setInternalMetadataValue)(texture, 'deleteAfterExport', true));
|
|
94
|
-
(0, metadata_helper_1.setInternalMetadataValue)(material, 'exchangeMaterialWith', clonedMaterial.uniqueId);
|
|
95
|
-
(0, metadata_helper_1.setInternalMetadataValue)(clonedMaterial, 'deleteAfterExport', true);
|
|
96
|
-
}
|
|
97
60
|
/**
|
|
98
61
|
* Exports selected nodes to a file.
|
|
99
|
-
* @param
|
|
62
|
+
* @param fileName Optional name of the exported .GLB file.
|
|
100
63
|
* @param optimizeForAR Adjusts the exported GLB so that known issues get automatically fixed, this
|
|
101
64
|
* is mostly targeting Apples .usdz format.
|
|
102
65
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
103
66
|
*/
|
|
104
|
-
exportGlb(
|
|
67
|
+
exportGlb(fileName, optimizeForAR = false, excludeNodes) {
|
|
105
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
|
|
69
|
+
if (optimizeForAR)
|
|
70
|
+
yield (0, export_helper_1.exportPreProcess)(this.viewer, { excludeNodes, scaleDownTextures: true });
|
|
107
71
|
const glbData = yield index_1.GLTF2Export.GLBAsync(this.viewer.scene, 'dummy', GltfExportManager._gltfExportOptions(optimizeForAR, excludeNodes));
|
|
108
|
-
|
|
72
|
+
if (optimizeForAR)
|
|
73
|
+
yield (0, export_helper_1.exportPostProcess)(this.viewer);
|
|
109
74
|
const resBlob = glbData.glTFFiles['dummy.glb'];
|
|
110
75
|
// check if result is valid, according to the typings this could also be a string
|
|
111
76
|
if (resBlob instanceof Blob) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
return new File([resBlob], filename);
|
|
77
|
+
const normalizedFileName = (0, export_helper_1.normalizeFileName)(fileName, 'glb', 'glb-export');
|
|
78
|
+
return new File([resBlob], normalizedFileName);
|
|
116
79
|
}
|
|
117
80
|
else {
|
|
118
81
|
// result was not a valid blob
|
|
@@ -127,139 +90,35 @@ class GltfExportManager {
|
|
|
127
90
|
* is mostly targeting Apples .usdz format.
|
|
128
91
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
129
92
|
*/
|
|
130
|
-
exportGltfToFile(
|
|
93
|
+
exportGltfToFile(fileName, optimizeForAR = false, excludeNodes) {
|
|
131
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
|
|
133
|
-
|
|
95
|
+
if (optimizeForAR)
|
|
96
|
+
yield (0, export_helper_1.exportPreProcess)(this.viewer, { excludeNodes, scaleDownTextures: true });
|
|
97
|
+
const gltf = yield index_1.GLTF2Export.GLTFAsync(this.viewer.scene,
|
|
98
|
+
// no need to add .glb, as Babylon.js does that internally
|
|
99
|
+
fileName, GltfExportManager._gltfExportOptions(optimizeForAR, excludeNodes));
|
|
134
100
|
gltf.downloadFiles();
|
|
135
|
-
|
|
101
|
+
if (optimizeForAR)
|
|
102
|
+
yield (0, export_helper_1.exportPostProcess)(this.viewer);
|
|
136
103
|
});
|
|
137
104
|
}
|
|
138
105
|
/**
|
|
139
106
|
* Exports selected nodes to GLB. This results in one binary file.
|
|
140
|
-
* @param
|
|
107
|
+
* @param fileName Name of the main (text-based) .GLTF file referring to seperate texture files.
|
|
141
108
|
* @param optimizeForAR Adjusts the exported GLB so that known issues get automatically fixed, this
|
|
142
109
|
* is mostly targeting Apples .usdz format.
|
|
143
110
|
* @param excludeNodes Optional list of nodes to be excluded from the export.
|
|
144
111
|
*/
|
|
145
|
-
exportGlbToFile(
|
|
112
|
+
exportGlbToFile(fileName, optimizeForAR = false, excludeNodes) {
|
|
146
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
|
|
148
|
-
|
|
114
|
+
if (optimizeForAR)
|
|
115
|
+
yield (0, export_helper_1.exportPreProcess)(this.viewer, { excludeNodes, scaleDownTextures: true });
|
|
116
|
+
const glb = yield index_1.GLTF2Export.GLBAsync(this.viewer.scene, fileName, GltfExportManager._gltfExportOptions(optimizeForAR, excludeNodes));
|
|
149
117
|
glb.downloadFiles();
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Prepares scene for GLB export.
|
|
155
|
-
* This is very important for AR exports, since we have to do a lot of conversions to satisfy Apples .usdz format.
|
|
156
|
-
*/
|
|
157
|
-
_exportPreProcess(optimizeForAR, excludeNodes) {
|
|
158
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
-
if (!optimizeForAR) {
|
|
160
|
-
// actually nothing to do if AR optimization is not required
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
// pause rendering, since we are altering the active scene, which should not be visible to the user
|
|
164
|
-
this.viewer.pauseRendering();
|
|
165
|
-
// exchange materials if required
|
|
166
|
-
// the AR export should never contain textures larger than 1024 px:
|
|
167
|
-
// - iOS devices will crash most likely when trying to access AR endpoints with such files
|
|
168
|
-
// - file size will be reduced, which leads to faster loading times
|
|
169
|
-
// - textures > 1024 px shouldn't make a difference on mobiles anyway
|
|
170
|
-
// we don't have to rescale anything if are already on a downscaled device, since the textures are already <= 1024
|
|
171
|
-
// also we have to be very cautios with copying textures on these devices, since we are potentially very limited
|
|
172
|
-
// with the available memory
|
|
173
|
-
const isScaledDownDevice = (0, device_helper_1.getIsScaledDownDevice)(this.viewer.viewerSettings.limitTextureSize);
|
|
174
|
-
if (!isScaledDownDevice) {
|
|
175
|
-
// the idea is to re-create all textures with a smaller texture size
|
|
176
|
-
// we have to exchange all materials for this to work
|
|
177
|
-
this.viewer.engine.clearInternalTexturesCache();
|
|
178
|
-
this.viewer.engine.getCaps().maxTextureSize = 1024;
|
|
179
|
-
this.viewer.scene.materials
|
|
180
|
-
.filter(material => material instanceof index_1.PBRMaterial)
|
|
181
|
-
.forEach(material => GltfExportManager._exchangeMaterial(material));
|
|
182
|
-
}
|
|
183
|
-
// create clones of each node (recursively), optionally exchange with cloned materials and mark these nodes for the
|
|
184
|
-
// export
|
|
185
|
-
this.viewer.scene.rootNodes
|
|
186
|
-
// .filter(rootNode => rootNode.name !== GltfExportManager._EXPORT_ROOT_NAME)
|
|
187
|
-
.forEach(rootNode => this._prepareNodeForExport(rootNode, null, excludeNodes));
|
|
188
|
-
// bake transformation of all meshes, so that no negative scalings are left
|
|
189
|
-
// it's important that this is done AFTER instanced meshes have been converted (_prepareNodeForExport)
|
|
190
|
-
this._getNodesMarkedForExport(true).forEach(mesh => (0, geometry_helper_1.bakeGeometryOfMesh)(mesh));
|
|
191
|
-
// reset transformation of all "TransformNodes", which couldn't be handled by the geometry baking algorithm
|
|
192
|
-
// it's important that this is done AFTER all geometries have been baked
|
|
193
|
-
this._getNodesMarkedForExport().forEach(node => (0, geometry_helper_1.resetTransformation)(node));
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Cleans up scene after export
|
|
198
|
-
*/
|
|
199
|
-
_exportPostProcess(optimizeForAR) {
|
|
200
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
-
if (!optimizeForAR) {
|
|
202
|
-
// nothing to do, since no changes have been made without AR optimizations
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
// dispose all nodes, materials and textures that have only been created for the export
|
|
206
|
-
this.viewer.scene.rootNodes
|
|
207
|
-
.filter(rootNode => (0, metadata_helper_1.getInternalMetadataValue)(rootNode, 'deleteAfterExport'))
|
|
208
|
-
.forEach(rootNode => rootNode.dispose());
|
|
209
|
-
this.viewer.scene.materials
|
|
210
|
-
.filter(material => (0, metadata_helper_1.getInternalMetadataValue)(material, 'deleteAfterExport'))
|
|
211
|
-
.forEach(material => material.dispose(false, false));
|
|
212
|
-
// clean up temporary material exchange key for the rest of materials
|
|
213
|
-
this.viewer.scene.materials.forEach(material => (0, metadata_helper_1.clearInternalMetadataValue)(material, 'exchangeMaterialWith'));
|
|
214
|
-
this.viewer.scene.textures
|
|
215
|
-
.filter(texture => (0, metadata_helper_1.getInternalMetadataValue)(texture, 'deleteAfterExport'))
|
|
216
|
-
.forEach(texture => texture.dispose());
|
|
217
|
-
// reset engines max texture size and resume rendering
|
|
218
|
-
this.viewer.engine.getCaps().maxTextureSize = this._maxTextureSize;
|
|
219
|
-
this.viewer.resumeRendering();
|
|
118
|
+
if (optimizeForAR)
|
|
119
|
+
yield (0, export_helper_1.exportPostProcess)(this.viewer);
|
|
220
120
|
});
|
|
221
121
|
}
|
|
222
|
-
/**
|
|
223
|
-
* Creates a clone of the node which should be used for the export.
|
|
224
|
-
* Also switches to the cloned material if required.
|
|
225
|
-
*/
|
|
226
|
-
_prepareNodeForExport(node, clonedParent, excludeNodes) {
|
|
227
|
-
if (!GltfExportManager._shouldExportNode(node, excludeNodes)) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
// from here on we only have TransformNodes
|
|
231
|
-
const transformNode = node;
|
|
232
|
-
// clone original node and create unique name (via uniqueId) for the export
|
|
233
|
-
const clonedNodeName = `${transformNode.name}_${transformNode.uniqueId}`;
|
|
234
|
-
const clonedNode = transformNode instanceof index_1.InstancedMesh
|
|
235
|
-
? (0, geometry_helper_1.createMeshFromInstancedMesh)(transformNode, clonedNodeName, clonedParent)
|
|
236
|
-
: transformNode.clone(clonedNodeName, clonedParent, true);
|
|
237
|
-
(0, metadata_helper_1.cloneInternalMetadata)(transformNode, clonedNode);
|
|
238
|
-
// exchange material
|
|
239
|
-
if (clonedNode instanceof index_1.Mesh) {
|
|
240
|
-
const exchangeWithMaterial = clonedNode.material && (0, metadata_helper_1.getInternalMetadataValue)(clonedNode.material, 'exchangeMaterialWith');
|
|
241
|
-
if (exchangeWithMaterial) {
|
|
242
|
-
clonedNode.material = this.viewer.scene.getMaterialByUniqueID(exchangeWithMaterial);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
// signalize that this is a cloned node
|
|
246
|
-
(0, metadata_helper_1.setInternalMetadataValue)(clonedNode, 'exportNode', true);
|
|
247
|
-
(0, metadata_helper_1.setInternalMetadataValue)(clonedNode, 'deleteAfterExport', true);
|
|
248
|
-
// handle children
|
|
249
|
-
const childs = transformNode.getChildTransformNodes(true);
|
|
250
|
-
childs.forEach(child => this._prepareNodeForExport(child, clonedNode, excludeNodes));
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Help function for receiving all nodes that are marked for the export
|
|
254
|
-
*/
|
|
255
|
-
_getNodesMarkedForExport(meshesOnly) {
|
|
256
|
-
const nodes = [...this.viewer.scene.meshes];
|
|
257
|
-
if (!meshesOnly) {
|
|
258
|
-
nodes.push(...this.viewer.scene.transformNodes);
|
|
259
|
-
}
|
|
260
|
-
const filteredNodes = nodes.filter(node => (0, metadata_helper_1.getInternalMetadataValue)(node, 'exportNode'));
|
|
261
|
-
return filteredNodes;
|
|
262
|
-
}
|
|
263
122
|
}
|
|
264
123
|
exports.GltfExportManager = GltfExportManager;
|
|
265
124
|
//# sourceMappingURL=gltf-export-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-export-manager.js","sourceRoot":"","sources":["../../../src/manager/gltf-export-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"gltf-export-manager.js","sourceRoot":"","sources":["../../../src/manager/gltf-export-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAiG;AACjG,6DAKmC;AACnC,iEAAuE;AAEvE;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAa,iBAAiB;IAyB5B,gBAAgB;IAChB,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,mFAAmF;QACnF,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC;IAChE,CAAC;IA1BD;;;;;OAKG;IACO,MAAM,CAAC,kBAAkB,CAAC,aAAsB,EAAE,YAAgC;QAC1F,OAAO;YACL,gBAAgB,EAAE,UAAU,IAAU;gBACpC,IAAI,aAAa,EAAE;oBACjB,kEAAkE;oBAClE,OAAO,CAAC,CAAC,IAAA,0CAAwB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;iBACvD;qBAAM;oBACL,4EAA4E;oBAC5E,OAAO,IAAA,yCAAyB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;iBACtD;YACH,CAAC;YAED,qBAAqB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,aAAa;SAChE,CAAC;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AAC;YACF,IAAI,CAAC,aAAa,EAAE,CAAC;YAErB,IAAI,aAAa;gBAAE,MAAM,IAAA,iCAAiB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;KAAA;IAED;;;;;;OAMG;IACU,eAAe,CAC1B,QAAgB,EAChB,gBAAyB,KAAK,EAC9B,YAAgC;;YAEhC,IAAI,aAAa;gBAAE,MAAM,IAAA,gCAAgB,EAAC,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;YAElG,MAAM,GAAG,GAAG,MAAM,mBAAW,CAAC,QAAQ,CACpC,IAAI,CAAC,MAAM,CAAC,KAAK,EACjB,QAAQ,EACR,iBAAiB,CAAC,kBAAkB,CAAC,aAAa,EAAE,YAAY,CAAC,CAClE,CAAC;YACF,GAAG,CAAC,aAAa,EAAE,CAAC;YAEpB,IAAI,aAAa;gBAAE,MAAM,IAAA,iCAAiB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF;AAhHD,8CAgHC"}
|
package/dist/lib-cjs/viewer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Index from './index';
|
|
2
|
-
import { AbstractEngine, CameraManager, DebugManager, DefaultSceneSettings, DimensionLineManager, EngineOptions, EventManager, GltfExportManager, HtmlAnchorManager, MaterialManager, ModelManager, NodeParameterSubject, ParameterManager, Scene, SceneManager, TagParameterSubject, TextureManager, TransformNode } from './index';
|
|
2
|
+
import { AbstractEngine, CameraManager, DebugManager, DefaultSceneSettings, DimensionLineManager, DxfExportManager, EngineOptions, EventManager, GltfExportManager, HtmlAnchorManager, MaterialManager, ModelManager, NodeParameterSubject, ParameterManager, Scene, SceneManager, TagParameterSubject, TextureManager, TransformNode } from './index';
|
|
3
3
|
/**
|
|
4
4
|
* Use this type to select nodes directly or via node or tag name.\
|
|
5
5
|
* This pattern is used for excluding nodes from autofocus, GLB export, etc.
|
|
@@ -52,6 +52,7 @@ export declare class Viewer {
|
|
|
52
52
|
protected _cameraManager: CameraManager;
|
|
53
53
|
protected _debugManager: DebugManager;
|
|
54
54
|
protected _dimensionLineManager: DimensionLineManager;
|
|
55
|
+
protected _dxfExportManager: DxfExportManager;
|
|
55
56
|
protected _eventManager: EventManager;
|
|
56
57
|
protected _gltfExportManager: GltfExportManager;
|
|
57
58
|
protected _htmlAnchorManager: HtmlAnchorManager;
|
|
@@ -67,6 +68,7 @@ export declare class Viewer {
|
|
|
67
68
|
get cameraManager(): CameraManager;
|
|
68
69
|
get debugManager(): DebugManager;
|
|
69
70
|
get dimensionLineManager(): DimensionLineManager;
|
|
71
|
+
get dxfExportManager(): DxfExportManager;
|
|
70
72
|
get eventManager(): EventManager;
|
|
71
73
|
get gltfExportManager(): GltfExportManager;
|
|
72
74
|
get htmlAnchorManager(): HtmlAnchorManager;
|
package/dist/lib-cjs/viewer.js
CHANGED
|
@@ -87,6 +87,9 @@ class Viewer {
|
|
|
87
87
|
get dimensionLineManager() {
|
|
88
88
|
return this._dimensionLineManager;
|
|
89
89
|
}
|
|
90
|
+
get dxfExportManager() {
|
|
91
|
+
return this._dxfExportManager;
|
|
92
|
+
}
|
|
90
93
|
get eventManager() {
|
|
91
94
|
return this._eventManager;
|
|
92
95
|
}
|
|
@@ -178,6 +181,7 @@ class Viewer {
|
|
|
178
181
|
this._cameraManager = new index_1.CameraManager(this);
|
|
179
182
|
this._debugManager = new index_1.DebugManager(this);
|
|
180
183
|
this._dimensionLineManager = new index_1.DimensionLineManager(this);
|
|
184
|
+
this._dxfExportManager = new index_1.DxfExportManager(this);
|
|
181
185
|
this._eventManager = new index_1.EventManager(this);
|
|
182
186
|
this._gltfExportManager = new index_1.GltfExportManager(this);
|
|
183
187
|
this._htmlAnchorManager = new index_1.HtmlAnchorManager(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewer.js","sourceRoot":"","sources":["../../src/viewer.ts"],"names":[],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"description": "Combeenation 3D Viewer",
|
|
5
5
|
"homepage": "https://github.com/Combeenation/3d-viewer#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"@babylonjs/gui": "7.50.0",
|
|
54
54
|
"@babylonjs/loaders": "7.50.0",
|
|
55
55
|
"@babylonjs/serializers": "7.50.0",
|
|
56
|
+
"dxf-writer": "1.18.4",
|
|
56
57
|
"eventemitter3": "4.0.7",
|
|
57
58
|
"html2canvas": "1.4.1",
|
|
58
|
-
"is-svg": "
|
|
59
|
+
"is-svg": "5.0.0",
|
|
59
60
|
"lodash-es": "4.17.21"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -72,6 +72,7 @@ export * from './viewer-error';
|
|
|
72
72
|
export * from './manager/camera-manager';
|
|
73
73
|
export * from './manager/dimension-line-manager';
|
|
74
74
|
export * from './manager/debug-manager';
|
|
75
|
+
export * from './manager/dxf-export-manager';
|
|
75
76
|
export * from './manager/event-manager';
|
|
76
77
|
export * from './manager/gltf-export-manager';
|
|
77
78
|
export * from './manager/html-anchor-manager';
|