@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.
@@ -888,24 +888,39 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
888
888
  key: "_ComposeScene",
889
889
  value: function _ComposeScene(scene, output) {
890
890
  return new Promise(function (accept, reject) {
891
- var sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct); // nothing to do if no AR components can be found
891
+ var sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
892
+ var sceneModels = scene.relationships.filter(plattar_api_1.SceneModel); // nothing to do if no AR components can be found
892
893
 
893
- if (sceneProducts.length <= 0) {
894
+ if (sceneProducts.length + sceneModels.length <= 0) {
894
895
  return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain AR components"));
895
896
  } // define our configurator
896
897
 
897
898
 
898
899
  var configurator = new plattar_services_1.Configurator();
899
900
  configurator.server = plattar_api_1.Server.location().type;
900
- configurator.output = output; // add out scene models
901
+ configurator.output = output;
902
+ var totalARObjectCount = 0; // add our scene products
901
903
 
902
904
  sceneProducts.forEach(function (sceneProduct) {
903
905
  var product = sceneProduct.relationships.find(plattar_api_1.Product);
904
906
 
905
- if (product && product.attributes.product_variation_id) {
907
+ if (sceneProduct.attributes.include_in_augment && product && product.attributes.product_variation_id) {
906
908
  configurator.addSceneProduct(sceneProduct.id, product.attributes.product_variation_id);
909
+ totalARObjectCount++;
907
910
  }
908
- });
911
+ }); // add our scene models
912
+
913
+ sceneModels.forEach(function (sceneModel) {
914
+ if (sceneModel.attributes.include_in_augment) {
915
+ configurator.addModel(sceneModel.id);
916
+ totalARObjectCount++;
917
+ }
918
+ }); // ensure we have actually added AR objects
919
+
920
+ if (totalARObjectCount <= 0) {
921
+ return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain any enabled AR components"));
922
+ }
923
+
909
924
  return configurator.get().then(function (result) {
910
925
  accept(result.filename);
911
926
  })["catch"](reject);
@@ -933,6 +948,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
933
948
  scene.include(plattar_api_1.Project);
934
949
  scene.include(plattar_api_1.SceneProduct);
935
950
  scene.include(plattar_api_1.SceneProduct.include(plattar_api_1.Product));
951
+ scene.include(plattar_api_1.SceneModel);
936
952
  scene.get().then(function (scene) {
937
953
  _this9._SetupAnalytics(scene);
938
954
 
@@ -3351,7 +3367,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3351
3367
  Object.defineProperty(exports, "__esModule", {
3352
3368
  value: true
3353
3369
  });
3354
- exports["default"] = "1.135.1";
3370
+ exports["default"] = "1.135.2";
3355
3371
  }, {}],
3356
3372
  17: [function (require, module, exports) {
3357
3373
  "use strict";
@@ -10477,7 +10493,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10477
10493
  _createClass(ModelElement, [{
10478
10494
  key: "permissions",
10479
10495
  get: function get() {
10480
- return ["autoplay"];
10496
+ return ["camera", "autoplay"];
10481
10497
  }
10482
10498
  }, {
10483
10499
  key: "elementType",
@@ -10836,7 +10852,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10836
10852
  module.exports = Util;
10837
10853
  }, {}],
10838
10854
  130: [function (require, module, exports) {
10839
- module.exports = "1.135.1";
10855
+ module.exports = "1.135.2";
10840
10856
  }, {}],
10841
10857
  131: [function (require, module, exports) {
10842
10858
  (function (global) {