@colijnit/homedecorator 256.1.21 → 256.1.22
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/app/plugins/model-uploader/model-previewer/model-preview.component.d.ts +1 -0
- package/bundles/colijnit-homedecorator.umd.js +36 -2
- package/bundles/colijnit-homedecorator.umd.js.map +1 -1
- package/esm2015/app/plugins/model-uploader/model-previewer/model-preview.component.js +24 -2
- package/esm2015/app/plugins/model-uploader/model-uploader/model-uploader.component.js +2 -2
- package/fesm2015/colijnit-homedecorator.js +24 -2
- package/fesm2015/colijnit-homedecorator.js.map +1 -1
- package/package.json +1 -1
|
@@ -100,6 +100,7 @@ export declare class ModelPreviewComponent implements OnInit, OnDestroy {
|
|
|
100
100
|
private _createLightFromProperties;
|
|
101
101
|
private _setObjectProperties;
|
|
102
102
|
private _validateObjectStructure;
|
|
103
|
+
private _validateMaterial;
|
|
103
104
|
static ɵfac: i0.ɵɵFactoryDeclaration<ModelPreviewComponent, never>;
|
|
104
105
|
static ɵcmp: i0.ɵɵComponentDeclaration<ModelPreviewComponent, "rp-model-preview", never, {}, {}, never, never>;
|
|
105
106
|
}
|
|
@@ -46306,10 +46306,12 @@
|
|
|
46306
46306
|
ModelPreviewComponent.prototype.exportSceneAsGLB = function (returnType) {
|
|
46307
46307
|
var _this = this;
|
|
46308
46308
|
// add timestamp
|
|
46309
|
+
this.showLoader = true;
|
|
46309
46310
|
var timestamp = new Date().getTime();
|
|
46310
46311
|
var exportFileName = this._setModelName(this.glbExportName.nativeElement.value) + '_' + timestamp;
|
|
46311
46312
|
var gltfExporter = new GLTFExporter.GLTFExporter();
|
|
46312
|
-
var scene
|
|
46313
|
+
var scene;
|
|
46314
|
+
scene = this.scenePreview.clone();
|
|
46313
46315
|
var model = this.scenePreview.getObjectByName(this.modelName).clone();
|
|
46314
46316
|
while (scene.children.length > 0) {
|
|
46315
46317
|
scene.remove(scene.children[0]);
|
|
@@ -46429,6 +46431,7 @@
|
|
|
46429
46431
|
document.body.appendChild(element);
|
|
46430
46432
|
element.click();
|
|
46431
46433
|
document.body.removeChild(element);
|
|
46434
|
+
this.showLoader = false;
|
|
46432
46435
|
return [2 /*return*/];
|
|
46433
46436
|
});
|
|
46434
46437
|
});
|
|
@@ -46459,11 +46462,13 @@
|
|
|
46459
46462
|
_this.data.thirdPartyModelService.parseModelToGLB(file, hash, modelUrl, configurationData, priceData, metaData).then(function (result) {
|
|
46460
46463
|
_this._dialog.closeAll();
|
|
46461
46464
|
_this._messageService.emit(MessageType.HideProductCatalog);
|
|
46465
|
+
_this.showLoader = false;
|
|
46462
46466
|
});
|
|
46463
46467
|
});
|
|
46464
46468
|
}
|
|
46465
46469
|
}).catch(function (error) {
|
|
46466
46470
|
_this._messageService.emit(MessageType.RenderError, { title: 'Upload error', message: error });
|
|
46471
|
+
_this.showLoader = false;
|
|
46467
46472
|
});
|
|
46468
46473
|
return [2 /*return*/];
|
|
46469
46474
|
});
|
|
@@ -46678,6 +46683,7 @@
|
|
|
46678
46683
|
}
|
|
46679
46684
|
};
|
|
46680
46685
|
ModelPreviewComponent.prototype._validateObjectStructure = function (inputObject) {
|
|
46686
|
+
var _this = this;
|
|
46681
46687
|
var modelGroup = inputObject;
|
|
46682
46688
|
var validation = [];
|
|
46683
46689
|
// Check for a group
|
|
@@ -46687,6 +46693,7 @@
|
|
|
46687
46693
|
// Does it contain meshes
|
|
46688
46694
|
var hasVisibleMeshes = false;
|
|
46689
46695
|
modelGroup.traverse(function (object) {
|
|
46696
|
+
var e_3, _a;
|
|
46690
46697
|
if (object.isMesh) {
|
|
46691
46698
|
hasVisibleMeshes = true;
|
|
46692
46699
|
// basic geometry check
|
|
@@ -46697,6 +46704,26 @@
|
|
|
46697
46704
|
else if (!object.geometry.attributes.position || object.geometry.attributes.position.count === 0) {
|
|
46698
46705
|
validation.push('Mesh ' + object.name + ' geometry has no position data.');
|
|
46699
46706
|
}
|
|
46707
|
+
if (object.material) {
|
|
46708
|
+
if (object.material.length > 1) {
|
|
46709
|
+
try {
|
|
46710
|
+
for (var _b = __values(object.material), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
46711
|
+
var mat = _c.value;
|
|
46712
|
+
_this._validateMaterial(mat);
|
|
46713
|
+
}
|
|
46714
|
+
}
|
|
46715
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
46716
|
+
finally {
|
|
46717
|
+
try {
|
|
46718
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
46719
|
+
}
|
|
46720
|
+
finally { if (e_3) throw e_3.error; }
|
|
46721
|
+
}
|
|
46722
|
+
}
|
|
46723
|
+
else {
|
|
46724
|
+
_this._validateMaterial(object.material);
|
|
46725
|
+
}
|
|
46726
|
+
}
|
|
46700
46727
|
// basic mats check
|
|
46701
46728
|
if (!object.material) {
|
|
46702
46729
|
validation.push('Mesh ' + object.name + ' has no material');
|
|
@@ -46730,6 +46757,13 @@
|
|
|
46730
46757
|
}
|
|
46731
46758
|
return validation;
|
|
46732
46759
|
};
|
|
46760
|
+
ModelPreviewComponent.prototype._validateMaterial = function (material) {
|
|
46761
|
+
if (material.map && material.map.source && material.map.source.data === null) {
|
|
46762
|
+
material.map.dispose();
|
|
46763
|
+
material.map = null;
|
|
46764
|
+
material.needsUpdate = true;
|
|
46765
|
+
}
|
|
46766
|
+
};
|
|
46733
46767
|
return ModelPreviewComponent;
|
|
46734
46768
|
}());
|
|
46735
46769
|
ModelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: ModelPreviewComponent, deps: [{ token: i1.MAT_DIALOG_DATA }, { token: HomedecoratorSettingsService }, { token: HomedecoratorIconCacheService }, { token: i1__namespace.MatDialogRef }, { token: MessageBusService }, { token: i1__namespace.MatDialog }, { token: HomedecoratorConnectorAdapterService }, { token: HomedecoratorDictionaryService }, { token: FontService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
@@ -47288,7 +47322,7 @@
|
|
|
47288
47322
|
this.settingsService = settingsService;
|
|
47289
47323
|
this._messageService = _messageService;
|
|
47290
47324
|
this.file = null;
|
|
47291
|
-
this.fileMaxSize =
|
|
47325
|
+
this.fileMaxSize = 30; // file size in mb
|
|
47292
47326
|
this._maxFileSize = this.fileMaxSize * 1024 * 1024; // fileMaxSize to kb
|
|
47293
47327
|
this._allowedFiles = ['glb', 'obj', 'fbx', '3ds', 'gltf', 'stl'];
|
|
47294
47328
|
}
|