@combeenation/3d-viewer 5.0.1 → 5.0.3-beta2
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/README.md +111 -114
- package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-cjs/api/classes/animationInterface.js +1 -1
- package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-cjs/api/classes/dottedPath.js +187 -187
- package/dist/lib-cjs/api/classes/element.d.ts +139 -139
- package/dist/lib-cjs/api/classes/element.js +794 -794
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +14 -0
- package/dist/lib-cjs/api/classes/elementParameterizable.js +135 -0
- package/dist/lib-cjs/api/classes/elementParameterizable.js.map +1 -0
- package/dist/lib-cjs/api/classes/event.d.ts +326 -326
- package/dist/lib-cjs/api/classes/event.js +371 -371
- package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-cjs/api/classes/eventBroadcaster.js +53 -53
- package/dist/lib-cjs/api/classes/parameter.d.ts +316 -259
- package/dist/lib-cjs/api/classes/parameter.js +451 -388
- package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-cjs/api/classes/parameterObservable.js +101 -101
- package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-cjs/api/classes/parameterizable.js +149 -149
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +44 -44
- package/dist/lib-cjs/api/classes/placementAnimation.js +163 -163
- package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
- package/dist/lib-cjs/api/classes/variant.js +1154 -1154
- package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -45
- package/dist/lib-cjs/api/classes/variantInstance.js +108 -108
- package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-cjs/api/classes/variantParameterizable.js +99 -99
- package/dist/lib-cjs/api/classes/viewer.d.ts +177 -175
- package/dist/lib-cjs/api/classes/viewer.js +717 -701
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
- package/dist/lib-cjs/api/classes/viewerLight.js +392 -392
- package/dist/lib-cjs/api/internal/debugViewer.d.ts +13 -13
- package/dist/lib-cjs/api/internal/debugViewer.js +86 -86
- package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
- package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
- package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -10
- package/dist/lib-cjs/api/internal/sceneSetup.js +238 -234
- package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
- package/dist/lib-cjs/api/manager/animationManager.d.ts +29 -29
- package/dist/lib-cjs/api/manager/animationManager.js +130 -130
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +65 -65
- package/dist/lib-cjs/api/manager/gltfExportManager.js +223 -222
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.d.ts +31 -32
- package/dist/lib-cjs/api/manager/sceneManager.js +153 -132
- package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +335 -335
- package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
- package/dist/lib-cjs/api/store/specStorage.js +51 -51
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +174 -166
- package/dist/lib-cjs/api/util/babylonHelper.js +575 -497
- package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/globalTypes.d.ts +366 -356
- package/dist/lib-cjs/api/util/globalTypes.js +1 -1
- package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -53
- package/dist/lib-cjs/api/util/resourceHelper.js +257 -242
- package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/stringHelper.js +25 -25
- package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/structureHelper.js +48 -44
- package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
- package/dist/lib-cjs/buildinfo.json +3 -3
- package/dist/lib-cjs/index.d.ts +49 -49
- package/dist/lib-cjs/index.js +89 -89
- package/dist/webpack-stats.json +0 -0
- package/package.json +87 -87
- package/src/api/classes/animationInterface.ts +10 -10
- package/src/api/classes/dottedPath.ts +181 -181
- package/src/api/classes/element.ts +690 -692
- package/src/api/classes/event.ts +367 -367
- package/src/api/classes/eventBroadcaster.ts +52 -52
- package/src/api/classes/parameter.ts +474 -405
- package/src/api/classes/parameterObservable.ts +100 -100
- package/src/api/classes/parameterizable.ts +87 -87
- package/src/api/classes/placementAnimation.ts +160 -160
- package/src/api/classes/variant.ts +845 -845
- package/src/api/classes/variantInstance.ts +97 -97
- package/src/api/classes/variantParameterizable.ts +85 -85
- package/src/api/classes/viewer.ts +650 -624
- package/src/api/classes/viewerLight.ts +334 -334
- package/src/api/internal/debugViewer.ts +90 -90
- package/src/api/internal/lensRendering.ts +10 -10
- package/src/api/internal/sceneSetup.ts +204 -201
- package/src/api/manager/animationManager.ts +142 -142
- package/src/api/manager/gltfExportManager.ts +191 -191
- package/src/api/manager/sceneManager.ts +128 -102
- package/src/api/manager/variantInstanceManager.ts +265 -265
- package/src/api/store/specStorage.ts +51 -51
- package/src/api/util/babylonHelper.ts +628 -538
- package/src/api/util/globalTypes.ts +413 -402
- package/src/api/util/resourceHelper.ts +189 -173
- package/src/api/util/stringHelper.ts +23 -23
- package/src/api/util/structureHelper.ts +49 -43
- package/src/buildinfo.json +3 -3
- package/src/commonjs.tsconfig.json +10 -10
- package/src/declaration.tsconfig.json +8 -8
- package/src/dev.ts +42 -42
- package/src/es6.tsconfig.json +10 -10
- package/src/index.ts +94 -94
- package/src/pagesconfig.json +77 -73
- package/src/tsconfig.json +32 -32
- package/src/tsconfig.types.json +9 -9
- package/src/types.d.ts +3 -3
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnimationManager = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var animation_1 = require("@babylonjs/core/Animations/animation");
|
|
6
|
-
//import { CustomEase } from 'gsap/CustomEase';
|
|
7
|
-
//import { ExpoScaleEase, RoughEase, SlowMo } from 'gsap/EasePack';
|
|
8
|
-
var lodash_es_1 = require("lodash-es");
|
|
9
|
-
var placementAnimation_1 = require("../classes/placementAnimation");
|
|
10
|
-
//gsap.registerPlugin( CustomEase, ExpoScaleEase, RoughEase, SlowMo );
|
|
11
|
-
var AnimationManager = /** @class */ (function () {
|
|
12
|
-
/**
|
|
13
|
-
* Constructor.
|
|
14
|
-
*/
|
|
15
|
-
function AnimationManager(scene) {
|
|
16
|
-
this.scene = scene;
|
|
17
|
-
this.animations = [];
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Creates an {@link AnimationManager} based on given BabylonJS scene.
|
|
21
|
-
*/
|
|
22
|
-
AnimationManager.create = function (scene) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
24
|
-
return tslib_1.__generator(this, function (_b) {
|
|
25
|
-
return [2 /*return*/, new AnimationManager(scene)];
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Use viewer.moveCameraTo().
|
|
31
|
-
*/
|
|
32
|
-
AnimationManager.prototype.resetCamera = function (animate) {
|
|
33
|
-
if (animate === void 0) { animate = false; }
|
|
34
|
-
//TODO currently only works for arcrotate. are there any other cameras?
|
|
35
|
-
var activeCamera = this.scene.activeCamera;
|
|
36
|
-
if (!activeCamera) {
|
|
37
|
-
throw new Error('There is no active camera');
|
|
38
|
-
}
|
|
39
|
-
var initAlpha = activeCamera.metadata.alpha;
|
|
40
|
-
var initBeta = activeCamera.metadata.beta;
|
|
41
|
-
var initRadius = activeCamera.metadata.radius;
|
|
42
|
-
if (animate) {
|
|
43
|
-
this.animateArcRotateCamera(initAlpha, initBeta, initRadius);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
activeCamera.alpha = initAlpha;
|
|
47
|
-
activeCamera.beta = initBeta;
|
|
48
|
-
activeCamera.radius = initRadius;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated Use viewer.moveCameraTo().
|
|
53
|
-
*/
|
|
54
|
-
AnimationManager.prototype.animateArcRotateCamera = function (targetAlpha, targetBeta, targetRadius) {
|
|
55
|
-
var activeCamera = this.scene.activeCamera;
|
|
56
|
-
if (!activeCamera) {
|
|
57
|
-
throw new Error('There is no active camera');
|
|
58
|
-
}
|
|
59
|
-
var alphaAnimation = new animation_1.Animation('alphaAnimation', 'alpha', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
60
|
-
var betaAnimation = new animation_1.Animation('betaAnimation', 'beta', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
61
|
-
var radiusAnimation = new animation_1.Animation('radiusAnimation', 'radius', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
62
|
-
alphaAnimation.setKeys([
|
|
63
|
-
{
|
|
64
|
-
frame: 0,
|
|
65
|
-
value: activeCamera.alpha,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
frame: 100,
|
|
69
|
-
value: targetAlpha,
|
|
70
|
-
},
|
|
71
|
-
]);
|
|
72
|
-
betaAnimation.setKeys([
|
|
73
|
-
{
|
|
74
|
-
frame: 0,
|
|
75
|
-
value: activeCamera.beta,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
frame: 100,
|
|
79
|
-
value: targetBeta,
|
|
80
|
-
},
|
|
81
|
-
]);
|
|
82
|
-
radiusAnimation.setKeys([
|
|
83
|
-
{
|
|
84
|
-
frame: 0,
|
|
85
|
-
value: activeCamera.radius,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
frame: 100,
|
|
89
|
-
value: targetRadius,
|
|
90
|
-
},
|
|
91
|
-
]);
|
|
92
|
-
activeCamera.animations.push(alphaAnimation);
|
|
93
|
-
activeCamera.animations.push(betaAnimation);
|
|
94
|
-
activeCamera.animations.push(radiusAnimation);
|
|
95
|
-
var animation = this.scene.beginAnimation(activeCamera, 0, 100, false, 10);
|
|
96
|
-
animation.disposeOnEnd = true;
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Stops and kills all running animations.
|
|
100
|
-
*/
|
|
101
|
-
AnimationManager.prototype.killAllAnimations = function () {
|
|
102
|
-
this.animations.forEach(function (animation) { return animation.kill(); });
|
|
103
|
-
this.animations = [];
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* @see {@link PlacementAnimation.play}
|
|
107
|
-
*/
|
|
108
|
-
AnimationManager.prototype.animateToPlacement = function (mutable, placement, animation) {
|
|
109
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
110
|
-
var _animation, animationPromise;
|
|
111
|
-
var _this = this;
|
|
112
|
-
return tslib_1.__generator(this, function (_b) {
|
|
113
|
-
switch (_b.label) {
|
|
114
|
-
case 0:
|
|
115
|
-
_animation = new placementAnimation_1.PlacementAnimation(mutable, placement, animation);
|
|
116
|
-
this.animations.push(_animation);
|
|
117
|
-
animationPromise = _animation.play();
|
|
118
|
-
animationPromise.then(function (a) {
|
|
119
|
-
lodash_es_1.remove(_this.animations, function (_a) { return _a === a; });
|
|
120
|
-
a.kill();
|
|
121
|
-
});
|
|
122
|
-
return [4 /*yield*/, animationPromise];
|
|
123
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
|
-
return AnimationManager;
|
|
129
|
-
}());
|
|
130
|
-
exports.AnimationManager = AnimationManager;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimationManager = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var animation_1 = require("@babylonjs/core/Animations/animation");
|
|
6
|
+
//import { CustomEase } from 'gsap/CustomEase';
|
|
7
|
+
//import { ExpoScaleEase, RoughEase, SlowMo } from 'gsap/EasePack';
|
|
8
|
+
var lodash_es_1 = require("lodash-es");
|
|
9
|
+
var placementAnimation_1 = require("../classes/placementAnimation");
|
|
10
|
+
//gsap.registerPlugin( CustomEase, ExpoScaleEase, RoughEase, SlowMo );
|
|
11
|
+
var AnimationManager = /** @class */ (function () {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor.
|
|
14
|
+
*/
|
|
15
|
+
function AnimationManager(scene) {
|
|
16
|
+
this.scene = scene;
|
|
17
|
+
this.animations = [];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Creates an {@link AnimationManager} based on given BabylonJS scene.
|
|
21
|
+
*/
|
|
22
|
+
AnimationManager.create = function (scene) {
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
24
|
+
return tslib_1.__generator(this, function (_b) {
|
|
25
|
+
return [2 /*return*/, new AnimationManager(scene)];
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Use viewer.moveCameraTo().
|
|
31
|
+
*/
|
|
32
|
+
AnimationManager.prototype.resetCamera = function (animate) {
|
|
33
|
+
if (animate === void 0) { animate = false; }
|
|
34
|
+
//TODO currently only works for arcrotate. are there any other cameras?
|
|
35
|
+
var activeCamera = this.scene.activeCamera;
|
|
36
|
+
if (!activeCamera) {
|
|
37
|
+
throw new Error('There is no active camera');
|
|
38
|
+
}
|
|
39
|
+
var initAlpha = activeCamera.metadata.alpha;
|
|
40
|
+
var initBeta = activeCamera.metadata.beta;
|
|
41
|
+
var initRadius = activeCamera.metadata.radius;
|
|
42
|
+
if (animate) {
|
|
43
|
+
this.animateArcRotateCamera(initAlpha, initBeta, initRadius);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
activeCamera.alpha = initAlpha;
|
|
47
|
+
activeCamera.beta = initBeta;
|
|
48
|
+
activeCamera.radius = initRadius;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Use viewer.moveCameraTo().
|
|
53
|
+
*/
|
|
54
|
+
AnimationManager.prototype.animateArcRotateCamera = function (targetAlpha, targetBeta, targetRadius) {
|
|
55
|
+
var activeCamera = this.scene.activeCamera;
|
|
56
|
+
if (!activeCamera) {
|
|
57
|
+
throw new Error('There is no active camera');
|
|
58
|
+
}
|
|
59
|
+
var alphaAnimation = new animation_1.Animation('alphaAnimation', 'alpha', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
60
|
+
var betaAnimation = new animation_1.Animation('betaAnimation', 'beta', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
61
|
+
var radiusAnimation = new animation_1.Animation('radiusAnimation', 'radius', 30, animation_1.Animation.ANIMATIONTYPE_FLOAT, animation_1.Animation.ANIMATIONLOOPMODE_CONSTANT);
|
|
62
|
+
alphaAnimation.setKeys([
|
|
63
|
+
{
|
|
64
|
+
frame: 0,
|
|
65
|
+
value: activeCamera.alpha,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
frame: 100,
|
|
69
|
+
value: targetAlpha,
|
|
70
|
+
},
|
|
71
|
+
]);
|
|
72
|
+
betaAnimation.setKeys([
|
|
73
|
+
{
|
|
74
|
+
frame: 0,
|
|
75
|
+
value: activeCamera.beta,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
frame: 100,
|
|
79
|
+
value: targetBeta,
|
|
80
|
+
},
|
|
81
|
+
]);
|
|
82
|
+
radiusAnimation.setKeys([
|
|
83
|
+
{
|
|
84
|
+
frame: 0,
|
|
85
|
+
value: activeCamera.radius,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
frame: 100,
|
|
89
|
+
value: targetRadius,
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
92
|
+
activeCamera.animations.push(alphaAnimation);
|
|
93
|
+
activeCamera.animations.push(betaAnimation);
|
|
94
|
+
activeCamera.animations.push(radiusAnimation);
|
|
95
|
+
var animation = this.scene.beginAnimation(activeCamera, 0, 100, false, 10);
|
|
96
|
+
animation.disposeOnEnd = true;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Stops and kills all running animations.
|
|
100
|
+
*/
|
|
101
|
+
AnimationManager.prototype.killAllAnimations = function () {
|
|
102
|
+
this.animations.forEach(function (animation) { return animation.kill(); });
|
|
103
|
+
this.animations = [];
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* @see {@link PlacementAnimation.play}
|
|
107
|
+
*/
|
|
108
|
+
AnimationManager.prototype.animateToPlacement = function (mutable, placement, animation) {
|
|
109
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
110
|
+
var _animation, animationPromise;
|
|
111
|
+
var _this = this;
|
|
112
|
+
return tslib_1.__generator(this, function (_b) {
|
|
113
|
+
switch (_b.label) {
|
|
114
|
+
case 0:
|
|
115
|
+
_animation = new placementAnimation_1.PlacementAnimation(mutable, placement, animation);
|
|
116
|
+
this.animations.push(_animation);
|
|
117
|
+
animationPromise = _animation.play();
|
|
118
|
+
animationPromise.then(function (a) {
|
|
119
|
+
lodash_es_1.remove(_this.animations, function (_a) { return _a === a; });
|
|
120
|
+
a.kill();
|
|
121
|
+
});
|
|
122
|
+
return [4 /*yield*/, animationPromise];
|
|
123
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
return AnimationManager;
|
|
129
|
+
}());
|
|
130
|
+
exports.AnimationManager = AnimationManager;
|
|
131
131
|
//# sourceMappingURL=animationManager.js.map
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
|
|
2
|
-
import { IExportOptions } from '@babylonjs/serializers';
|
|
3
|
-
export declare class GltfExportManager {
|
|
4
|
-
protected viewer: Viewer;
|
|
5
|
-
/**
|
|
6
|
-
* Constructor.
|
|
7
|
-
*/
|
|
8
|
-
protected constructor(viewer: Viewer);
|
|
9
|
-
/**
|
|
10
|
-
* Creates an {@link GltfExportManager}.
|
|
11
|
-
*/
|
|
12
|
-
static create(viewer: Viewer): Promise<GltfExportManager>;
|
|
13
|
-
/**
|
|
14
|
-
* Exports selected nodes to a file.
|
|
15
|
-
* @param filename optional name of the exported .GLB file.
|
|
16
|
-
* @param exportOptions export options to be merged with default options.
|
|
17
|
-
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export.
|
|
18
|
-
*/
|
|
19
|
-
exportGlb(filename?: string, exportOptions?: IExportOptions, excluded?:
|
|
20
|
-
/**
|
|
21
|
-
* Exports selected nodes to GLTF. This may result in more than one file, since textures are exported separately.
|
|
22
|
-
* @param filename name of the main (text-based) .GLTF file referring to separate texture files.
|
|
23
|
-
* @param exportOptions export options to be merged with default options.
|
|
24
|
-
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export.
|
|
25
|
-
*/
|
|
26
|
-
exportGltfToFile(filename: string, exportOptions?: IExportOptions, excluded?:
|
|
27
|
-
/**
|
|
28
|
-
* Exports selected nodes to GLB. This results in one binary file.
|
|
29
|
-
* @param filename name of the .GLB file.
|
|
30
|
-
* @param exportOptions export options to be merged with default options.
|
|
31
|
-
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export
|
|
32
|
-
*/
|
|
33
|
-
exportGlbToFile(filename: string, exportOptions?: IExportOptions, excluded?:
|
|
34
|
-
/**
|
|
35
|
-
* Gets predefined {@link IExportOptions } merged with given ones.
|
|
36
|
-
*/
|
|
37
|
-
protected gltfExportOptions(mergeWithOptions?: IExportOptions, excluded?:
|
|
38
|
-
/**
|
|
39
|
-
* Stuff to be done before exporting to GLTF
|
|
40
|
-
*/
|
|
41
|
-
protected exportPreProcess(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Stuff to be done after the GLTF export
|
|
44
|
-
*/
|
|
45
|
-
protected exportPostProcess(): void;
|
|
46
|
-
/**
|
|
47
|
-
* Materials with refraction set are not exported properly.
|
|
48
|
-
* Exchange all such (relevant) materials with a more export-friendly version
|
|
49
|
-
*/
|
|
50
|
-
protected exchangeRefractionMaterials(): void;
|
|
51
|
-
/**
|
|
52
|
-
* Restore original materials with set refraction.
|
|
53
|
-
*/
|
|
54
|
-
protected restoreRefractionMaterials(): void;
|
|
55
|
-
/**
|
|
56
|
-
* Create an export-friendly replacement material for a material using refraction.
|
|
57
|
-
* @param mat Material to be replaced
|
|
58
|
-
*/
|
|
59
|
-
protected createRefractionMaterialReplacement(mat: PBRMaterial): PBRMaterial;
|
|
60
|
-
/**
|
|
61
|
-
* Inspect if a material was temporarily cloned for GLB export
|
|
62
|
-
* @param mat Material to be inspected
|
|
63
|
-
*/
|
|
64
|
-
protected isMaterialClonedForExport(mat: PBRMaterial): boolean;
|
|
65
|
-
}
|
|
1
|
+
import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
|
|
2
|
+
import { IExportOptions } from '@babylonjs/serializers/glTF/2.0';
|
|
3
|
+
export declare class GltfExportManager {
|
|
4
|
+
protected viewer: Viewer;
|
|
5
|
+
/**
|
|
6
|
+
* Constructor.
|
|
7
|
+
*/
|
|
8
|
+
protected constructor(viewer: Viewer);
|
|
9
|
+
/**
|
|
10
|
+
* Creates an {@link GltfExportManager}.
|
|
11
|
+
*/
|
|
12
|
+
static create(viewer: Viewer): Promise<GltfExportManager>;
|
|
13
|
+
/**
|
|
14
|
+
* Exports selected nodes to a file.
|
|
15
|
+
* @param filename optional name of the exported .GLB file.
|
|
16
|
+
* @param exportOptions export options to be merged with default options.
|
|
17
|
+
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export.
|
|
18
|
+
*/
|
|
19
|
+
exportGlb(filename?: string, exportOptions?: IExportOptions, excluded?: ExcludedGeometryList): Promise<File | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* Exports selected nodes to GLTF. This may result in more than one file, since textures are exported separately.
|
|
22
|
+
* @param filename name of the main (text-based) .GLTF file referring to separate texture files.
|
|
23
|
+
* @param exportOptions export options to be merged with default options.
|
|
24
|
+
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export.
|
|
25
|
+
*/
|
|
26
|
+
exportGltfToFile(filename: string, exportOptions?: IExportOptions, excluded?: ExcludedGeometryList): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Exports selected nodes to GLB. This results in one binary file.
|
|
29
|
+
* @param filename name of the .GLB file.
|
|
30
|
+
* @param exportOptions export options to be merged with default options.
|
|
31
|
+
* @param excluded optional list of geometry (meshes, elements, variants, variantInstances) to be excluded from export
|
|
32
|
+
*/
|
|
33
|
+
exportGlbToFile(filename: string, exportOptions?: IExportOptions, excluded?: ExcludedGeometryList): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Gets predefined {@link IExportOptions } merged with given ones.
|
|
36
|
+
*/
|
|
37
|
+
protected gltfExportOptions(mergeWithOptions?: IExportOptions, excluded?: ExcludedGeometryList): IExportOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Stuff to be done before exporting to GLTF
|
|
40
|
+
*/
|
|
41
|
+
protected exportPreProcess(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Stuff to be done after the GLTF export
|
|
44
|
+
*/
|
|
45
|
+
protected exportPostProcess(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Materials with refraction set are not exported properly.
|
|
48
|
+
* Exchange all such (relevant) materials with a more export-friendly version
|
|
49
|
+
*/
|
|
50
|
+
protected exchangeRefractionMaterials(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Restore original materials with set refraction.
|
|
53
|
+
*/
|
|
54
|
+
protected restoreRefractionMaterials(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Create an export-friendly replacement material for a material using refraction.
|
|
57
|
+
* @param mat Material to be replaced
|
|
58
|
+
*/
|
|
59
|
+
protected createRefractionMaterialReplacement(mat: PBRMaterial): PBRMaterial;
|
|
60
|
+
/**
|
|
61
|
+
* Inspect if a material was temporarily cloned for GLB export
|
|
62
|
+
* @param mat Material to be inspected
|
|
63
|
+
*/
|
|
64
|
+
protected isMaterialClonedForExport(mat: PBRMaterial): boolean;
|
|
65
|
+
}
|