@taptap/maker 0.0.41-beta.1 → 0.0.41-beta.2

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.
@@ -0,0 +1,601 @@
1
+ {
2
+ "size": [1536, 864],
3
+ "reference": "source/full.png",
4
+ "background": "source/empty.png",
5
+ "objects": [
6
+ {
7
+ "id": "cabinet",
8
+ "label": "书柜",
9
+ "bbox": [18, 148, 299, 451],
10
+ "source": "source/room-furniture-v2_20261106072404.png",
11
+ "extractRect": [90, 20, 435, 530],
12
+ "parent": null,
13
+ "motion": "rock",
14
+ "start": 4.2,
15
+ "duration": 1.5,
16
+ "pivot": [0.5, 1],
17
+ "zIndex": 9,
18
+ "category": "furniture",
19
+ "speed": 1
20
+ },
21
+ {
22
+ "id": "plant",
23
+ "label": "盆栽",
24
+ "bbox": [428, 316, 162, 162],
25
+ "source": "source/room-furniture-v2_20261106072404.png",
26
+ "extractRect": [540, 65, 990, 525],
27
+ "parent": null,
28
+ "motion": "spring",
29
+ "start": 4.4,
30
+ "duration": 1.2,
31
+ "pivot": [0.5, 1],
32
+ "zIndex": 10,
33
+ "category": "furniture",
34
+ "speed": 1
35
+ },
36
+ {
37
+ "id": "chair",
38
+ "label": "红椅",
39
+ "bbox": [276, 419, 194, 279],
40
+ "source": "source/room-furniture-v2_20261106072404.png",
41
+ "extractRect": [1110, 30, 1510, 532],
42
+ "parent": null,
43
+ "motion": "spring",
44
+ "start": 5.1,
45
+ "duration": 1.2,
46
+ "pivot": [0.5, 1],
47
+ "zIndex": 14,
48
+ "category": "furniture",
49
+ "speed": 1
50
+ },
51
+ {
52
+ "id": "sofa",
53
+ "label": "沙发",
54
+ "bbox": [1045, 369, 485, 305],
55
+ "source": "source/room-furniture-v2_20261106072404.png",
56
+ "extractRect": [15, 580, 550, 964],
57
+ "parent": null,
58
+ "motion": "spring",
59
+ "start": 5.5,
60
+ "duration": 1.2,
61
+ "pivot": [0.5, 1],
62
+ "zIndex": 15,
63
+ "category": "furniture",
64
+ "speed": 1
65
+ },
66
+ {
67
+ "id": "tea_table",
68
+ "label": "茶几",
69
+ "bbox": [1027, 591, 346, 188],
70
+ "source": "source/room-furniture-v2_20261106072404.png",
71
+ "extractRect": [575, 650, 1070, 928],
72
+ "parent": null,
73
+ "motion": "spring",
74
+ "start": 5.7,
75
+ "duration": 1.2,
76
+ "pivot": [0.5, 1],
77
+ "zIndex": 22,
78
+ "category": "furniture",
79
+ "speed": 1
80
+ },
81
+ {
82
+ "id": "side_table",
83
+ "label": "金边桌",
84
+ "bbox": [875, 395, 99, 73],
85
+ "source": "source/room-furniture-v2_20261106072404.png",
86
+ "extractRect": [1105, 610, 1460, 960],
87
+ "parent": null,
88
+ "motion": "spring",
89
+ "start": 3.6,
90
+ "duration": 1.2,
91
+ "pivot": [0.5, 1],
92
+ "zIndex": 12,
93
+ "category": "furniture",
94
+ "speed": 1
95
+ },
96
+ {
97
+ "id": "pillow_left",
98
+ "label": "左靠垫",
99
+ "bbox": [1167, 427, 120, 91],
100
+ "source": "source/room-props-v2_20261106072526.png",
101
+ "extractRect": [20, 100, 485, 455],
102
+ "parent": "sofa",
103
+ "motion": "spring",
104
+ "start": 6.8,
105
+ "duration": 1.0,
106
+ "pivot": [0.5, 1],
107
+ "zIndex": 16,
108
+ "category": "props",
109
+ "speed": 1
110
+ },
111
+ {
112
+ "id": "pillow_right",
113
+ "label": "右靠垫",
114
+ "bbox": [1320, 445, 105, 91],
115
+ "parent": "sofa",
116
+ "start": 6.95,
117
+ "zIndex": 17,
118
+ "reuseOf": "pillow_left",
119
+ "reuseReason": "同造型资源共用;位置、尺寸、层级和入场时间独立保存。",
120
+ "category": "props",
121
+ "speed": 1
122
+ },
123
+ {
124
+ "id": "teapot",
125
+ "label": "茶壶",
126
+ "bbox": [1147, 527, 151, 113],
127
+ "source": "source/room-props-v2_20261106072526.png",
128
+ "extractRect": [1036, 85, 1520, 468],
129
+ "parent": "tea_table",
130
+ "motion": "spring",
131
+ "start": 7.0,
132
+ "duration": 1.0,
133
+ "pivot": [0.5, 1],
134
+ "zIndex": 23,
135
+ "category": "props",
136
+ "speed": 1
137
+ },
138
+ {
139
+ "id": "cup_left",
140
+ "label": "左茶杯",
141
+ "bbox": [1090, 594, 77, 53],
142
+ "source": "source/room-props-v2_20261106072526.png",
143
+ "extractRect": [30, 592, 488, 944],
144
+ "parent": "tea_table",
145
+ "motion": "spring",
146
+ "start": 7.2,
147
+ "duration": 1.0,
148
+ "pivot": [0.5, 1],
149
+ "zIndex": 24,
150
+ "category": "props",
151
+ "speed": 1
152
+ },
153
+ {
154
+ "id": "cup_right",
155
+ "label": "右茶杯",
156
+ "bbox": [1233, 614, 73, 48],
157
+ "parent": "tea_table",
158
+ "start": 7.4,
159
+ "zIndex": 25,
160
+ "reuseOf": "cup_left",
161
+ "reuseReason": "同造型资源共用;位置、尺寸、层级和入场时间独立保存。",
162
+ "category": "props",
163
+ "speed": 1
164
+ },
165
+ {
166
+ "id": "fruit",
167
+ "label": "果盘",
168
+ "bbox": [889, 344, 70, 61],
169
+ "source": "source/room-props-v2_20261106072526.png",
170
+ "extractRect": [1040, 550, 1514, 986],
171
+ "parent": "side_table",
172
+ "motion": "spring",
173
+ "start": 4.9,
174
+ "duration": 1.0,
175
+ "pivot": [0.5, 1],
176
+ "zIndex": 13,
177
+ "category": "props",
178
+ "speed": 1
179
+ },
180
+ {
181
+ "id": "curtain_left",
182
+ "label": "左窗帘",
183
+ "bbox": [42, 0, 342, 446],
184
+ "source": "source/room-decor-v2_20261106072802.png",
185
+ "extractRect": [62, 15, 452, 546],
186
+ "parent": null,
187
+ "motion": "unfurl",
188
+ "start": 0,
189
+ "duration": 1.4,
190
+ "pivot": [0.5, 0],
191
+ "zIndex": 1,
192
+ "category": "decor",
193
+ "speed": 1
194
+ },
195
+ {
196
+ "id": "curtain_right",
197
+ "label": "右窗帘",
198
+ "bbox": [1146, 0, 354, 492],
199
+ "source": "source/room-decor-v2_20261106072802.png",
200
+ "extractRect": [570, 15, 965, 546],
201
+ "parent": null,
202
+ "motion": "unfurl",
203
+ "start": 0.12,
204
+ "duration": 1.4,
205
+ "pivot": [0.5, 0],
206
+ "zIndex": 2,
207
+ "category": "decor",
208
+ "speed": 1
209
+ },
210
+ {
211
+ "id": "drape_left",
212
+ "label": "左柱帘",
213
+ "bbox": [611, 182, 62, 254],
214
+ "source": "source/room-decor-v2_20261106072802.png",
215
+ "extractRect": [1205, 15, 1338, 546],
216
+ "parent": null,
217
+ "motion": "unfurl",
218
+ "start": 0.24,
219
+ "duration": 1.4,
220
+ "pivot": [0.5, 0],
221
+ "zIndex": 3,
222
+ "category": "decor",
223
+ "speed": 1
224
+ },
225
+ {
226
+ "id": "drape_right",
227
+ "label": "右柱帘",
228
+ "bbox": [868, 182, 62, 254],
229
+ "parent": null,
230
+ "start": 0.36,
231
+ "zIndex": 4,
232
+ "reuseOf": "drape_left",
233
+ "reuseReason": "同造型资源共用;位置、尺寸、层级和入场时间独立保存。",
234
+ "category": "decor",
235
+ "speed": 1
236
+ },
237
+ {
238
+ "id": "banner_left",
239
+ "label": "左挂旗",
240
+ "bbox": [380, 102, 66, 227],
241
+ "source": "source/room-decor-v2_20261106072802.png",
242
+ "extractRect": [176, 585, 333, 1090],
243
+ "parent": null,
244
+ "motion": "unfurl",
245
+ "start": 0.48,
246
+ "duration": 1.4,
247
+ "pivot": [0.5, 0],
248
+ "zIndex": 5,
249
+ "clipPolygon": [
250
+ [0.04, 0.02],
251
+ [0.96, 0.02],
252
+ [0.96, 0.64],
253
+ [0.5, 0.97],
254
+ [0.04, 0.64]
255
+ ],
256
+ "category": "decor",
257
+ "speed": 1
258
+ },
259
+ {
260
+ "id": "banner_right",
261
+ "label": "右挂旗",
262
+ "bbox": [1094, 102, 64, 227],
263
+ "parent": null,
264
+ "start": 0.6,
265
+ "zIndex": 6,
266
+ "reuseOf": "banner_left",
267
+ "reuseReason": "同造型资源共用;位置、尺寸、层级和入场时间独立保存。",
268
+ "category": "decor",
269
+ "speed": 1
270
+ },
271
+ {
272
+ "id": "chandelier",
273
+ "label": "吊灯",
274
+ "bbox": [663, 0, 204, 153],
275
+ "source": "source/room-decor-v2_20261106072802.png",
276
+ "extractRect": [996, 618, 1528, 1085],
277
+ "parent": null,
278
+ "motion": "hang",
279
+ "start": 0.8,
280
+ "duration": 1.2,
281
+ "pivot": [0.5, 0],
282
+ "zIndex": 7,
283
+ "category": "decor",
284
+ "speed": 1
285
+ },
286
+ {
287
+ "id": "throne",
288
+ "label": "王座",
289
+ "bbox": [674, 264, 194, 203],
290
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
291
+ "extractRect": [50, 70, 450, 500],
292
+ "parent": null,
293
+ "motion": "spring",
294
+ "start": 3.4,
295
+ "duration": 1.2,
296
+ "pivot": [0.5, 1],
297
+ "zIndex": 11,
298
+ "category": "furniture",
299
+ "speed": 1
300
+ },
301
+ {
302
+ "id": "rug",
303
+ "label": "地毯",
304
+ "bbox": [506, 449, 562, 407],
305
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
306
+ "extractRect": [500, 65, 1024, 500],
307
+ "parent": null,
308
+ "motion": "sequence",
309
+ "start": 1.8,
310
+ "duration": 2.0,
311
+ "pivot": [0.5, 1],
312
+ "zIndex": 8,
313
+ "category": "furniture",
314
+ "speed": 1,
315
+ "sequence": {
316
+ "image": "source/rug-unroll.png",
317
+ "frames": [
318
+ {
319
+ "rect": [0, 0, 570, 455],
320
+ "durationMs": 50
321
+ },
322
+ {
323
+ "rect": [570, 0, 570, 455],
324
+ "durationMs": 50
325
+ },
326
+ {
327
+ "rect": [1140, 0, 570, 455],
328
+ "durationMs": 50
329
+ },
330
+ {
331
+ "rect": [1710, 0, 570, 455],
332
+ "durationMs": 50
333
+ },
334
+ {
335
+ "rect": [2280, 0, 570, 455],
336
+ "durationMs": 50
337
+ },
338
+ {
339
+ "rect": [0, 455, 570, 455],
340
+ "durationMs": 50
341
+ },
342
+ {
343
+ "rect": [570, 455, 570, 455],
344
+ "durationMs": 50
345
+ },
346
+ {
347
+ "rect": [1140, 455, 570, 455],
348
+ "durationMs": 50
349
+ },
350
+ {
351
+ "rect": [1710, 455, 570, 455],
352
+ "durationMs": 50
353
+ },
354
+ {
355
+ "rect": [2280, 455, 570, 455],
356
+ "durationMs": 50
357
+ },
358
+ {
359
+ "rect": [0, 910, 570, 455],
360
+ "durationMs": 50
361
+ },
362
+ {
363
+ "rect": [570, 910, 570, 455],
364
+ "durationMs": 50
365
+ },
366
+ {
367
+ "rect": [1140, 910, 570, 455],
368
+ "durationMs": 50
369
+ },
370
+ {
371
+ "rect": [1710, 910, 570, 455],
372
+ "durationMs": 50
373
+ },
374
+ {
375
+ "rect": [2280, 910, 570, 455],
376
+ "durationMs": 50
377
+ },
378
+ {
379
+ "rect": [0, 1365, 570, 455],
380
+ "durationMs": 50
381
+ },
382
+ {
383
+ "rect": [570, 1365, 570, 455],
384
+ "durationMs": 50
385
+ },
386
+ {
387
+ "rect": [1140, 1365, 570, 455],
388
+ "durationMs": 50
389
+ },
390
+ {
391
+ "rect": [1710, 1365, 570, 455],
392
+ "durationMs": 50
393
+ },
394
+ {
395
+ "rect": [2280, 1365, 570, 455],
396
+ "durationMs": 50
397
+ },
398
+ {
399
+ "rect": [0, 1820, 570, 455],
400
+ "durationMs": 50
401
+ },
402
+ {
403
+ "rect": [570, 1820, 570, 455],
404
+ "durationMs": 50
405
+ },
406
+ {
407
+ "rect": [1140, 1820, 570, 455],
408
+ "durationMs": 50
409
+ },
410
+ {
411
+ "rect": [1710, 1820, 570, 455],
412
+ "durationMs": 50
413
+ },
414
+ {
415
+ "rect": [2280, 1820, 570, 455],
416
+ "durationMs": 50
417
+ },
418
+ {
419
+ "rect": [0, 2275, 570, 455],
420
+ "durationMs": 50
421
+ },
422
+ {
423
+ "rect": [570, 2275, 570, 455],
424
+ "durationMs": 50
425
+ },
426
+ {
427
+ "rect": [1140, 2275, 570, 455],
428
+ "durationMs": 50
429
+ },
430
+ {
431
+ "rect": [1710, 2275, 570, 455],
432
+ "durationMs": 50
433
+ },
434
+ {
435
+ "rect": [2280, 2275, 570, 455],
436
+ "durationMs": 50
437
+ },
438
+ {
439
+ "rect": [0, 2730, 570, 455],
440
+ "durationMs": 50
441
+ },
442
+ {
443
+ "rect": [570, 2730, 570, 455],
444
+ "durationMs": 50
445
+ },
446
+ {
447
+ "rect": [1140, 2730, 570, 455],
448
+ "durationMs": 50
449
+ },
450
+ {
451
+ "rect": [1710, 2730, 570, 455],
452
+ "durationMs": 50
453
+ },
454
+ {
455
+ "rect": [2280, 2730, 570, 455],
456
+ "durationMs": 50
457
+ },
458
+ {
459
+ "rect": [0, 3185, 570, 455],
460
+ "durationMs": 50
461
+ },
462
+ {
463
+ "rect": [570, 3185, 570, 455],
464
+ "durationMs": 50
465
+ },
466
+ {
467
+ "rect": [1140, 3185, 570, 455],
468
+ "durationMs": 50
469
+ },
470
+ {
471
+ "rect": [1710, 3185, 570, 455],
472
+ "durationMs": 50
473
+ },
474
+ {
475
+ "rect": [2280, 3185, 570, 455],
476
+ "durationMs": 50
477
+ }
478
+ ]
479
+ },
480
+ "animationBox": [506, 405, 562, 451]
481
+ },
482
+ {
483
+ "id": "desk",
484
+ "label": "书桌",
485
+ "bbox": [92, 566, 484, 261],
486
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
487
+ "extractRect": [1025, 165, 1535, 470],
488
+ "parent": null,
489
+ "motion": "slide",
490
+ "start": 5.3,
491
+ "duration": 1.2,
492
+ "pivot": [0.5, 1],
493
+ "zIndex": 18,
494
+ "category": "furniture",
495
+ "speed": 1
496
+ },
497
+ {
498
+ "id": "globe",
499
+ "label": "地球仪",
500
+ "bbox": [183, 466, 137, 187],
501
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
502
+ "extractRect": [90, 565, 410, 970],
503
+ "parent": "desk",
504
+ "motion": "spring",
505
+ "start": 6.7,
506
+ "duration": 1.2,
507
+ "pivot": [0.5, 1],
508
+ "zIndex": 19,
509
+ "category": "props",
510
+ "speed": 1
511
+ },
512
+ {
513
+ "id": "book",
514
+ "label": "书本",
515
+ "bbox": [304, 568, 150, 87],
516
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
517
+ "extractRect": [550, 650, 960, 940],
518
+ "parent": "desk",
519
+ "motion": "spring",
520
+ "start": 6.9,
521
+ "duration": 1.2,
522
+ "pivot": [0.5, 1],
523
+ "zIndex": 20,
524
+ "category": "props",
525
+ "speed": 1
526
+ },
527
+ {
528
+ "id": "quill",
529
+ "label": "羽毛笔",
530
+ "bbox": [455, 486, 93, 145],
531
+ "source": "source/room-arrival-separated-v1_20261106062202.png",
532
+ "extractRect": [1170, 560, 1420, 950],
533
+ "parent": "desk",
534
+ "motion": "spring",
535
+ "start": 7.1,
536
+ "duration": 1.2,
537
+ "pivot": [0.5, 1],
538
+ "zIndex": 21,
539
+ "category": "props",
540
+ "speed": 1
541
+ }
542
+ ],
543
+ "reuseReview": {
544
+ "stage": "识别清单之后、拆件生成之前",
545
+ "policy": "先归一化尺寸核对轮廓、纹样、朝向和光照;镜像仅在视觉复核后复用。不同造型保留变体。",
546
+ "retainedVariants": [
547
+ {
548
+ "ids": ["curtain_left", "curtain_right"],
549
+ "reason": "大窗帘的布片与束带数量不同,不能直接镜像复用。"
550
+ }
551
+ ]
552
+ },
553
+ "version": 1,
554
+ "playback": {
555
+ "speed": 1
556
+ },
557
+ "sources": {
558
+ "source/empty.png": {
559
+ "resourceId": "73f68c27813a42dc8a14e815556fb0af2a86a8b3903b8a7b9598f675eb8c433b",
560
+ "sha256": "73f68c27813a42dc8a14e815556fb0af2a86a8b3903b8a7b9598f675eb8c433b",
561
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/fb44f702f7fcf751551bbbd6d94ab5f8.png",
562
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/73f68c27813a42dc8a14e815556fb0af2a86a8b3903b8a7b9598f675eb8c433b.png"
563
+ },
564
+ "source/full.png": {
565
+ "resourceId": "b9131c763719336e70120aedb793b43784f855205003c0047e4f318e0abd59ba",
566
+ "sha256": "b9131c763719336e70120aedb793b43784f855205003c0047e4f318e0abd59ba",
567
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/dbc33465441f6efa42c2105becdcf443.png",
568
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/b9131c763719336e70120aedb793b43784f855205003c0047e4f318e0abd59ba.png"
569
+ },
570
+ "source/room-arrival-separated-v1_20261106062202.png": {
571
+ "resourceId": "2aa94cee022e6ec2bbe88672f8884318e2ac89c8e37751f7fe557d8ebf702d0a",
572
+ "sha256": "2aa94cee022e6ec2bbe88672f8884318e2ac89c8e37751f7fe557d8ebf702d0a",
573
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/4bdba689d169d8e906769e91b99cd40c.png",
574
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/2aa94cee022e6ec2bbe88672f8884318e2ac89c8e37751f7fe557d8ebf702d0a.png"
575
+ },
576
+ "source/room-decor-v2_20261106072802.png": {
577
+ "resourceId": "8676a2056426d68503cb9ad545e2370621887718a307ad0bf01f3f876a3303b1",
578
+ "sha256": "8676a2056426d68503cb9ad545e2370621887718a307ad0bf01f3f876a3303b1",
579
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/d6b99ae070fc8703a97a62fbf00e7d73.png",
580
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/8676a2056426d68503cb9ad545e2370621887718a307ad0bf01f3f876a3303b1.png"
581
+ },
582
+ "source/room-furniture-v2_20261106072404.png": {
583
+ "resourceId": "20117a9eb8829c41bf86fd88b9c7a6acd140537c8f54ead7b510b575068341f6",
584
+ "sha256": "20117a9eb8829c41bf86fd88b9c7a6acd140537c8f54ead7b510b575068341f6",
585
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/4b14663a4d17171f6cf862f2ab1af0e2.png",
586
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/20117a9eb8829c41bf86fd88b9c7a6acd140537c8f54ead7b510b575068341f6.png"
587
+ },
588
+ "source/room-props-v2_20261106072526.png": {
589
+ "resourceId": "806904094734c855b151fbe7cd8af7d480e65ce730f43e5b267d53d941135b23",
590
+ "sha256": "806904094734c855b151fbe7cd8af7d480e65ce730f43e5b267d53d941135b23",
591
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/9e0c627785454fde7d161f2a8cb3704d.png",
592
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/806904094734c855b151fbe7cd8af7d480e65ce730f43e5b267d53d941135b23.png"
593
+ },
594
+ "source/rug-unroll.png": {
595
+ "resourceId": "d5aee21197404c7b80cfd0b3692349dd833dbf014db1000914dcf6accec1af8c",
596
+ "sha256": "d5aee21197404c7b80cfd0b3692349dd833dbf014db1000914dcf6accec1af8c",
597
+ "cdn": "https://app-res.tapimg.com/img/2026-11-06/2d722935443ead8dbb61c00d3a346ec1.png",
598
+ "github": "https://raw.githubusercontent.com/taptap/instant-games-open-mcp/main/resources/maker-demo/d5aee21197404c7b80cfd0b3692349dd833dbf014db1000914dcf6accec1af8c.png"
599
+ }
600
+ }
601
+ }
@@ -0,0 +1,39 @@
1
+ # 场景素材接入
2
+
3
+ 入口 scene.json(version 2)。素材包仅含素材和配置,不含 UI.json 或游戏入口代码。
4
+
5
+ | 配置 | 用途 |
6
+ | ------------------------ | -------------------------------------------------------- |
7
+ | size、coordinates | 设计尺寸;左上原点,x 向右、y 向下,像素 xywh |
8
+ | viewport | contain 等比缩放、居中;按场景边界裁切 |
9
+ | background | 默认空场景背景,路径相对素材包根目录 |
10
+ | assets | 唯一资源列表:静态图、animation.json、类别 |
11
+ | instances | 每个摆放位置:assetId、imageBox、animationBox、zIndex |
12
+ | playback | speed 为整体速度倍率;autoplay=false 默认只显示背景 |
13
+ | instances.startMs、speed | 计划入场时间、单件速度倍率(默认 1) |
14
+ | instances.parent | 支撑物实例 ID;不做坐标或缩放继承 |
15
+ | animation.json | 帧文件、durationMs、帧尺寸、loop=false、endBehavior=hold |
16
+
17
+ 每帧 file 相对该 animation.json 所在目录。共享 assetId 只共享图片缓存,各实例独立计时和显示。
18
+
19
+ ## 还原步骤
20
+
21
+ 1. 读取 scene 和每份 animation;绘制背景,默认隐藏家具。不要启动时预加载全部帧为 GPU 纹理;按需读取,可预加载即将播放的动作。
22
+ 2. 视口宽高 W/H,缩放 s=min(W/size[1],H/size[2]),偏移 ((W-size[1]*s)/2,(H-size[2]*s)/2)。背景和家具使用同一变换,不能各自适配。
23
+ 3. 全部入场从场景时间 0 开始,每次增加 deltaMs \* playback.speed;整体速度同时影响入场间隔和动作。
24
+ 4. 全部播放时,有效开始时间 max(startMs, 支撑物有效开始时间+支撑动画时长/支撑实例speed),从父到子计算。无 parent 时直接用 startMs。
25
+ 5. 局部动画时间 (场景时间-有效开始时间)\*实例speed。小于 0 隐藏;累计 frames[].durationMs 找当前帧,到边界切下一帧,结束后保持末帧。不用固定 fps 替代逐帧时长。
26
+ 6. 按 zIndex 从小到大绘制;动画用 animationBox,静态图用 imageBox。不要逐帧裁透明边或在控件内二次 contain;矩形内部用 fill。
27
+
28
+ 清空需取消全部定时状态,仅留背景;重播支撑家具时隐藏其子孙,避免摆件悬空。单件播放可先补播尚未出现的支撑物;不触发同资源的其他实例。越界动画按 viewport.clip 裁切。
29
+
30
+ ## Maker Lua 接入参考
31
+
32
+ 配套 Skill 的 assets/SceneFurniturePlayer.lua 接收已解码 scene 和 loadJson(相对路径),提供:
33
+ new、playAll、clear、trigger(id)、update(deltaMs)、seek(sceneMs)、sample(id)、layout(W,H)。
34
+ sample 返回当前帧路径、animationBox、帧号与 finished;nil 表示隐藏。
35
+
36
+ 将模块复制到 scripts,素材目录放在 assets 下;调用方用 cache:GetFile + cjson 解码配置,给返回图片路径加素材包前缀。
37
+ UI 可用设计尺寸的绝对布局舞台,外层按 layout 等比缩放并裁切;每实例一个 Panel,按 sample 的 box 和图片更新。所有状态由 Player 管理,不另开 Sprite 自动播放计时器。
38
+
39
+ 正式帧已烘焙弹性变形,游戏无需再施加缩放曲线。画布循环预览不改变播放一次的配置。游戏 AI 接入后对照 reference 检查位置、层级和几段动作即可。
@@ -0,0 +1,52 @@
1
+ # 制作配方
2
+
3
+ 所有素材路径相对 --source-root,不允许逃出该根目录。--recipe 可放工作目录,输出必须新建。
4
+ 固定格式 version:1;size:[宽,高];background 和 reference 必须与 size 同尺寸;playback.speed 默认 1。
5
+
6
+ {
7
+ "version": 1, "size": [1536, 864],
8
+ "background": "source/empty.png", "reference": "source/full.png",
9
+ "playback": {"speed": 1},
10
+ "objects": [
11
+ {
12
+ "id": "chair", "label": "椅子", "category": "家具",
13
+ "source": "source/chair.png", "bbox": [100, 300, 200, 300],
14
+ "motion": "spring", "pivot": [0.5, 1], "duration": 1.2, "fps": 20,
15
+ "start": 0, "speed": 1, "parent": null, "zIndex": 1
16
+ },
17
+ {
18
+ "id": "chair_copy", "label": "第二把椅子",
19
+ "reuseOf": "chair", "reuseReason": "同向同造型,仅摆放尺寸不同",
20
+ "bbox": [600, 300, 160, 240], "start": 1.5, "speed": 1, "zIndex": 2
21
+ }
22
+ ]
23
+ }
24
+
25
+ - bbox 是最终静态图的场景像素 xywh;不随裁切图尺寸变化。
26
+ - source 可为透明独立图或拆件图集;图集另填 extractRect:[左,上,右,下],注意不是 xywh。
27
+ - 脚本去透明边后缩放到 bbox 尺寸;可用 clipPolygon:[[归一化x,y],...] 排除人工确认的杂边,不能替代语义拆件。
28
+ - pivot 是静态图内归一化锚点;家具通常 [0.5,1],布饰通常 [0.5,0]。
29
+ - motion:rock 适合高书柜,围绕底部锚点左右倾斜回摆、逐渐停稳;motion:slide 适合宽书桌,从左侧滑入并小幅摆动落稳。两者均烘焙为透明序列帧,自动计算旋转留边,末帧与静态图一致。不要再叠加游戏端缩放或摇晃;摆动不传递给 parent 关联物件。
30
+ - motion:roll 用于平铺地毯由上向下(场景后方向前方)卷展,直接填本次地毯 source、bbox、duration、fps 和 pivot:[0.5,0]。脚本用新图生成逐步铺平的纹理及收缩卷筒,无需准备 sequence;pivot 不影响卷展方向。适用于透视已经画入图片的直向卷展,不模拟任意方向或真实布料物理。末帧与静态图一致。
31
+ - duration、start 单位秒;导出时间均为毫秒。fps 默认 20,支持 1~30;烘焙上限 120 帧,单帧最长边 4096。
32
+ - reuseOf 直接引用唯一资源的实例 ID,不支持链式引用;不重复提供 source、motion、duration 或 pivot。独立 speed、start、bbox 保留。
33
+ - parent 是支撑依赖,不是相对坐标或变换继承。所有 bbox 都是场景绝对坐标;子物件至少等支撑物入场完成再出现。
34
+
35
+ ## 已有逐帧动画
36
+
37
+ motion 设为 sequence,保留 source(最终静态图)、bbox,并提供 animationBox 与 sequence:
38
+
39
+ {
40
+ "motion": "sequence", "animationBox": [100, 280, 240, 160],
41
+ "sequence": {
42
+ "image": "source/unroll-atlas.png",
43
+ "frames": [
44
+ {"rect": [0, 0, 240, 160], "durationMs": 50},
45
+ {"rect": [240, 0, 240, 160], "durationMs": 100}
46
+ ]
47
+ }
48
+ }
49
+
50
+ rect 为图集像素 xywh,顺序就是播放顺序。要求 1~120 张等尺寸、未裁紧、未旋转的透明帧。animationBox 表示整个帧画幅在场景的位置,包含透明留边。序列复用实例也提供自己的 animationBox;不从静态 bbox 猜测留边。
51
+
52
+ 画布预览是 256 像素单元的缩小图集,与正式素材分开输出。manifest.json 每个 item 含 assetId、file、title、category、frameSetInfo,直接用于 CLI 动画导入。