@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.
- package/build/es2015/plattar-ar-adapter.js +538 -382
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +228 -121
- 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 +9 -9
package/dist/ar/scene-ar.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
1
|
+
declare const _default: "1.136.1";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plattar/plattar-ar-adapter",
|
|
3
|
-
"version": "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.
|
|
40
|
+
"@plattar/plattar-analytics": "^1.134.3",
|
|
41
41
|
"@plattar/plattar-api": "^1.120.1",
|
|
42
|
-
"@plattar/plattar-qrcode": "1.
|
|
42
|
+
"@plattar/plattar-qrcode": "1.134.1",
|
|
43
43
|
"@plattar/plattar-services": "^1.120.1",
|
|
44
|
-
"@plattar/plattar-web": "^1.
|
|
44
|
+
"@plattar/plattar-web": "^1.135.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@babel/cli": "^7.
|
|
48
|
-
"@babel/core": "^7.18.
|
|
49
|
-
"@babel/preset-env": "^7.18.
|
|
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.
|
|
52
|
-
"uglify-js": "^3.
|
|
51
|
+
"typescript": "^4.8.2",
|
|
52
|
+
"uglify-js": "^3.17.0"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|