@2112-lab/central-plant 0.1.9 → 0.1.10
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/index.js
CHANGED
|
@@ -22858,6 +22858,7 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
22858
22858
|
// Name utilities
|
|
22859
22859
|
this.utilities.generateUuidFromName = generateUuidFromName;
|
|
22860
22860
|
this.utilities.getHardcodedUuid = getHardcodedUuid;
|
|
22861
|
+
this.utilities.findObjectByHardcodedUuid = findObjectByHardcodedUuid;
|
|
22861
22862
|
|
|
22862
22863
|
// Loggers
|
|
22863
22864
|
this.utilities.logger = logger;
|
|
@@ -23906,6 +23907,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
23906
23907
|
return _objectSpread2({}, this.managers);
|
|
23907
23908
|
}
|
|
23908
23909
|
|
|
23910
|
+
/**
|
|
23911
|
+
* Get a specific manager instance
|
|
23912
|
+
* @param {string} managerName - The name of the manager to retrieve
|
|
23913
|
+
* @returns {Object|null} The manager instance or null if not found
|
|
23914
|
+
*/
|
|
23915
|
+
}, {
|
|
23916
|
+
key: "getManager",
|
|
23917
|
+
value: function getManager(managerName) {
|
|
23918
|
+
return this.managers[managerName] || null;
|
|
23919
|
+
}
|
|
23920
|
+
|
|
23909
23921
|
/**
|
|
23910
23922
|
* Get all utilities for external access
|
|
23911
23923
|
* @returns {Object} All utility instances
|
|
@@ -23915,6 +23927,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
23915
23927
|
value: function getAllUtilities() {
|
|
23916
23928
|
return _objectSpread2({}, this.utilities);
|
|
23917
23929
|
}
|
|
23930
|
+
|
|
23931
|
+
/**
|
|
23932
|
+
* Get a specific utility instance
|
|
23933
|
+
* @param {string} utilityName - The name of the utility to retrieve
|
|
23934
|
+
* @returns {any|null} The utility instance or null if not found
|
|
23935
|
+
*/
|
|
23936
|
+
}, {
|
|
23937
|
+
key: "getUtility",
|
|
23938
|
+
value: function getUtility(utilityName) {
|
|
23939
|
+
return this.utilities[utilityName] || null;
|
|
23940
|
+
}
|
|
23918
23941
|
}]);
|
|
23919
23942
|
}();
|
|
23920
23943
|
|
|
@@ -31389,7 +31412,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
31389
31412
|
ply: new PLYExporter()
|
|
31390
31413
|
};
|
|
31391
31414
|
this.supportedFormats = {
|
|
31392
|
-
models: ['gltf', 'glb', 'obj', 'stl', 'ply'
|
|
31415
|
+
models: ['gltf', 'glb', 'obj', 'stl', 'ply'],
|
|
31393
31416
|
scenes: ['json'],
|
|
31394
31417
|
images: ['png', 'jpg', 'jpeg', 'webp'],
|
|
31395
31418
|
data: ['json', 'csv', 'xml']
|
|
@@ -31432,41 +31455,35 @@ var Export = /*#__PURE__*/function () {
|
|
|
31432
31455
|
includeCustomExtensions: false
|
|
31433
31456
|
}, options);
|
|
31434
31457
|
_t = format.toLowerCase();
|
|
31435
|
-
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 :
|
|
31458
|
+
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 : 10;
|
|
31436
31459
|
break;
|
|
31437
31460
|
case 2:
|
|
31438
31461
|
_context.n = 3;
|
|
31439
31462
|
return this.exportGLTF(object, exportOptions);
|
|
31440
31463
|
case 3:
|
|
31441
31464
|
result = _context.v;
|
|
31442
|
-
return _context.a(3,
|
|
31465
|
+
return _context.a(3, 11);
|
|
31443
31466
|
case 4:
|
|
31444
31467
|
_context.n = 5;
|
|
31445
31468
|
return this.exportOBJ(object, exportOptions);
|
|
31446
31469
|
case 5:
|
|
31447
31470
|
result = _context.v;
|
|
31448
|
-
return _context.a(3,
|
|
31471
|
+
return _context.a(3, 11);
|
|
31449
31472
|
case 6:
|
|
31450
31473
|
_context.n = 7;
|
|
31451
31474
|
return this.exportSTL(object, exportOptions);
|
|
31452
31475
|
case 7:
|
|
31453
31476
|
result = _context.v;
|
|
31454
|
-
return _context.a(3,
|
|
31477
|
+
return _context.a(3, 11);
|
|
31455
31478
|
case 8:
|
|
31456
31479
|
_context.n = 9;
|
|
31457
31480
|
return this.exportPLY(object, exportOptions);
|
|
31458
31481
|
case 9:
|
|
31459
31482
|
result = _context.v;
|
|
31460
|
-
return _context.a(3,
|
|
31483
|
+
return _context.a(3, 11);
|
|
31461
31484
|
case 10:
|
|
31462
|
-
_context.n = 11;
|
|
31463
|
-
return this.exportCollada(object, exportOptions);
|
|
31464
|
-
case 11:
|
|
31465
|
-
result = _context.v;
|
|
31466
|
-
return _context.a(3, 13);
|
|
31467
|
-
case 12:
|
|
31468
31485
|
throw new Error("Unsupported format: ".concat(format));
|
|
31469
|
-
case
|
|
31486
|
+
case 11:
|
|
31470
31487
|
exportTime = performance.now() - startTime;
|
|
31471
31488
|
exportRecord = {
|
|
31472
31489
|
timestamp: new Date().toISOString(),
|
|
@@ -31484,8 +31501,8 @@ var Export = /*#__PURE__*/function () {
|
|
|
31484
31501
|
exportTime: exportTime,
|
|
31485
31502
|
filename: this.generateFilename(object.name || 'model', format)
|
|
31486
31503
|
});
|
|
31487
|
-
case
|
|
31488
|
-
_context.p =
|
|
31504
|
+
case 12:
|
|
31505
|
+
_context.p = 12;
|
|
31489
31506
|
_t2 = _context.v;
|
|
31490
31507
|
_exportTime = performance.now() - startTime;
|
|
31491
31508
|
_exportRecord = {
|
|
@@ -31500,10 +31517,10 @@ var Export = /*#__PURE__*/function () {
|
|
|
31500
31517
|
this.exportHistory.push(_exportRecord);
|
|
31501
31518
|
logger.error("\u274C Failed to export model to ".concat(format.toUpperCase(), ":"), _t2);
|
|
31502
31519
|
throw _t2;
|
|
31503
|
-
case
|
|
31520
|
+
case 13:
|
|
31504
31521
|
return _context.a(2);
|
|
31505
31522
|
}
|
|
31506
|
-
}, _callee, this, [[1,
|
|
31523
|
+
}, _callee, this, [[1, 12]]);
|
|
31507
31524
|
}));
|
|
31508
31525
|
function exportModel(_x, _x2) {
|
|
31509
31526
|
return _exportModel.apply(this, arguments);
|
|
@@ -31628,36 +31645,6 @@ var Export = /*#__PURE__*/function () {
|
|
|
31628
31645
|
}
|
|
31629
31646
|
return exportPLY;
|
|
31630
31647
|
}()
|
|
31631
|
-
/**
|
|
31632
|
-
* Export to Collada (DAE) format
|
|
31633
|
-
* @param {THREE.Object3D} object - Object to export
|
|
31634
|
-
* @param {Object} options - Export options
|
|
31635
|
-
* @returns {Promise<string>} Collada XML string
|
|
31636
|
-
*/
|
|
31637
|
-
)
|
|
31638
|
-
}, {
|
|
31639
|
-
key: "exportCollada",
|
|
31640
|
-
value: (function () {
|
|
31641
|
-
var _exportCollada = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(object) {
|
|
31642
|
-
var _this5 = this;
|
|
31643
|
-
var options,
|
|
31644
|
-
_args6 = arguments;
|
|
31645
|
-
return _regenerator().w(function (_context6) {
|
|
31646
|
-
while (1) switch (_context6.n) {
|
|
31647
|
-
case 0:
|
|
31648
|
-
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
31649
|
-
return _context6.a(2, new Promise(function (resolve) {
|
|
31650
|
-
var result = _this5.exporters.collada.parse(object, options);
|
|
31651
|
-
resolve(result.data);
|
|
31652
|
-
}));
|
|
31653
|
-
}
|
|
31654
|
-
}, _callee6);
|
|
31655
|
-
}));
|
|
31656
|
-
function exportCollada(_x7) {
|
|
31657
|
-
return _exportCollada.apply(this, arguments);
|
|
31658
|
-
}
|
|
31659
|
-
return exportCollada;
|
|
31660
|
-
}()
|
|
31661
31648
|
/**
|
|
31662
31649
|
* Export scene configuration to JSON
|
|
31663
31650
|
* @param {THREE.Scene} scene - Scene to export
|
|
@@ -31700,7 +31687,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
31700
31687
|
}, {
|
|
31701
31688
|
key: "serializeObject",
|
|
31702
31689
|
value: function serializeObject(object) {
|
|
31703
|
-
var
|
|
31690
|
+
var _this5 = this;
|
|
31704
31691
|
var serialized = {
|
|
31705
31692
|
uuid: object.uuid,
|
|
31706
31693
|
name: object.name,
|
|
@@ -31731,7 +31718,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
31731
31718
|
|
|
31732
31719
|
// Recursively serialize children
|
|
31733
31720
|
object.children.forEach(function (child) {
|
|
31734
|
-
serialized.children.push(
|
|
31721
|
+
serialized.children.push(_this5.serializeObject(child));
|
|
31735
31722
|
});
|
|
31736
31723
|
return serialized;
|
|
31737
31724
|
}
|
|
@@ -31904,7 +31891,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
31904
31891
|
}, {
|
|
31905
31892
|
key: "exportToXML",
|
|
31906
31893
|
value: function exportToXML(data) {
|
|
31907
|
-
var
|
|
31894
|
+
var _this6 = this;
|
|
31908
31895
|
var rootElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'root';
|
|
31909
31896
|
var xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
31910
31897
|
var _objectToXML = function objectToXML(obj) {
|
|
@@ -31923,12 +31910,12 @@ var Export = /*#__PURE__*/function () {
|
|
|
31923
31910
|
if (_typeof(item) === 'object') {
|
|
31924
31911
|
xml += '\n' + _objectToXML(item, indent + 1) + spaces;
|
|
31925
31912
|
} else {
|
|
31926
|
-
xml +=
|
|
31913
|
+
xml += _this6.escapeXML(item);
|
|
31927
31914
|
}
|
|
31928
31915
|
xml += "</".concat(key, ">\n");
|
|
31929
31916
|
});
|
|
31930
31917
|
} else {
|
|
31931
|
-
xml += "".concat(spaces, "<").concat(key, ">").concat(
|
|
31918
|
+
xml += "".concat(spaces, "<").concat(key, ">").concat(_this6.escapeXML(value), "</").concat(key, ">\n");
|
|
31932
31919
|
}
|
|
31933
31920
|
});
|
|
31934
31921
|
return xml;
|
|
@@ -31980,63 +31967,63 @@ var Export = /*#__PURE__*/function () {
|
|
|
31980
31967
|
}, {
|
|
31981
31968
|
key: "exportBatch",
|
|
31982
31969
|
value: (function () {
|
|
31983
|
-
var _exportBatch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
31970
|
+
var _exportBatch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(objects) {
|
|
31984
31971
|
var results, errors, _iterator, _step, item, result, _t3, _t4;
|
|
31985
|
-
return _regenerator().w(function (
|
|
31986
|
-
while (1) switch (
|
|
31972
|
+
return _regenerator().w(function (_context6) {
|
|
31973
|
+
while (1) switch (_context6.n) {
|
|
31987
31974
|
case 0:
|
|
31988
31975
|
logger.info("\uD83D\uDD04 Starting batch export of ".concat(objects.length, " objects..."));
|
|
31989
31976
|
results = [];
|
|
31990
31977
|
errors = [];
|
|
31991
31978
|
_iterator = _createForOfIteratorHelper(objects);
|
|
31992
|
-
|
|
31979
|
+
_context6.p = 1;
|
|
31993
31980
|
_iterator.s();
|
|
31994
31981
|
case 2:
|
|
31995
31982
|
if ((_step = _iterator.n()).done) {
|
|
31996
|
-
|
|
31983
|
+
_context6.n = 7;
|
|
31997
31984
|
break;
|
|
31998
31985
|
}
|
|
31999
31986
|
item = _step.value;
|
|
32000
|
-
|
|
32001
|
-
|
|
31987
|
+
_context6.p = 3;
|
|
31988
|
+
_context6.n = 4;
|
|
32002
31989
|
return this.exportModel(item.object, item.format, item.options);
|
|
32003
31990
|
case 4:
|
|
32004
|
-
result =
|
|
31991
|
+
result = _context6.v;
|
|
32005
31992
|
results.push(result);
|
|
32006
|
-
|
|
31993
|
+
_context6.n = 6;
|
|
32007
31994
|
break;
|
|
32008
31995
|
case 5:
|
|
32009
|
-
|
|
32010
|
-
_t3 =
|
|
31996
|
+
_context6.p = 5;
|
|
31997
|
+
_t3 = _context6.v;
|
|
32011
31998
|
errors.push({
|
|
32012
31999
|
object: item.object.name || 'Unnamed Object',
|
|
32013
32000
|
format: item.format,
|
|
32014
32001
|
error: _t3.message
|
|
32015
32002
|
});
|
|
32016
32003
|
case 6:
|
|
32017
|
-
|
|
32004
|
+
_context6.n = 2;
|
|
32018
32005
|
break;
|
|
32019
32006
|
case 7:
|
|
32020
|
-
|
|
32007
|
+
_context6.n = 9;
|
|
32021
32008
|
break;
|
|
32022
32009
|
case 8:
|
|
32023
|
-
|
|
32024
|
-
_t4 =
|
|
32010
|
+
_context6.p = 8;
|
|
32011
|
+
_t4 = _context6.v;
|
|
32025
32012
|
_iterator.e(_t4);
|
|
32026
32013
|
case 9:
|
|
32027
|
-
|
|
32014
|
+
_context6.p = 9;
|
|
32028
32015
|
_iterator.f();
|
|
32029
|
-
return
|
|
32016
|
+
return _context6.f(9);
|
|
32030
32017
|
case 10:
|
|
32031
32018
|
logger.info("\u2705 Batch export complete: ".concat(results.length, " successful, ").concat(errors.length, " failed"));
|
|
32032
|
-
return
|
|
32019
|
+
return _context6.a(2, {
|
|
32033
32020
|
results: results,
|
|
32034
32021
|
errors: errors
|
|
32035
32022
|
});
|
|
32036
32023
|
}
|
|
32037
|
-
},
|
|
32024
|
+
}, _callee6, this, [[3, 5], [1, 8, 9, 10]]);
|
|
32038
32025
|
}));
|
|
32039
|
-
function exportBatch(
|
|
32026
|
+
function exportBatch(_x7) {
|
|
32040
32027
|
return _exportBatch.apply(this, arguments);
|
|
32041
32028
|
}
|
|
32042
32029
|
return exportBatch;
|
|
@@ -116,6 +116,7 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
116
116
|
// Name utilities
|
|
117
117
|
this.utilities.generateUuidFromName = nameUtils.generateUuidFromName;
|
|
118
118
|
this.utilities.getHardcodedUuid = nameUtils.getHardcodedUuid;
|
|
119
|
+
this.utilities.findObjectByHardcodedUuid = nameUtils.findObjectByHardcodedUuid;
|
|
119
120
|
|
|
120
121
|
// Loggers
|
|
121
122
|
this.utilities.logger = debugLogger.logger;
|
|
@@ -1164,6 +1165,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
1164
1165
|
return _rollupPluginBabelHelpers.objectSpread2({}, this.managers);
|
|
1165
1166
|
}
|
|
1166
1167
|
|
|
1168
|
+
/**
|
|
1169
|
+
* Get a specific manager instance
|
|
1170
|
+
* @param {string} managerName - The name of the manager to retrieve
|
|
1171
|
+
* @returns {Object|null} The manager instance or null if not found
|
|
1172
|
+
*/
|
|
1173
|
+
}, {
|
|
1174
|
+
key: "getManager",
|
|
1175
|
+
value: function getManager(managerName) {
|
|
1176
|
+
return this.managers[managerName] || null;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1167
1179
|
/**
|
|
1168
1180
|
* Get all utilities for external access
|
|
1169
1181
|
* @returns {Object} All utility instances
|
|
@@ -1173,6 +1185,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
1173
1185
|
value: function getAllUtilities() {
|
|
1174
1186
|
return _rollupPluginBabelHelpers.objectSpread2({}, this.utilities);
|
|
1175
1187
|
}
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Get a specific utility instance
|
|
1191
|
+
* @param {string} utilityName - The name of the utility to retrieve
|
|
1192
|
+
* @returns {any|null} The utility instance or null if not found
|
|
1193
|
+
*/
|
|
1194
|
+
}, {
|
|
1195
|
+
key: "getUtility",
|
|
1196
|
+
value: function getUtility(utilityName) {
|
|
1197
|
+
return this.utilities[utilityName] || null;
|
|
1198
|
+
}
|
|
1176
1199
|
}]);
|
|
1177
1200
|
}();
|
|
1178
1201
|
|
|
@@ -20,7 +20,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
20
20
|
ply: new PLYExporter.PLYExporter()
|
|
21
21
|
};
|
|
22
22
|
this.supportedFormats = {
|
|
23
|
-
models: ['gltf', 'glb', 'obj', 'stl', 'ply'
|
|
23
|
+
models: ['gltf', 'glb', 'obj', 'stl', 'ply'],
|
|
24
24
|
scenes: ['json'],
|
|
25
25
|
images: ['png', 'jpg', 'jpeg', 'webp'],
|
|
26
26
|
data: ['json', 'csv', 'xml']
|
|
@@ -63,41 +63,35 @@ var Export = /*#__PURE__*/function () {
|
|
|
63
63
|
includeCustomExtensions: false
|
|
64
64
|
}, options);
|
|
65
65
|
_t = format.toLowerCase();
|
|
66
|
-
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 :
|
|
66
|
+
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 : 10;
|
|
67
67
|
break;
|
|
68
68
|
case 2:
|
|
69
69
|
_context.n = 3;
|
|
70
70
|
return this.exportGLTF(object, exportOptions);
|
|
71
71
|
case 3:
|
|
72
72
|
result = _context.v;
|
|
73
|
-
return _context.a(3,
|
|
73
|
+
return _context.a(3, 11);
|
|
74
74
|
case 4:
|
|
75
75
|
_context.n = 5;
|
|
76
76
|
return this.exportOBJ(object, exportOptions);
|
|
77
77
|
case 5:
|
|
78
78
|
result = _context.v;
|
|
79
|
-
return _context.a(3,
|
|
79
|
+
return _context.a(3, 11);
|
|
80
80
|
case 6:
|
|
81
81
|
_context.n = 7;
|
|
82
82
|
return this.exportSTL(object, exportOptions);
|
|
83
83
|
case 7:
|
|
84
84
|
result = _context.v;
|
|
85
|
-
return _context.a(3,
|
|
85
|
+
return _context.a(3, 11);
|
|
86
86
|
case 8:
|
|
87
87
|
_context.n = 9;
|
|
88
88
|
return this.exportPLY(object, exportOptions);
|
|
89
89
|
case 9:
|
|
90
90
|
result = _context.v;
|
|
91
|
-
return _context.a(3,
|
|
91
|
+
return _context.a(3, 11);
|
|
92
92
|
case 10:
|
|
93
|
-
_context.n = 11;
|
|
94
|
-
return this.exportCollada(object, exportOptions);
|
|
95
|
-
case 11:
|
|
96
|
-
result = _context.v;
|
|
97
|
-
return _context.a(3, 13);
|
|
98
|
-
case 12:
|
|
99
93
|
throw new Error("Unsupported format: ".concat(format));
|
|
100
|
-
case
|
|
94
|
+
case 11:
|
|
101
95
|
exportTime = performance.now() - startTime;
|
|
102
96
|
exportRecord = {
|
|
103
97
|
timestamp: new Date().toISOString(),
|
|
@@ -115,8 +109,8 @@ var Export = /*#__PURE__*/function () {
|
|
|
115
109
|
exportTime: exportTime,
|
|
116
110
|
filename: this.generateFilename(object.name || 'model', format)
|
|
117
111
|
});
|
|
118
|
-
case
|
|
119
|
-
_context.p =
|
|
112
|
+
case 12:
|
|
113
|
+
_context.p = 12;
|
|
120
114
|
_t2 = _context.v;
|
|
121
115
|
_exportTime = performance.now() - startTime;
|
|
122
116
|
_exportRecord = {
|
|
@@ -131,10 +125,10 @@ var Export = /*#__PURE__*/function () {
|
|
|
131
125
|
this.exportHistory.push(_exportRecord);
|
|
132
126
|
debugLogger.logger.error("\u274C Failed to export model to ".concat(format.toUpperCase(), ":"), _t2);
|
|
133
127
|
throw _t2;
|
|
134
|
-
case
|
|
128
|
+
case 13:
|
|
135
129
|
return _context.a(2);
|
|
136
130
|
}
|
|
137
|
-
}, _callee, this, [[1,
|
|
131
|
+
}, _callee, this, [[1, 12]]);
|
|
138
132
|
}));
|
|
139
133
|
function exportModel(_x, _x2) {
|
|
140
134
|
return _exportModel.apply(this, arguments);
|
|
@@ -259,36 +253,6 @@ var Export = /*#__PURE__*/function () {
|
|
|
259
253
|
}
|
|
260
254
|
return exportPLY;
|
|
261
255
|
}()
|
|
262
|
-
/**
|
|
263
|
-
* Export to Collada (DAE) format
|
|
264
|
-
* @param {THREE.Object3D} object - Object to export
|
|
265
|
-
* @param {Object} options - Export options
|
|
266
|
-
* @returns {Promise<string>} Collada XML string
|
|
267
|
-
*/
|
|
268
|
-
)
|
|
269
|
-
}, {
|
|
270
|
-
key: "exportCollada",
|
|
271
|
-
value: (function () {
|
|
272
|
-
var _exportCollada = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee6(object) {
|
|
273
|
-
var _this5 = this;
|
|
274
|
-
var options,
|
|
275
|
-
_args6 = arguments;
|
|
276
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
|
|
277
|
-
while (1) switch (_context6.n) {
|
|
278
|
-
case 0:
|
|
279
|
-
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
280
|
-
return _context6.a(2, new Promise(function (resolve) {
|
|
281
|
-
var result = _this5.exporters.collada.parse(object, options);
|
|
282
|
-
resolve(result.data);
|
|
283
|
-
}));
|
|
284
|
-
}
|
|
285
|
-
}, _callee6);
|
|
286
|
-
}));
|
|
287
|
-
function exportCollada(_x7) {
|
|
288
|
-
return _exportCollada.apply(this, arguments);
|
|
289
|
-
}
|
|
290
|
-
return exportCollada;
|
|
291
|
-
}()
|
|
292
256
|
/**
|
|
293
257
|
* Export scene configuration to JSON
|
|
294
258
|
* @param {THREE.Scene} scene - Scene to export
|
|
@@ -331,7 +295,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
331
295
|
}, {
|
|
332
296
|
key: "serializeObject",
|
|
333
297
|
value: function serializeObject(object) {
|
|
334
|
-
var
|
|
298
|
+
var _this5 = this;
|
|
335
299
|
var serialized = {
|
|
336
300
|
uuid: object.uuid,
|
|
337
301
|
name: object.name,
|
|
@@ -362,7 +326,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
362
326
|
|
|
363
327
|
// Recursively serialize children
|
|
364
328
|
object.children.forEach(function (child) {
|
|
365
|
-
serialized.children.push(
|
|
329
|
+
serialized.children.push(_this5.serializeObject(child));
|
|
366
330
|
});
|
|
367
331
|
return serialized;
|
|
368
332
|
}
|
|
@@ -535,7 +499,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
535
499
|
}, {
|
|
536
500
|
key: "exportToXML",
|
|
537
501
|
value: function exportToXML(data) {
|
|
538
|
-
var
|
|
502
|
+
var _this6 = this;
|
|
539
503
|
var rootElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'root';
|
|
540
504
|
var xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
541
505
|
var _objectToXML = function objectToXML(obj) {
|
|
@@ -554,12 +518,12 @@ var Export = /*#__PURE__*/function () {
|
|
|
554
518
|
if (_rollupPluginBabelHelpers["typeof"](item) === 'object') {
|
|
555
519
|
xml += '\n' + _objectToXML(item, indent + 1) + spaces;
|
|
556
520
|
} else {
|
|
557
|
-
xml +=
|
|
521
|
+
xml += _this6.escapeXML(item);
|
|
558
522
|
}
|
|
559
523
|
xml += "</".concat(key, ">\n");
|
|
560
524
|
});
|
|
561
525
|
} else {
|
|
562
|
-
xml += "".concat(spaces, "<").concat(key, ">").concat(
|
|
526
|
+
xml += "".concat(spaces, "<").concat(key, ">").concat(_this6.escapeXML(value), "</").concat(key, ">\n");
|
|
563
527
|
}
|
|
564
528
|
});
|
|
565
529
|
return xml;
|
|
@@ -611,63 +575,63 @@ var Export = /*#__PURE__*/function () {
|
|
|
611
575
|
}, {
|
|
612
576
|
key: "exportBatch",
|
|
613
577
|
value: (function () {
|
|
614
|
-
var _exportBatch = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function
|
|
578
|
+
var _exportBatch = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee6(objects) {
|
|
615
579
|
var results, errors, _iterator, _step, item, result, _t3, _t4;
|
|
616
|
-
return _rollupPluginBabelHelpers.regenerator().w(function (
|
|
617
|
-
while (1) switch (
|
|
580
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context6) {
|
|
581
|
+
while (1) switch (_context6.n) {
|
|
618
582
|
case 0:
|
|
619
583
|
debugLogger.logger.info("\uD83D\uDD04 Starting batch export of ".concat(objects.length, " objects..."));
|
|
620
584
|
results = [];
|
|
621
585
|
errors = [];
|
|
622
586
|
_iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(objects);
|
|
623
|
-
|
|
587
|
+
_context6.p = 1;
|
|
624
588
|
_iterator.s();
|
|
625
589
|
case 2:
|
|
626
590
|
if ((_step = _iterator.n()).done) {
|
|
627
|
-
|
|
591
|
+
_context6.n = 7;
|
|
628
592
|
break;
|
|
629
593
|
}
|
|
630
594
|
item = _step.value;
|
|
631
|
-
|
|
632
|
-
|
|
595
|
+
_context6.p = 3;
|
|
596
|
+
_context6.n = 4;
|
|
633
597
|
return this.exportModel(item.object, item.format, item.options);
|
|
634
598
|
case 4:
|
|
635
|
-
result =
|
|
599
|
+
result = _context6.v;
|
|
636
600
|
results.push(result);
|
|
637
|
-
|
|
601
|
+
_context6.n = 6;
|
|
638
602
|
break;
|
|
639
603
|
case 5:
|
|
640
|
-
|
|
641
|
-
_t3 =
|
|
604
|
+
_context6.p = 5;
|
|
605
|
+
_t3 = _context6.v;
|
|
642
606
|
errors.push({
|
|
643
607
|
object: item.object.name || 'Unnamed Object',
|
|
644
608
|
format: item.format,
|
|
645
609
|
error: _t3.message
|
|
646
610
|
});
|
|
647
611
|
case 6:
|
|
648
|
-
|
|
612
|
+
_context6.n = 2;
|
|
649
613
|
break;
|
|
650
614
|
case 7:
|
|
651
|
-
|
|
615
|
+
_context6.n = 9;
|
|
652
616
|
break;
|
|
653
617
|
case 8:
|
|
654
|
-
|
|
655
|
-
_t4 =
|
|
618
|
+
_context6.p = 8;
|
|
619
|
+
_t4 = _context6.v;
|
|
656
620
|
_iterator.e(_t4);
|
|
657
621
|
case 9:
|
|
658
|
-
|
|
622
|
+
_context6.p = 9;
|
|
659
623
|
_iterator.f();
|
|
660
|
-
return
|
|
624
|
+
return _context6.f(9);
|
|
661
625
|
case 10:
|
|
662
626
|
debugLogger.logger.info("\u2705 Batch export complete: ".concat(results.length, " successful, ").concat(errors.length, " failed"));
|
|
663
|
-
return
|
|
627
|
+
return _context6.a(2, {
|
|
664
628
|
results: results,
|
|
665
629
|
errors: errors
|
|
666
630
|
});
|
|
667
631
|
}
|
|
668
|
-
},
|
|
632
|
+
}, _callee6, this, [[3, 5], [1, 8, 9, 10]]);
|
|
669
633
|
}));
|
|
670
|
-
function exportBatch(
|
|
634
|
+
function exportBatch(_x7) {
|
|
671
635
|
return _exportBatch.apply(this, arguments);
|
|
672
636
|
}
|
|
673
637
|
return exportBatch;
|
|
@@ -12,7 +12,7 @@ import { SceneOperationsManager } from '../managers/scene/sceneOperationsManager
|
|
|
12
12
|
import { AnimationManager } from '../managers/components/animationManager.js';
|
|
13
13
|
import { CameraControlsManager } from '../managers/controls/cameraControlsManager.js';
|
|
14
14
|
import { SceneTooltipsManager } from '../managers/scene/sceneTooltipsManager.js';
|
|
15
|
-
import { generateUuidFromName, getHardcodedUuid } from './nameUtils.js';
|
|
15
|
+
import { generateUuidFromName, getHardcodedUuid, findObjectByHardcodedUuid } from './nameUtils.js';
|
|
16
16
|
import { logger, transformLogger, pathfinderLogger, modelLogger } from './debugLogger.js';
|
|
17
17
|
import modelPreloader from '../rendering/modelPreloader.js';
|
|
18
18
|
import DragDropManager from '../managers/controls/dragDropManager.js';
|
|
@@ -112,6 +112,7 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
112
112
|
// Name utilities
|
|
113
113
|
this.utilities.generateUuidFromName = generateUuidFromName;
|
|
114
114
|
this.utilities.getHardcodedUuid = getHardcodedUuid;
|
|
115
|
+
this.utilities.findObjectByHardcodedUuid = findObjectByHardcodedUuid;
|
|
115
116
|
|
|
116
117
|
// Loggers
|
|
117
118
|
this.utilities.logger = logger;
|
|
@@ -1160,6 +1161,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
1160
1161
|
return _objectSpread2({}, this.managers);
|
|
1161
1162
|
}
|
|
1162
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* Get a specific manager instance
|
|
1166
|
+
* @param {string} managerName - The name of the manager to retrieve
|
|
1167
|
+
* @returns {Object|null} The manager instance or null if not found
|
|
1168
|
+
*/
|
|
1169
|
+
}, {
|
|
1170
|
+
key: "getManager",
|
|
1171
|
+
value: function getManager(managerName) {
|
|
1172
|
+
return this.managers[managerName] || null;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1163
1175
|
/**
|
|
1164
1176
|
* Get all utilities for external access
|
|
1165
1177
|
* @returns {Object} All utility instances
|
|
@@ -1169,6 +1181,17 @@ var CentralPlant = /*#__PURE__*/function () {
|
|
|
1169
1181
|
value: function getAllUtilities() {
|
|
1170
1182
|
return _objectSpread2({}, this.utilities);
|
|
1171
1183
|
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* Get a specific utility instance
|
|
1187
|
+
* @param {string} utilityName - The name of the utility to retrieve
|
|
1188
|
+
* @returns {any|null} The utility instance or null if not found
|
|
1189
|
+
*/
|
|
1190
|
+
}, {
|
|
1191
|
+
key: "getUtility",
|
|
1192
|
+
value: function getUtility(utilityName) {
|
|
1193
|
+
return this.utilities[utilityName] || null;
|
|
1194
|
+
}
|
|
1172
1195
|
}]);
|
|
1173
1196
|
}();
|
|
1174
1197
|
|
|
@@ -16,7 +16,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
16
16
|
ply: new PLYExporter()
|
|
17
17
|
};
|
|
18
18
|
this.supportedFormats = {
|
|
19
|
-
models: ['gltf', 'glb', 'obj', 'stl', 'ply'
|
|
19
|
+
models: ['gltf', 'glb', 'obj', 'stl', 'ply'],
|
|
20
20
|
scenes: ['json'],
|
|
21
21
|
images: ['png', 'jpg', 'jpeg', 'webp'],
|
|
22
22
|
data: ['json', 'csv', 'xml']
|
|
@@ -59,41 +59,35 @@ var Export = /*#__PURE__*/function () {
|
|
|
59
59
|
includeCustomExtensions: false
|
|
60
60
|
}, options);
|
|
61
61
|
_t = format.toLowerCase();
|
|
62
|
-
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 :
|
|
62
|
+
_context.n = _t === 'gltf' ? 2 : _t === 'glb' ? 2 : _t === 'obj' ? 4 : _t === 'stl' ? 6 : _t === 'ply' ? 8 : 10;
|
|
63
63
|
break;
|
|
64
64
|
case 2:
|
|
65
65
|
_context.n = 3;
|
|
66
66
|
return this.exportGLTF(object, exportOptions);
|
|
67
67
|
case 3:
|
|
68
68
|
result = _context.v;
|
|
69
|
-
return _context.a(3,
|
|
69
|
+
return _context.a(3, 11);
|
|
70
70
|
case 4:
|
|
71
71
|
_context.n = 5;
|
|
72
72
|
return this.exportOBJ(object, exportOptions);
|
|
73
73
|
case 5:
|
|
74
74
|
result = _context.v;
|
|
75
|
-
return _context.a(3,
|
|
75
|
+
return _context.a(3, 11);
|
|
76
76
|
case 6:
|
|
77
77
|
_context.n = 7;
|
|
78
78
|
return this.exportSTL(object, exportOptions);
|
|
79
79
|
case 7:
|
|
80
80
|
result = _context.v;
|
|
81
|
-
return _context.a(3,
|
|
81
|
+
return _context.a(3, 11);
|
|
82
82
|
case 8:
|
|
83
83
|
_context.n = 9;
|
|
84
84
|
return this.exportPLY(object, exportOptions);
|
|
85
85
|
case 9:
|
|
86
86
|
result = _context.v;
|
|
87
|
-
return _context.a(3,
|
|
87
|
+
return _context.a(3, 11);
|
|
88
88
|
case 10:
|
|
89
|
-
_context.n = 11;
|
|
90
|
-
return this.exportCollada(object, exportOptions);
|
|
91
|
-
case 11:
|
|
92
|
-
result = _context.v;
|
|
93
|
-
return _context.a(3, 13);
|
|
94
|
-
case 12:
|
|
95
89
|
throw new Error("Unsupported format: ".concat(format));
|
|
96
|
-
case
|
|
90
|
+
case 11:
|
|
97
91
|
exportTime = performance.now() - startTime;
|
|
98
92
|
exportRecord = {
|
|
99
93
|
timestamp: new Date().toISOString(),
|
|
@@ -111,8 +105,8 @@ var Export = /*#__PURE__*/function () {
|
|
|
111
105
|
exportTime: exportTime,
|
|
112
106
|
filename: this.generateFilename(object.name || 'model', format)
|
|
113
107
|
});
|
|
114
|
-
case
|
|
115
|
-
_context.p =
|
|
108
|
+
case 12:
|
|
109
|
+
_context.p = 12;
|
|
116
110
|
_t2 = _context.v;
|
|
117
111
|
_exportTime = performance.now() - startTime;
|
|
118
112
|
_exportRecord = {
|
|
@@ -127,10 +121,10 @@ var Export = /*#__PURE__*/function () {
|
|
|
127
121
|
this.exportHistory.push(_exportRecord);
|
|
128
122
|
logger.error("\u274C Failed to export model to ".concat(format.toUpperCase(), ":"), _t2);
|
|
129
123
|
throw _t2;
|
|
130
|
-
case
|
|
124
|
+
case 13:
|
|
131
125
|
return _context.a(2);
|
|
132
126
|
}
|
|
133
|
-
}, _callee, this, [[1,
|
|
127
|
+
}, _callee, this, [[1, 12]]);
|
|
134
128
|
}));
|
|
135
129
|
function exportModel(_x, _x2) {
|
|
136
130
|
return _exportModel.apply(this, arguments);
|
|
@@ -255,36 +249,6 @@ var Export = /*#__PURE__*/function () {
|
|
|
255
249
|
}
|
|
256
250
|
return exportPLY;
|
|
257
251
|
}()
|
|
258
|
-
/**
|
|
259
|
-
* Export to Collada (DAE) format
|
|
260
|
-
* @param {THREE.Object3D} object - Object to export
|
|
261
|
-
* @param {Object} options - Export options
|
|
262
|
-
* @returns {Promise<string>} Collada XML string
|
|
263
|
-
*/
|
|
264
|
-
)
|
|
265
|
-
}, {
|
|
266
|
-
key: "exportCollada",
|
|
267
|
-
value: (function () {
|
|
268
|
-
var _exportCollada = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(object) {
|
|
269
|
-
var _this5 = this;
|
|
270
|
-
var options,
|
|
271
|
-
_args6 = arguments;
|
|
272
|
-
return _regenerator().w(function (_context6) {
|
|
273
|
-
while (1) switch (_context6.n) {
|
|
274
|
-
case 0:
|
|
275
|
-
options = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
|
|
276
|
-
return _context6.a(2, new Promise(function (resolve) {
|
|
277
|
-
var result = _this5.exporters.collada.parse(object, options);
|
|
278
|
-
resolve(result.data);
|
|
279
|
-
}));
|
|
280
|
-
}
|
|
281
|
-
}, _callee6);
|
|
282
|
-
}));
|
|
283
|
-
function exportCollada(_x7) {
|
|
284
|
-
return _exportCollada.apply(this, arguments);
|
|
285
|
-
}
|
|
286
|
-
return exportCollada;
|
|
287
|
-
}()
|
|
288
252
|
/**
|
|
289
253
|
* Export scene configuration to JSON
|
|
290
254
|
* @param {THREE.Scene} scene - Scene to export
|
|
@@ -327,7 +291,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
327
291
|
}, {
|
|
328
292
|
key: "serializeObject",
|
|
329
293
|
value: function serializeObject(object) {
|
|
330
|
-
var
|
|
294
|
+
var _this5 = this;
|
|
331
295
|
var serialized = {
|
|
332
296
|
uuid: object.uuid,
|
|
333
297
|
name: object.name,
|
|
@@ -358,7 +322,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
358
322
|
|
|
359
323
|
// Recursively serialize children
|
|
360
324
|
object.children.forEach(function (child) {
|
|
361
|
-
serialized.children.push(
|
|
325
|
+
serialized.children.push(_this5.serializeObject(child));
|
|
362
326
|
});
|
|
363
327
|
return serialized;
|
|
364
328
|
}
|
|
@@ -531,7 +495,7 @@ var Export = /*#__PURE__*/function () {
|
|
|
531
495
|
}, {
|
|
532
496
|
key: "exportToXML",
|
|
533
497
|
value: function exportToXML(data) {
|
|
534
|
-
var
|
|
498
|
+
var _this6 = this;
|
|
535
499
|
var rootElement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'root';
|
|
536
500
|
var xmlHeader = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
537
501
|
var _objectToXML = function objectToXML(obj) {
|
|
@@ -550,12 +514,12 @@ var Export = /*#__PURE__*/function () {
|
|
|
550
514
|
if (_typeof(item) === 'object') {
|
|
551
515
|
xml += '\n' + _objectToXML(item, indent + 1) + spaces;
|
|
552
516
|
} else {
|
|
553
|
-
xml +=
|
|
517
|
+
xml += _this6.escapeXML(item);
|
|
554
518
|
}
|
|
555
519
|
xml += "</".concat(key, ">\n");
|
|
556
520
|
});
|
|
557
521
|
} else {
|
|
558
|
-
xml += "".concat(spaces, "<").concat(key, ">").concat(
|
|
522
|
+
xml += "".concat(spaces, "<").concat(key, ">").concat(_this6.escapeXML(value), "</").concat(key, ">\n");
|
|
559
523
|
}
|
|
560
524
|
});
|
|
561
525
|
return xml;
|
|
@@ -607,63 +571,63 @@ var Export = /*#__PURE__*/function () {
|
|
|
607
571
|
}, {
|
|
608
572
|
key: "exportBatch",
|
|
609
573
|
value: (function () {
|
|
610
|
-
var _exportBatch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
574
|
+
var _exportBatch = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(objects) {
|
|
611
575
|
var results, errors, _iterator, _step, item, result, _t3, _t4;
|
|
612
|
-
return _regenerator().w(function (
|
|
613
|
-
while (1) switch (
|
|
576
|
+
return _regenerator().w(function (_context6) {
|
|
577
|
+
while (1) switch (_context6.n) {
|
|
614
578
|
case 0:
|
|
615
579
|
logger.info("\uD83D\uDD04 Starting batch export of ".concat(objects.length, " objects..."));
|
|
616
580
|
results = [];
|
|
617
581
|
errors = [];
|
|
618
582
|
_iterator = _createForOfIteratorHelper(objects);
|
|
619
|
-
|
|
583
|
+
_context6.p = 1;
|
|
620
584
|
_iterator.s();
|
|
621
585
|
case 2:
|
|
622
586
|
if ((_step = _iterator.n()).done) {
|
|
623
|
-
|
|
587
|
+
_context6.n = 7;
|
|
624
588
|
break;
|
|
625
589
|
}
|
|
626
590
|
item = _step.value;
|
|
627
|
-
|
|
628
|
-
|
|
591
|
+
_context6.p = 3;
|
|
592
|
+
_context6.n = 4;
|
|
629
593
|
return this.exportModel(item.object, item.format, item.options);
|
|
630
594
|
case 4:
|
|
631
|
-
result =
|
|
595
|
+
result = _context6.v;
|
|
632
596
|
results.push(result);
|
|
633
|
-
|
|
597
|
+
_context6.n = 6;
|
|
634
598
|
break;
|
|
635
599
|
case 5:
|
|
636
|
-
|
|
637
|
-
_t3 =
|
|
600
|
+
_context6.p = 5;
|
|
601
|
+
_t3 = _context6.v;
|
|
638
602
|
errors.push({
|
|
639
603
|
object: item.object.name || 'Unnamed Object',
|
|
640
604
|
format: item.format,
|
|
641
605
|
error: _t3.message
|
|
642
606
|
});
|
|
643
607
|
case 6:
|
|
644
|
-
|
|
608
|
+
_context6.n = 2;
|
|
645
609
|
break;
|
|
646
610
|
case 7:
|
|
647
|
-
|
|
611
|
+
_context6.n = 9;
|
|
648
612
|
break;
|
|
649
613
|
case 8:
|
|
650
|
-
|
|
651
|
-
_t4 =
|
|
614
|
+
_context6.p = 8;
|
|
615
|
+
_t4 = _context6.v;
|
|
652
616
|
_iterator.e(_t4);
|
|
653
617
|
case 9:
|
|
654
|
-
|
|
618
|
+
_context6.p = 9;
|
|
655
619
|
_iterator.f();
|
|
656
|
-
return
|
|
620
|
+
return _context6.f(9);
|
|
657
621
|
case 10:
|
|
658
622
|
logger.info("\u2705 Batch export complete: ".concat(results.length, " successful, ").concat(errors.length, " failed"));
|
|
659
|
-
return
|
|
623
|
+
return _context6.a(2, {
|
|
660
624
|
results: results,
|
|
661
625
|
errors: errors
|
|
662
626
|
});
|
|
663
627
|
}
|
|
664
|
-
},
|
|
628
|
+
}, _callee6, this, [[3, 5], [1, 8, 9, 10]]);
|
|
665
629
|
}));
|
|
666
|
-
function exportBatch(
|
|
630
|
+
function exportBatch(_x7) {
|
|
667
631
|
return _exportBatch.apply(this, arguments);
|
|
668
632
|
}
|
|
669
633
|
return exportBatch;
|