lythreeframe 1.2.67 → 1.2.69
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/dist/bundle.cjs.js +41 -2
- package/dist/bundle.esm.js +41 -2
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -1087,9 +1087,48 @@ class AssetManager {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
setupDracoLoader(dracoPath) {
|
|
1089
1089
|
if (!this.dracoLoader) {
|
|
1090
|
-
|
|
1090
|
+
// Create DRACOLoader without passing LoadingManager
|
|
1091
|
+
this.dracoLoader = new Addons_js.DRACOLoader();
|
|
1092
|
+
// Clear manager callbacks to avoid Worker cloning issues
|
|
1093
|
+
if (this.dracoLoader.manager) {
|
|
1094
|
+
const manager = this.dracoLoader.manager;
|
|
1095
|
+
manager.onStart = undefined;
|
|
1096
|
+
manager.onLoad = undefined;
|
|
1097
|
+
manager.onProgress = undefined;
|
|
1098
|
+
manager.onError = undefined;
|
|
1099
|
+
}
|
|
1091
1100
|
this.dracoLoader.setDecoderPath(dracoPath);
|
|
1092
|
-
|
|
1101
|
+
// Intercept Worker creation to fix Vue reactivity issues
|
|
1102
|
+
const OriginalWorker = window.Worker;
|
|
1103
|
+
if (OriginalWorker && !OriginalWorker._dracoPatched) {
|
|
1104
|
+
OriginalWorker._dracoPatched = true;
|
|
1105
|
+
window.Worker = function (scriptURL, options) {
|
|
1106
|
+
const worker = new OriginalWorker(scriptURL, options);
|
|
1107
|
+
const originalPostMessage = worker.postMessage.bind(worker);
|
|
1108
|
+
worker.postMessage = function (message, transfer) {
|
|
1109
|
+
// Fix decoderConfig if it exists and is a Vue proxy
|
|
1110
|
+
if (message && message.decoderConfig && typeof message.decoderConfig === 'object') {
|
|
1111
|
+
const config = message.decoderConfig;
|
|
1112
|
+
const plainConfig = {};
|
|
1113
|
+
// Copy all properties to create a plain object
|
|
1114
|
+
for (const key in config) {
|
|
1115
|
+
if (Object.prototype.hasOwnProperty.call(config, key)) {
|
|
1116
|
+
plainConfig[key] = config[key];
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
message = Object.assign(Object.assign({}, message), { decoderConfig: plainConfig });
|
|
1120
|
+
}
|
|
1121
|
+
return originalPostMessage(message, transfer);
|
|
1122
|
+
};
|
|
1123
|
+
return worker;
|
|
1124
|
+
};
|
|
1125
|
+
// Copy static properties
|
|
1126
|
+
for (const key in OriginalWorker) {
|
|
1127
|
+
if (Object.prototype.hasOwnProperty.call(OriginalWorker, key)) {
|
|
1128
|
+
window.Worker[key] = OriginalWorker[key];
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1093
1132
|
this.dracoLoader.preload();
|
|
1094
1133
|
this.gltfLoader.setDRACOLoader(this.dracoLoader);
|
|
1095
1134
|
}
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1085,9 +1085,48 @@ class AssetManager {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
setupDracoLoader(dracoPath) {
|
|
1087
1087
|
if (!this.dracoLoader) {
|
|
1088
|
-
|
|
1088
|
+
// Create DRACOLoader without passing LoadingManager
|
|
1089
|
+
this.dracoLoader = new DRACOLoader();
|
|
1090
|
+
// Clear manager callbacks to avoid Worker cloning issues
|
|
1091
|
+
if (this.dracoLoader.manager) {
|
|
1092
|
+
const manager = this.dracoLoader.manager;
|
|
1093
|
+
manager.onStart = undefined;
|
|
1094
|
+
manager.onLoad = undefined;
|
|
1095
|
+
manager.onProgress = undefined;
|
|
1096
|
+
manager.onError = undefined;
|
|
1097
|
+
}
|
|
1089
1098
|
this.dracoLoader.setDecoderPath(dracoPath);
|
|
1090
|
-
|
|
1099
|
+
// Intercept Worker creation to fix Vue reactivity issues
|
|
1100
|
+
const OriginalWorker = window.Worker;
|
|
1101
|
+
if (OriginalWorker && !OriginalWorker._dracoPatched) {
|
|
1102
|
+
OriginalWorker._dracoPatched = true;
|
|
1103
|
+
window.Worker = function (scriptURL, options) {
|
|
1104
|
+
const worker = new OriginalWorker(scriptURL, options);
|
|
1105
|
+
const originalPostMessage = worker.postMessage.bind(worker);
|
|
1106
|
+
worker.postMessage = function (message, transfer) {
|
|
1107
|
+
// Fix decoderConfig if it exists and is a Vue proxy
|
|
1108
|
+
if (message && message.decoderConfig && typeof message.decoderConfig === 'object') {
|
|
1109
|
+
const config = message.decoderConfig;
|
|
1110
|
+
const plainConfig = {};
|
|
1111
|
+
// Copy all properties to create a plain object
|
|
1112
|
+
for (const key in config) {
|
|
1113
|
+
if (Object.prototype.hasOwnProperty.call(config, key)) {
|
|
1114
|
+
plainConfig[key] = config[key];
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
message = Object.assign(Object.assign({}, message), { decoderConfig: plainConfig });
|
|
1118
|
+
}
|
|
1119
|
+
return originalPostMessage(message, transfer);
|
|
1120
|
+
};
|
|
1121
|
+
return worker;
|
|
1122
|
+
};
|
|
1123
|
+
// Copy static properties
|
|
1124
|
+
for (const key in OriginalWorker) {
|
|
1125
|
+
if (Object.prototype.hasOwnProperty.call(OriginalWorker, key)) {
|
|
1126
|
+
window.Worker[key] = OriginalWorker[key];
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1091
1130
|
this.dracoLoader.preload();
|
|
1092
1131
|
this.gltfLoader.setDRACOLoader(this.dracoLoader);
|
|
1093
1132
|
}
|