@plattar/plattar-ar-adapter 1.135.1 → 1.135.2
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/build/es2015/plattar-ar-adapter.js +24 -8
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +21 -6
- package/build/es2019/plattar-ar-adapter.min.js +1 -1
- package/dist/ar/scene-ar.js +18 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -504,21 +504,35 @@ class SceneAR extends launcher_ar_1.LauncherAR {
|
|
|
504
504
|
_ComposeScene(scene, output) {
|
|
505
505
|
return new Promise((accept, reject) => {
|
|
506
506
|
const sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
|
|
507
|
+
const sceneModels = scene.relationships.filter(plattar_api_1.SceneModel);
|
|
507
508
|
// nothing to do if no AR components can be found
|
|
508
|
-
if (sceneProducts.length <= 0) {
|
|
509
|
+
if ((sceneProducts.length + sceneModels.length) <= 0) {
|
|
509
510
|
return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain AR components"));
|
|
510
511
|
}
|
|
511
512
|
// define our configurator
|
|
512
513
|
const configurator = new plattar_services_1.Configurator();
|
|
513
514
|
configurator.server = plattar_api_1.Server.location().type;
|
|
514
515
|
configurator.output = output;
|
|
515
|
-
|
|
516
|
+
let totalARObjectCount = 0;
|
|
517
|
+
// add our scene products
|
|
516
518
|
sceneProducts.forEach((sceneProduct) => {
|
|
517
519
|
const product = sceneProduct.relationships.find(plattar_api_1.Product);
|
|
518
|
-
if (product && product.attributes.product_variation_id) {
|
|
520
|
+
if (sceneProduct.attributes.include_in_augment && product && product.attributes.product_variation_id) {
|
|
519
521
|
configurator.addSceneProduct(sceneProduct.id, product.attributes.product_variation_id);
|
|
522
|
+
totalARObjectCount++;
|
|
520
523
|
}
|
|
521
524
|
});
|
|
525
|
+
// add our scene models
|
|
526
|
+
sceneModels.forEach((sceneModel) => {
|
|
527
|
+
if (sceneModel.attributes.include_in_augment) {
|
|
528
|
+
configurator.addModel(sceneModel.id);
|
|
529
|
+
totalARObjectCount++;
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
// ensure we have actually added AR objects
|
|
533
|
+
if (totalARObjectCount <= 0) {
|
|
534
|
+
return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain any enabled AR components"));
|
|
535
|
+
}
|
|
522
536
|
return configurator.get().then((result) => {
|
|
523
537
|
accept(result.filename);
|
|
524
538
|
}).catch(reject);
|
|
@@ -540,6 +554,7 @@ class SceneAR extends launcher_ar_1.LauncherAR {
|
|
|
540
554
|
scene.include(plattar_api_1.Project);
|
|
541
555
|
scene.include(plattar_api_1.SceneProduct);
|
|
542
556
|
scene.include(plattar_api_1.SceneProduct.include(plattar_api_1.Product));
|
|
557
|
+
scene.include(plattar_api_1.SceneModel);
|
|
543
558
|
scene.get().then((scene) => {
|
|
544
559
|
this._SetupAnalytics(scene);
|
|
545
560
|
const sceneOpt = scene.attributes.custom_json || {};
|
|
@@ -2148,7 +2163,7 @@ exports.Util = Util;
|
|
|
2148
2163
|
},{}],16:[function(require,module,exports){
|
|
2149
2164
|
"use strict";
|
|
2150
2165
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2151
|
-
exports.default = "1.135.
|
|
2166
|
+
exports.default = "1.135.2";
|
|
2152
2167
|
|
|
2153
2168
|
},{}],17:[function(require,module,exports){
|
|
2154
2169
|
"use strict";
|
|
@@ -6889,7 +6904,7 @@ class ModelElement extends BaseElement {
|
|
|
6889
6904
|
}
|
|
6890
6905
|
|
|
6891
6906
|
get permissions() {
|
|
6892
|
-
return ["autoplay"];
|
|
6907
|
+
return ["camera", "autoplay"];
|
|
6893
6908
|
}
|
|
6894
6909
|
|
|
6895
6910
|
get elementType() {
|
|
@@ -7132,7 +7147,7 @@ class Util {
|
|
|
7132
7147
|
|
|
7133
7148
|
module.exports = Util;
|
|
7134
7149
|
},{}],130:[function(require,module,exports){
|
|
7135
|
-
module.exports = "1.135.
|
|
7150
|
+
module.exports = "1.135.2";
|
|
7136
7151
|
|
|
7137
7152
|
},{}],131:[function(require,module,exports){
|
|
7138
7153
|
(function (global){(function (){
|