21 lines
1.3 KiB
Python
21 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
||
# 맵 씬 파일에서 블렌더 소품 프리팹(FRProp_)이 몇 번 쓰였는지 센다(프리팹 guid 로 찾는다).
|
||
import re, io, sys, json, os, glob
|
||
maps = ["Graveyard","RuinedKeep","SpiderCave","PlagueCatacomb","HarborExecution","ScorchedDesert"]
|
||
theme = {"Graveyard":"Graveyard","RuinedKeep":"Keep","SpiderCave":"Cave","PlagueCatacomb":"Catacomb","HarborExecution":"Harbor","ScorchedDesert":"Desert"}
|
||
root = r"C:\BurningTimes\FirstRising"
|
||
for m in maps:
|
||
scenes = glob.glob(os.path.join(root, "Assets/Scenes/Maps", m, "*.unity"))
|
||
text = ""
|
||
for s in scenes:
|
||
text += io.open(s, encoding="utf-8", errors="ignore").read()
|
||
pdir = os.path.join(root, "Assets/BurningTimes/Maps/_Shared/Props", theme[m], "Prefabs")
|
||
out = []
|
||
total = 0
|
||
for meta in sorted(glob.glob(os.path.join(pdir, "*.prefab.meta"))):
|
||
guid = re.search(r"guid: ([0-9a-f]{32})", io.open(meta, encoding="utf-8").read()).group(1)
|
||
n = len(re.findall(r"m_SourcePrefab: \{fileID: \d+, guid: %s" % guid, text))
|
||
name = os.path.basename(meta)[:-len(".prefab.meta")].split("_", 2)[2]
|
||
out.append((name, n)); total += n
|
||
print("%-16s 씬 %d개 · 새 소품 %3d개 · %s" % (m, len(scenes), total, " ".join("%s×%d" % x for x in sorted(out, key=lambda x: -x[1]))))
|