added pascal case
This commit is contained in:
1 parent
7977fa254c
commit
279a19b6d0
1 file changed
+6
@@ -19,6 +19,11 @@ PREFIXES = {
|
||||
"LevelSequence": "LS_",
|
||||
}
|
||||
|
||||
def to_pascal_case(name):
|
||||
parts = re.split(r"[_\-\s]+", name)
|
||||
return "".join(p[:1].upper() + p[1:] for p in parts if p)
|
||||
|
||||
|
||||
lib = unreal.EditorAssetLibrary
|
||||
for path in lib.list_assets("/Game", recursive=True):
|
||||
path = path.split(".")[0]
|
||||
@@ -34,6 +39,7 @@ for path in lib.list_assets("/Game", recursive=True):
|
||||
name = base + (f"_{suffix.capitalize()}" if suffix else "")
|
||||
|
||||
name = re.sub(r"^(" + "|".join(p for p in PREFIXES.values() if p) + ")", "", name)
|
||||
name = to_pascal_case(name)
|
||||
name = PREFIXES.get(cls, "") + name
|
||||
|
||||
folder = FOLDERS.get(cls, "Misc")
|
||||
|
||||
Reference in new issue
Block a user