3D 리플레이: 요원 3D 몸(뼈대 · 텍스처 · 공용 걷기/달리기 + 총 든 자세) · 총 22종 추출, 재생기가 원기둥 대신 요원과 손에 든 총을 그림
- map-extract agents: 요원 30명 agent_<코드>.glb (위/아래 몸 애니메이션 분리, ACL 풀기용 CUE4Parse-Natives 를 g++ 로 빌드), 무기 weapon_<이름>.glb - pack.py: 요원 · 무기도 압축해 index.json agents · weapons - 사이트: AgentRig (이동 방향 · 속도로 다리 애니메이션 섞기, 오른손에 총), 1인칭 · 자유시점에서 이름표 작게 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BIN
tools/map-extract/scripts/__pycache__/pack.cpython-314.pyc
Normal file
BIN
tools/map-extract/scripts/__pycache__/pack.cpython-314.pyc
Normal file
Binary file not shown.
@@ -10,6 +10,10 @@ export PATH="$HOME/.dotnet:$PATH" DOTNET_ROOT="${DOTNET_ROOT:-$HOME/.dotnet}" DO
|
||||
"$here/fetch-cue4parse.sh"
|
||||
rm -rf "$GVR_MAPS_HOME/bin.new"
|
||||
CUE4PARSE_SKIP_NATIVE=1 dotnet build "$here/MapExtract.csproj" -c Release -o "$GVR_MAPS_HOME/bin.new" -v quiet -nologo -clp:ErrorsOnly
|
||||
# CUE4Parse-Natives (ACL 애니메이션 풀기만, cmake 없이 g++): 요원 애니메이션 추출에 필요
|
||||
nat="$here/vendor/CUE4Parse/CUE4Parse-Natives"
|
||||
g++ -shared -fPIC -O2 -std=c++17 -DWITH_ACL -I"$nat/ACL/external/acl/includes" -I"$nat/ACL/external/acl/external/rtm/includes" -I"$nat/common" -I"$nat/ACL/includes" \
|
||||
"$nat/ACL/ACL.cpp" "$nat/Features.cpp" -o "$GVR_MAPS_HOME/bin.new/CUE4Parse-Natives.so"
|
||||
rm -rf "$GVR_MAPS_HOME/bin.old"
|
||||
[ -d "$GVR_MAPS_HOME/bin" ] && mv "$GVR_MAPS_HOME/bin" "$GVR_MAPS_HOME/bin.old"
|
||||
mv "$GVR_MAPS_HOME/bin.new" "$GVR_MAPS_HOME/bin"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""gvr-map-extract 결과(<코드>.glb + <코드>.json)를 사이트용으로 압축한다.
|
||||
pack.py <추출 폴더> <출력 폴더> <버전(예: VALORANT_13.08)>
|
||||
(agents.json 이 있으면 요원 agent_*.glb · 무기 weapon_*.glb 도 같은 폴더에, index.json agents · weapons)
|
||||
출력: <출력>/<dir>/<코드>.glb.gz (gltfpack -cc 로 meshopt 압축 · 위치 양자화 → gzip) + <출력>/index.json
|
||||
-ke: 재질 extras(두 층 섞기 B 층) 유지, -vt 14: 반복 UV 가 뭉개지지 않게
|
||||
사이트 서버 data/maps3d 에 그대로 올리면 된다 (site/server/src/maps3d.ts)."""
|
||||
@@ -12,7 +13,7 @@ d = re.sub(r'[^\w.-]', '_', f'{version}-{stamp}')
|
||||
os.makedirs(os.path.join(out, d), exist_ok=True)
|
||||
maps = {}
|
||||
for name in sorted(os.listdir(src)):
|
||||
if not name.endswith('.json'):
|
||||
if not name.endswith('.json') or name == 'agents.json':
|
||||
continue
|
||||
info = json.load(open(os.path.join(src, name)))
|
||||
code = info['code']
|
||||
@@ -27,7 +28,31 @@ for name in sorted(os.listdir(src)):
|
||||
size = os.path.getsize(packed + '.gz')
|
||||
maps[info['mapUrl']] = {'code': code, 'file': code + '.glb', 'bytes': size, 'triangles': info['triangles']}
|
||||
print(f"{code}: {info['triangles']} 삼각형 → {size / 1e6:.1f}MB")
|
||||
idx = {'version': version, 'dir': d, 'updatedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'maps': maps}
|
||||
# 요원 · 무기 (agents 명령 결과 agents.json 이 있으면): 뼈대 · 애니메이션 · 노드 이름을 지킨다 (-kn)
|
||||
agents, weapons = {}, {}
|
||||
aj = os.path.join(src, 'agents.json')
|
||||
if os.path.exists(aj):
|
||||
a = json.load(open(aj))
|
||||
def pack_one(file):
|
||||
glb = os.path.join(src, file)
|
||||
if not os.path.exists(glb):
|
||||
return None
|
||||
packed = os.path.join(out, d, file)
|
||||
subprocess.run(['npx', '-y', 'gltfpack@1.3.0', '-i', glb, '-o', packed, '-cc', '-kn', '-ke'], check=True, stdout=subprocess.DEVNULL)
|
||||
with open(packed, 'rb') as f, gzip.open(packed + '.gz', 'wb', 9) as g:
|
||||
shutil.copyfileobj(f, g)
|
||||
os.remove(packed)
|
||||
return os.path.getsize(packed + '.gz')
|
||||
for cls, v in a.get('agents', {}).items():
|
||||
size = pack_one(v['file'])
|
||||
if size:
|
||||
agents[cls] = {'code': v['code'], 'file': v['file'], 'bytes': size}
|
||||
for name, v in a.get('weapons', {}).items():
|
||||
size = pack_one(v['file'])
|
||||
if size:
|
||||
weapons[name] = {'file': v['file'], 'bytes': size, 'points': v.get('points') or {}}
|
||||
print(f'요원 {len(agents)} · 무기 {len(weapons)}')
|
||||
idx = {'version': version, 'dir': d, 'updatedAt': datetime.datetime.now(datetime.timezone.utc).isoformat(), 'maps': maps, 'agents': agents, 'weapons': weapons}
|
||||
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'))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# 1. uedb.dev 발로란트 매핑(.usmap) 버전 · 라이브 패치 매니페스트를 본다. 지난번에 올린 것과 같으면 끝
|
||||
# 2. 새 매핑이면 받아서 보관한다: $GVR_MAPS_HOME/mappings/ + nextcloud claude/game-voice-recorder/valorant/mappings/
|
||||
# 3. 모든 맵을 Riot CDN 에서 바로 뽑고(gvr-map-extract, 필요한 조각만 받음 · 디스크 거의 안 씀) 압축한다 (pack.py)
|
||||
# 3. 모든 맵 · 요원 · 무기를 Riot CDN 에서 바로 뽑고(gvr-map-extract, 필요한 조각만 받음 · 디스크 거의 안 씀) 압축한다 (pack.py)
|
||||
# 4. 사이트 서버(.5) data/maps3d 에 올리고 index.json 을 바꿔 끼운다 → 사이트가 바로 새 맵을 쓴다
|
||||
#
|
||||
# 실패하면(어느 단계든) 사이트는 이전 맵을 그대로 쓰고, 같은 조합은 30분 · 1시간 · 2시간 … 최대 6시간 간격으로 다시 해 본다.
|
||||
@@ -122,6 +122,9 @@ out="$GVR_MAPS_HOME/work/out"
|
||||
rm -rf "$raw" "$out"
|
||||
mkdir -p "$raw" "$out"
|
||||
GVR_USMAP="$usmap" GVR_MANIFEST="$manifest" "$BIN" extract "$raw"
|
||||
# 요원 3D 몸 · 애니메이션 · 무기 (실패해도 맵은 올린다. 일부만 실패하면 뽑힌 것만 쓴다)
|
||||
stage="요원 추출"
|
||||
GVR_USMAP="$usmap" GVR_MANIFEST="$manifest" "$BIN" agents "$raw" || log "요원 · 무기 추출 일부 실패 (뽑힌 것만 올림)"
|
||||
stage="압축"
|
||||
python3 "$GVR_MAPS_HOME/scripts/pack.py" "$raw" "$out" "$version"
|
||||
dir="$(jq -r .dir "$out/index.json")"
|
||||
|
||||
Reference in New Issue
Block a user