hytopia 0.3.32 → 0.3.33
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/bin/scripts.js +42 -0
- package/package.json +1 -1
- package/examples/child-entity/assets/models/.optimized/baseColor.png +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/baseColor.png +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/sword.bin +0 -0
- package/examples/child-entity/assets/models/.optimized/sword/sword.gltf +0 -356
- package/examples/child-entity/assets/models/.optimized/sword.bin +0 -0
- package/examples/child-entity/assets/models/.optimized/sword.gltf +0 -136
package/bin/scripts.js
CHANGED
@@ -268,6 +268,48 @@ function packageProject() {
|
|
268
268
|
console.error('❌ Error: Could not read package.json file:', err.message);
|
269
269
|
return;
|
270
270
|
}
|
271
|
+
|
272
|
+
// Make sure assets exist and the model optimizer has been ran
|
273
|
+
const assetsDir = path.join(sourceDir, 'assets');
|
274
|
+
let hasOptimizedDir = false;
|
275
|
+
|
276
|
+
if (fs.existsSync(assetsDir)) {
|
277
|
+
// Function to recursively check for .optimized directories
|
278
|
+
const checkForOptimizedDir = (dir) => {
|
279
|
+
const items = fs.readdirSync(dir);
|
280
|
+
|
281
|
+
for (const item of items) {
|
282
|
+
const itemPath = path.join(dir, item);
|
283
|
+
const stats = fs.statSync(itemPath);
|
284
|
+
|
285
|
+
if (stats.isDirectory()) {
|
286
|
+
if (item === '.optimized') {
|
287
|
+
hasOptimizedDir = true;
|
288
|
+
return true;
|
289
|
+
}
|
290
|
+
|
291
|
+
// Check subdirectories
|
292
|
+
if (checkForOptimizedDir(itemPath)) {
|
293
|
+
return true;
|
294
|
+
}
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
return false;
|
299
|
+
};
|
300
|
+
|
301
|
+
checkForOptimizedDir(assetsDir);
|
302
|
+
|
303
|
+
if (!hasOptimizedDir) {
|
304
|
+
console.warn('❌ Error: No .optimized directories found in the assets folder.');
|
305
|
+
console.warn(' Make sure your server has ran the optimizer for your models.');
|
306
|
+
console.warn(' This can be done by running your server with: bun --watch index.ts');
|
307
|
+
return;
|
308
|
+
}
|
309
|
+
} else {
|
310
|
+
console.warn('❌ Error: No assets directory found in the project.');
|
311
|
+
return;
|
312
|
+
}
|
271
313
|
|
272
314
|
// Prepare to package
|
273
315
|
const outputFile = path.join(sourceDir, `${projectName}.zip`);
|
package/package.json
CHANGED
Binary file
|
Binary file
|
Binary file
|
@@ -1,356 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"asset": {
|
3
|
-
"generator": "glTF-Transform v4.1.1",
|
4
|
-
"version": "2.0"
|
5
|
-
},
|
6
|
-
"accessors": [
|
7
|
-
{
|
8
|
-
"type": "SCALAR",
|
9
|
-
"componentType": 5123,
|
10
|
-
"count": 36,
|
11
|
-
"bufferView": 0,
|
12
|
-
"byteOffset": 0
|
13
|
-
},
|
14
|
-
{
|
15
|
-
"type": "VEC3",
|
16
|
-
"componentType": 5126,
|
17
|
-
"count": 24,
|
18
|
-
"max": [
|
19
|
-
0.140625,
|
20
|
-
1.7109375,
|
21
|
-
0.03125
|
22
|
-
],
|
23
|
-
"min": [
|
24
|
-
-0.171875,
|
25
|
-
0.5234375,
|
26
|
-
-0.09375
|
27
|
-
],
|
28
|
-
"bufferView": 1,
|
29
|
-
"byteOffset": 0
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"type": "VEC3",
|
33
|
-
"componentType": 5126,
|
34
|
-
"count": 24,
|
35
|
-
"bufferView": 1,
|
36
|
-
"byteOffset": 12
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"type": "VEC2",
|
40
|
-
"componentType": 5126,
|
41
|
-
"count": 24,
|
42
|
-
"bufferView": 1,
|
43
|
-
"byteOffset": 24
|
44
|
-
},
|
45
|
-
{
|
46
|
-
"type": "VEC3",
|
47
|
-
"componentType": 5126,
|
48
|
-
"count": 24,
|
49
|
-
"max": [
|
50
|
-
0.0625,
|
51
|
-
1.0625,
|
52
|
-
0.0625
|
53
|
-
],
|
54
|
-
"min": [
|
55
|
-
-0.0625,
|
56
|
-
0.625,
|
57
|
-
-0.0625
|
58
|
-
],
|
59
|
-
"bufferView": 2,
|
60
|
-
"byteOffset": 0
|
61
|
-
},
|
62
|
-
{
|
63
|
-
"type": "VEC2",
|
64
|
-
"componentType": 5126,
|
65
|
-
"count": 24,
|
66
|
-
"bufferView": 2,
|
67
|
-
"byteOffset": 12
|
68
|
-
},
|
69
|
-
{
|
70
|
-
"type": "VEC3",
|
71
|
-
"componentType": 5126,
|
72
|
-
"count": 24,
|
73
|
-
"max": [
|
74
|
-
0.09375,
|
75
|
-
0.15625,
|
76
|
-
0.09375
|
77
|
-
],
|
78
|
-
"min": [
|
79
|
-
-0.15625,
|
80
|
-
-0.09375,
|
81
|
-
-0.09375
|
82
|
-
],
|
83
|
-
"bufferView": 3,
|
84
|
-
"byteOffset": 0
|
85
|
-
},
|
86
|
-
{
|
87
|
-
"type": "VEC2",
|
88
|
-
"componentType": 5126,
|
89
|
-
"count": 24,
|
90
|
-
"bufferView": 3,
|
91
|
-
"byteOffset": 12
|
92
|
-
},
|
93
|
-
{
|
94
|
-
"type": "VEC3",
|
95
|
-
"componentType": 5126,
|
96
|
-
"count": 24,
|
97
|
-
"max": [
|
98
|
-
0.15625,
|
99
|
-
0.09375,
|
100
|
-
0.0000625000029685907
|
101
|
-
],
|
102
|
-
"min": [
|
103
|
-
-0.15625,
|
104
|
-
-0.09375,
|
105
|
-
3.469446951953614e-18
|
106
|
-
],
|
107
|
-
"bufferView": 4,
|
108
|
-
"byteOffset": 0
|
109
|
-
},
|
110
|
-
{
|
111
|
-
"type": "VEC2",
|
112
|
-
"componentType": 5126,
|
113
|
-
"count": 24,
|
114
|
-
"bufferView": 4,
|
115
|
-
"byteOffset": 12
|
116
|
-
},
|
117
|
-
{
|
118
|
-
"type": "VEC3",
|
119
|
-
"componentType": 5126,
|
120
|
-
"count": 24,
|
121
|
-
"max": [
|
122
|
-
0.515625,
|
123
|
-
-0.01718750037252903,
|
124
|
-
0.046875
|
125
|
-
],
|
126
|
-
"min": [
|
127
|
-
-0.171875,
|
128
|
-
-0.20468750596046448,
|
129
|
-
-0.140625
|
130
|
-
],
|
131
|
-
"bufferView": 5,
|
132
|
-
"byteOffset": 0
|
133
|
-
},
|
134
|
-
{
|
135
|
-
"type": "VEC2",
|
136
|
-
"componentType": 5126,
|
137
|
-
"count": 24,
|
138
|
-
"bufferView": 5,
|
139
|
-
"byteOffset": 12
|
140
|
-
}
|
141
|
-
],
|
142
|
-
"bufferViews": [
|
143
|
-
{
|
144
|
-
"buffer": 0,
|
145
|
-
"byteOffset": 0,
|
146
|
-
"byteLength": 72,
|
147
|
-
"target": 34963
|
148
|
-
},
|
149
|
-
{
|
150
|
-
"buffer": 0,
|
151
|
-
"byteOffset": 72,
|
152
|
-
"byteLength": 768,
|
153
|
-
"byteStride": 32,
|
154
|
-
"target": 34962
|
155
|
-
},
|
156
|
-
{
|
157
|
-
"buffer": 0,
|
158
|
-
"byteOffset": 840,
|
159
|
-
"byteLength": 480,
|
160
|
-
"byteStride": 20,
|
161
|
-
"target": 34962
|
162
|
-
},
|
163
|
-
{
|
164
|
-
"buffer": 0,
|
165
|
-
"byteOffset": 1320,
|
166
|
-
"byteLength": 480,
|
167
|
-
"byteStride": 20,
|
168
|
-
"target": 34962
|
169
|
-
},
|
170
|
-
{
|
171
|
-
"buffer": 0,
|
172
|
-
"byteOffset": 1800,
|
173
|
-
"byteLength": 480,
|
174
|
-
"byteStride": 20,
|
175
|
-
"target": 34962
|
176
|
-
},
|
177
|
-
{
|
178
|
-
"buffer": 0,
|
179
|
-
"byteOffset": 2280,
|
180
|
-
"byteLength": 480,
|
181
|
-
"byteStride": 20,
|
182
|
-
"target": 34962
|
183
|
-
}
|
184
|
-
],
|
185
|
-
"samplers": [
|
186
|
-
{
|
187
|
-
"magFilter": 9728,
|
188
|
-
"minFilter": 9728,
|
189
|
-
"wrapS": 33071,
|
190
|
-
"wrapT": 33071
|
191
|
-
}
|
192
|
-
],
|
193
|
-
"textures": [
|
194
|
-
{
|
195
|
-
"source": 0,
|
196
|
-
"sampler": 0
|
197
|
-
}
|
198
|
-
],
|
199
|
-
"images": [
|
200
|
-
{
|
201
|
-
"mimeType": "image/png",
|
202
|
-
"uri": "baseColor.png"
|
203
|
-
}
|
204
|
-
],
|
205
|
-
"buffers": [
|
206
|
-
{
|
207
|
-
"uri": "sword.bin",
|
208
|
-
"byteLength": 2760
|
209
|
-
}
|
210
|
-
],
|
211
|
-
"materials": [
|
212
|
-
{
|
213
|
-
"alphaMode": "MASK",
|
214
|
-
"alphaCutoff": 0.05,
|
215
|
-
"doubleSided": true,
|
216
|
-
"pbrMetallicRoughness": {
|
217
|
-
"metallicFactor": 0,
|
218
|
-
"baseColorTexture": {
|
219
|
-
"index": 0
|
220
|
-
}
|
221
|
-
}
|
222
|
-
}
|
223
|
-
],
|
224
|
-
"meshes": [
|
225
|
-
{
|
226
|
-
"primitives": [
|
227
|
-
{
|
228
|
-
"attributes": {
|
229
|
-
"POSITION": 1,
|
230
|
-
"NORMAL": 2,
|
231
|
-
"TEXCOORD_0": 3
|
232
|
-
},
|
233
|
-
"mode": 4,
|
234
|
-
"material": 0,
|
235
|
-
"indices": 0
|
236
|
-
}
|
237
|
-
]
|
238
|
-
},
|
239
|
-
{
|
240
|
-
"primitives": [
|
241
|
-
{
|
242
|
-
"attributes": {
|
243
|
-
"POSITION": 4,
|
244
|
-
"TEXCOORD_0": 5,
|
245
|
-
"NORMAL": 2
|
246
|
-
},
|
247
|
-
"mode": 4,
|
248
|
-
"material": 0,
|
249
|
-
"indices": 0
|
250
|
-
}
|
251
|
-
]
|
252
|
-
},
|
253
|
-
{
|
254
|
-
"primitives": [
|
255
|
-
{
|
256
|
-
"attributes": {
|
257
|
-
"POSITION": 6,
|
258
|
-
"TEXCOORD_0": 7,
|
259
|
-
"NORMAL": 2
|
260
|
-
},
|
261
|
-
"mode": 4,
|
262
|
-
"material": 0,
|
263
|
-
"indices": 0
|
264
|
-
}
|
265
|
-
]
|
266
|
-
},
|
267
|
-
{
|
268
|
-
"primitives": [
|
269
|
-
{
|
270
|
-
"attributes": {
|
271
|
-
"POSITION": 8,
|
272
|
-
"TEXCOORD_0": 9,
|
273
|
-
"NORMAL": 2
|
274
|
-
},
|
275
|
-
"mode": 4,
|
276
|
-
"material": 0,
|
277
|
-
"indices": 0
|
278
|
-
}
|
279
|
-
]
|
280
|
-
},
|
281
|
-
{
|
282
|
-
"primitives": [
|
283
|
-
{
|
284
|
-
"attributes": {
|
285
|
-
"POSITION": 10,
|
286
|
-
"TEXCOORD_0": 11,
|
287
|
-
"NORMAL": 2
|
288
|
-
},
|
289
|
-
"mode": 4,
|
290
|
-
"material": 0,
|
291
|
-
"indices": 0
|
292
|
-
}
|
293
|
-
]
|
294
|
-
}
|
295
|
-
],
|
296
|
-
"nodes": [
|
297
|
-
{
|
298
|
-
"name": "cube",
|
299
|
-
"translation": [
|
300
|
-
0.01562500004975372,
|
301
|
-
0.3515625,
|
302
|
-
0.031249999975123153
|
303
|
-
],
|
304
|
-
"mesh": 0
|
305
|
-
},
|
306
|
-
{
|
307
|
-
"name": "cube",
|
308
|
-
"translation": [
|
309
|
-
0,
|
310
|
-
-0.375,
|
311
|
-
4.419015442517403e-26
|
312
|
-
],
|
313
|
-
"mesh": 1
|
314
|
-
},
|
315
|
-
{
|
316
|
-
"name": "cube",
|
317
|
-
"translation": [
|
318
|
-
0.03125,
|
319
|
-
0.09531250000000013,
|
320
|
-
-4.9753690750664564e-11
|
321
|
-
],
|
322
|
-
"mesh": 2
|
323
|
-
},
|
324
|
-
{
|
325
|
-
"name": "cube",
|
326
|
-
"translation": [
|
327
|
-
0,
|
328
|
-
2.15625,
|
329
|
-
-3.469446951953614e-18
|
330
|
-
],
|
331
|
-
"mesh": 3
|
332
|
-
},
|
333
|
-
{
|
334
|
-
"name": "cube",
|
335
|
-
"translation": [
|
336
|
-
-0.17187499993780792,
|
337
|
-
0.8921875000000001,
|
338
|
-
0.0468750002736453
|
339
|
-
],
|
340
|
-
"mesh": 4
|
341
|
-
}
|
342
|
-
],
|
343
|
-
"scenes": [
|
344
|
-
{
|
345
|
-
"name": "blockbench_export",
|
346
|
-
"nodes": [
|
347
|
-
0,
|
348
|
-
1,
|
349
|
-
2,
|
350
|
-
3,
|
351
|
-
4
|
352
|
-
]
|
353
|
-
}
|
354
|
-
],
|
355
|
-
"scene": 0
|
356
|
-
}
|
Binary file
|
@@ -1,136 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"asset": {
|
3
|
-
"generator": "glTF-Transform v4.1.1",
|
4
|
-
"version": "2.0"
|
5
|
-
},
|
6
|
-
"accessors": [
|
7
|
-
{
|
8
|
-
"type": "SCALAR",
|
9
|
-
"componentType": 5123,
|
10
|
-
"count": 180,
|
11
|
-
"bufferView": 0,
|
12
|
-
"byteOffset": 0
|
13
|
-
},
|
14
|
-
{
|
15
|
-
"type": "VEC3",
|
16
|
-
"componentType": 5126,
|
17
|
-
"count": 120,
|
18
|
-
"max": [
|
19
|
-
0.328125,
|
20
|
-
1.8984375,
|
21
|
-
0.0625
|
22
|
-
],
|
23
|
-
"min": [
|
24
|
-
-0.359375,
|
25
|
-
-0.3499999940395355,
|
26
|
-
-0.125
|
27
|
-
],
|
28
|
-
"bufferView": 1,
|
29
|
-
"byteOffset": 0
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"type": "VEC3",
|
33
|
-
"componentType": 5126,
|
34
|
-
"count": 120,
|
35
|
-
"bufferView": 1,
|
36
|
-
"byteOffset": 12
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"type": "VEC2",
|
40
|
-
"componentType": 5126,
|
41
|
-
"count": 120,
|
42
|
-
"bufferView": 1,
|
43
|
-
"byteOffset": 24
|
44
|
-
}
|
45
|
-
],
|
46
|
-
"bufferViews": [
|
47
|
-
{
|
48
|
-
"buffer": 0,
|
49
|
-
"byteOffset": 0,
|
50
|
-
"byteLength": 360,
|
51
|
-
"target": 34963
|
52
|
-
},
|
53
|
-
{
|
54
|
-
"buffer": 0,
|
55
|
-
"byteOffset": 360,
|
56
|
-
"byteLength": 3840,
|
57
|
-
"byteStride": 32,
|
58
|
-
"target": 34962
|
59
|
-
}
|
60
|
-
],
|
61
|
-
"samplers": [
|
62
|
-
{
|
63
|
-
"magFilter": 9728,
|
64
|
-
"minFilter": 9728,
|
65
|
-
"wrapS": 33071,
|
66
|
-
"wrapT": 33071
|
67
|
-
}
|
68
|
-
],
|
69
|
-
"textures": [
|
70
|
-
{
|
71
|
-
"source": 0,
|
72
|
-
"sampler": 0
|
73
|
-
}
|
74
|
-
],
|
75
|
-
"images": [
|
76
|
-
{
|
77
|
-
"mimeType": "image/png",
|
78
|
-
"uri": "baseColor.png"
|
79
|
-
}
|
80
|
-
],
|
81
|
-
"buffers": [
|
82
|
-
{
|
83
|
-
"uri": "sword.bin",
|
84
|
-
"byteLength": 4200
|
85
|
-
}
|
86
|
-
],
|
87
|
-
"materials": [
|
88
|
-
{
|
89
|
-
"alphaMode": "MASK",
|
90
|
-
"alphaCutoff": 0.05,
|
91
|
-
"doubleSided": true,
|
92
|
-
"pbrMetallicRoughness": {
|
93
|
-
"metallicFactor": 0,
|
94
|
-
"baseColorTexture": {
|
95
|
-
"index": 0
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
],
|
100
|
-
"meshes": [
|
101
|
-
{
|
102
|
-
"primitives": [
|
103
|
-
{
|
104
|
-
"attributes": {
|
105
|
-
"POSITION": 1,
|
106
|
-
"NORMAL": 2,
|
107
|
-
"TEXCOORD_0": 3
|
108
|
-
},
|
109
|
-
"mode": 4,
|
110
|
-
"material": 0,
|
111
|
-
"indices": 0
|
112
|
-
}
|
113
|
-
]
|
114
|
-
}
|
115
|
-
],
|
116
|
-
"nodes": [
|
117
|
-
{
|
118
|
-
"name": "cube",
|
119
|
-
"translation": [
|
120
|
-
0.01562500004975372,
|
121
|
-
0.3515625,
|
122
|
-
0.031249999975123153
|
123
|
-
],
|
124
|
-
"mesh": 0
|
125
|
-
}
|
126
|
-
],
|
127
|
-
"scenes": [
|
128
|
-
{
|
129
|
-
"name": "blockbench_export",
|
130
|
-
"nodes": [
|
131
|
-
0
|
132
|
-
]
|
133
|
-
}
|
134
|
-
],
|
135
|
-
"scene": 0
|
136
|
-
}
|