3D 리플레이 실감 2단계: 게임 스킬 효과 추출(Abilities.cs: Cascade 파티클 · 메시 · 텍스처 → abilities.json) · 사이트 파티클 재생기(lib/vfx.ts: 시간만으로 계산 · 연막 돔 · 장판 칸 · 투사체 꼬리 · 설치물 메시) · maps3d json/png 제공 · update.sh/pack.py 연결
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"""gvr-map-extract 결과(<코드>.glb + <코드>.json)를 사이트용으로 압축한다.
|
||||
pack.py <추출 폴더> <출력 폴더> <버전(예: VALORANT_13.08)>
|
||||
(agents.json 이 있으면 요원 agent_*.glb · 무기 weapon_*.glb 도 같은 폴더에, index.json agents · weapons.
|
||||
anims.glb 가 있으면 공용 애니메이션 index.json anims)
|
||||
anims.glb 가 있으면 공용 애니메이션 index.json anims, abilities/abilities.json 이 있으면 스킬 재료 index.json abilities)
|
||||
출력: <출력>/<dir>/<코드>.glb.gz (gltfpack -cc 로 meshopt 압축 · 위치 양자화 → gzip) + <출력>/index.json
|
||||
-ke: 재질 extras(두 층 섞기 B 층) 유지, -vt 14: 반복 UV 가 뭉개지지 않게
|
||||
사이트 서버 data/maps3d 에 그대로 올리면 된다 (site/server/src/maps3d.ts)."""
|
||||
@@ -59,7 +59,21 @@ if os.path.exists(os.path.join(src, 'anims.glb')):
|
||||
size = pack_one('anims.glb')
|
||||
anims = {'file': 'anims.glb', 'bytes': size}
|
||||
print(f'공용 애니메이션 {size / 1e6:.1f}MB')
|
||||
idx = {'version': version, 'dir': d, 'updatedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'maps': maps, 'agents': agents, 'weapons': weapons, 'anims': anims}
|
||||
# 스킬 재료 (abilities 명령 결과 abilities/ 폴더): abilities.json · m_*.glb · t_*.png 를 gzip 만 한다
|
||||
# (메시는 작고 뼈대 · 텍스처가 든 것도 있어 gltfpack 을 거치지 않는다)
|
||||
abilities = None
|
||||
ad = os.path.join(src, 'abilities')
|
||||
if os.path.exists(os.path.join(ad, 'abilities.json')):
|
||||
total = 0
|
||||
for f in sorted(os.listdir(ad)):
|
||||
if not (f == 'abilities.json' or (f.startswith(('m_', 't_')) and f.endswith(('.glb', '.png')))):
|
||||
continue
|
||||
with open(os.path.join(ad, f), 'rb') as fi, gzip.open(os.path.join(out, d, f + '.gz'), 'wb', 9) as g:
|
||||
shutil.copyfileobj(fi, g)
|
||||
total += os.path.getsize(os.path.join(out, d, f + '.gz'))
|
||||
abilities = {'file': 'abilities.json', 'bytes': os.path.getsize(os.path.join(out, d, 'abilities.json.gz'))}
|
||||
print(f'스킬 재료 {total / 1e6:.1f}MB')
|
||||
idx = {'version': version, 'dir': d, 'updatedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'maps': maps, 'agents': agents, 'weapons': weapons, 'anims': anims, 'abilities': abilities}
|
||||
tmp = os.path.join(out, 'index.json.tmp')
|
||||
json.dump(idx, open(tmp, 'w'), ensure_ascii=False, indent=1)
|
||||
os.replace(tmp, os.path.join(out, 'index.json'))
|
||||
|
||||
Reference in New Issue
Block a user