@plattar/plattar-ar-adapter 1.132.1 → 1.136.1

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.
@@ -54,21 +54,35 @@ class SceneAR extends launcher_ar_1.LauncherAR {
54
54
  _ComposeScene(scene, output) {
55
55
  return new Promise((accept, reject) => {
56
56
  const sceneProducts = scene.relationships.filter(plattar_api_1.SceneProduct);
57
+ const sceneModels = scene.relationships.filter(plattar_api_1.SceneModel);
57
58
  // nothing to do if no AR components can be found
58
- if (sceneProducts.length <= 0) {
59
+ if ((sceneProducts.length + sceneModels.length) <= 0) {
59
60
  return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain AR components"));
60
61
  }
61
62
  // define our configurator
62
63
  const configurator = new plattar_services_1.Configurator();
63
64
  configurator.server = plattar_api_1.Server.location().type;
64
65
  configurator.output = output;
65
- // add out scene models
66
+ let totalARObjectCount = 0;
67
+ // add our scene products
66
68
  sceneProducts.forEach((sceneProduct) => {
67
69
  const product = sceneProduct.relationships.find(plattar_api_1.Product);
68
- if (product && product.attributes.product_variation_id) {
70
+ if (sceneProduct.attributes.include_in_augment && product && product.attributes.product_variation_id) {
69
71
  configurator.addSceneProduct(sceneProduct.id, product.attributes.product_variation_id);
72
+ totalARObjectCount++;
70
73
  }
71
74
  });
75
+ // add our scene models
76
+ sceneModels.forEach((sceneModel) => {
77
+ if (sceneModel.attributes.include_in_augment) {
78
+ configurator.addModel(sceneModel.id);
79
+ totalARObjectCount++;
80
+ }
81
+ });
82
+ // ensure we have actually added AR objects
83
+ if (totalARObjectCount <= 0) {
84
+ return reject(new Error("SceneAR.ComposeScene() - cannot proceed as scene does not contain any enabled AR components"));
85
+ }
72
86
  return configurator.get().then((result) => {
73
87
  accept(result.filename);
74
88
  }).catch(reject);
@@ -90,6 +104,7 @@ class SceneAR extends launcher_ar_1.LauncherAR {
90
104
  scene.include(plattar_api_1.Project);
91
105
  scene.include(plattar_api_1.SceneProduct);
92
106
  scene.include(plattar_api_1.SceneProduct.include(plattar_api_1.Product));
107
+ scene.include(plattar_api_1.SceneModel);
93
108
  scene.get().then((scene) => {
94
109
  this._SetupAnalytics(scene);
95
110
  const sceneOpt = scene.attributes.custom_json || {};
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.132.1";
1
+ declare const _default: "1.136.1";
2
2
  export default _default;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = "1.132.1";
3
+ exports.default = "1.136.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plattar/plattar-ar-adapter",
3
- "version": "1.132.1",
3
+ "version": "1.136.1",
4
4
  "description": "Plattar AR Adapter for interfacing with Google & Apple WebAR",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -37,19 +37,19 @@
37
37
  },
38
38
  "homepage": "https://www.plattar.com",
39
39
  "dependencies": {
40
- "@plattar/plattar-analytics": "^1.124.1",
40
+ "@plattar/plattar-analytics": "^1.134.3",
41
41
  "@plattar/plattar-api": "^1.120.1",
42
- "@plattar/plattar-qrcode": "1.122.1",
42
+ "@plattar/plattar-qrcode": "1.134.1",
43
43
  "@plattar/plattar-services": "^1.120.1",
44
- "@plattar/plattar-web": "^1.131.1"
44
+ "@plattar/plattar-web": "^1.135.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/cli": "^7.17.10",
48
- "@babel/core": "^7.18.5",
49
- "@babel/preset-env": "^7.18.2",
47
+ "@babel/cli": "^7.18.10",
48
+ "@babel/core": "^7.18.13",
49
+ "@babel/preset-env": "^7.18.10",
50
50
  "browserify": "^17.0.0",
51
- "typescript": "^4.7.3",
52
- "uglify-js": "^3.16.0"
51
+ "typescript": "^4.8.2",
52
+ "uglify-js": "^3.17.0"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"