unity_scene_repacker 0.1.0__tar.gz → 1.0.0__tar.gz
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.
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/PKG-INFO +6 -6
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/README.md +5 -5
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/pyproject.toml +2 -2
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/cli.py +9 -9
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/LICENSE.md +0 -0
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/__init__.py +0 -0
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/data/empty_scene_bundle.unity3d +0 -0
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/prune.py +0 -0
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/repack.py +0 -0
- {unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unity-scene-repacker
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Add your description here
|
|
5
5
|
Author-email: Jakob Hellermann <jakob.hellermann@protonmail.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -21,7 +21,7 @@ This project lets you read scenes from the distributed game, take only what you
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
23
|
```json
|
|
24
|
-
|
|
24
|
+
objects.json
|
|
25
25
|
{
|
|
26
26
|
"A6_S3_Tutorial_And_SecretBoss_Remake": [
|
|
27
27
|
"A6_S3/Room/Prefab/Enemy/StealthGameMonster_RunningHog (3)",
|
|
@@ -38,9 +38,9 @@ monsters.json
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
|
|
42
|
-
--
|
|
43
|
-
--
|
|
44
|
-
--
|
|
41
|
+
uvx unity-scene-repacker
|
|
42
|
+
--game-dir "C:/Program Files (x86)/Steam/steamapps/common/Nine Sols-Speedrunpatch/NineSols_Data" \
|
|
43
|
+
--objects objects.json \
|
|
44
|
+
--output mybundle.unity3d
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -9,7 +9,7 @@ This project lets you read scenes from the distributed game, take only what you
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
|
-
|
|
12
|
+
objects.json
|
|
13
13
|
{
|
|
14
14
|
"A6_S3_Tutorial_And_SecretBoss_Remake": [
|
|
15
15
|
"A6_S3/Room/Prefab/Enemy/StealthGameMonster_RunningHog (3)",
|
|
@@ -26,8 +26,8 @@ monsters.json
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
|
|
30
|
-
--
|
|
31
|
-
--
|
|
32
|
-
--
|
|
29
|
+
uvx unity-scene-repacker
|
|
30
|
+
--game-dir "C:/Program Files (x86)/Steam/steamapps/common/Nine Sols-Speedrunpatch/NineSols_Data" \
|
|
31
|
+
--objects objects.json \
|
|
32
|
+
--output mybundle.unity3d
|
|
33
33
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "unity-scene-repacker"
|
|
3
|
-
version = "
|
|
3
|
+
version = "1.0.0"
|
|
4
4
|
description = "Add your description here"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -15,7 +15,7 @@ homepage = "https://github.com/jakobhellermann/unity-scene-repacker"
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
[project.scripts]
|
|
18
|
-
unity-
|
|
18
|
+
unity-scene-repacker = "unity_scene_repacker.cli:main"
|
|
19
19
|
|
|
20
20
|
[build-system]
|
|
21
21
|
requires = ["flit_core >=3.12,<4"]
|
|
@@ -19,7 +19,7 @@ def main():
|
|
|
19
19
|
parser = argparse.ArgumentParser()
|
|
20
20
|
parser.add_argument("--game-dir", help="game directory where the levels are, i.e. Game/Game_Data", required=True)
|
|
21
21
|
parser.add_argument(
|
|
22
|
-
"--
|
|
22
|
+
"--objects",
|
|
23
23
|
help="path to json file, containg map from scene name to list of gameobject paths to include in the assetbundle",
|
|
24
24
|
required=True,
|
|
25
25
|
)
|
|
@@ -27,7 +27,7 @@ def main():
|
|
|
27
27
|
"-o",
|
|
28
28
|
"--output",
|
|
29
29
|
help="path to json file, containg map from scene name to list of gameobject paths to include in the assetbundle",
|
|
30
|
-
default="
|
|
30
|
+
default="out.unity3d",
|
|
31
31
|
)
|
|
32
32
|
parser.add_argument(
|
|
33
33
|
"--disable",
|
|
@@ -36,7 +36,7 @@ def main():
|
|
|
36
36
|
)
|
|
37
37
|
args = parser.parse_args()
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
scene_objects = json.load(open(args.objects, "r"))
|
|
40
40
|
|
|
41
41
|
out_path = Path(args.output)
|
|
42
42
|
project = Path(args.game_dir)
|
|
@@ -45,10 +45,10 @@ def main():
|
|
|
45
45
|
ggm = env.load_file(str(project.joinpath("globalgamemanagers")))
|
|
46
46
|
|
|
47
47
|
scene_map = { name: i for i, name in enumerate(get_scene_names(ggm)) }
|
|
48
|
-
|
|
49
|
-
paths = [str(project.joinpath(f"level{scene_map[name]}")) for name in
|
|
48
|
+
scene_names = scene_objects.keys()
|
|
49
|
+
paths = [str(project.joinpath(f"level{scene_map[name]}")) for name in scene_names]
|
|
50
50
|
|
|
51
|
-
for i, (path, name) in enumerate(zip(paths,
|
|
51
|
+
for i, (path, name) in enumerate(zip(paths, scene_names)):
|
|
52
52
|
print(f"Loading {i + 1}/{len(paths)} [{name}] ", end="\r")
|
|
53
53
|
env.load_file(path)
|
|
54
54
|
print()
|
|
@@ -56,9 +56,9 @@ def main():
|
|
|
56
56
|
|
|
57
57
|
object_count_before = sum(len(x.objects.values()) for x in serialized_files)
|
|
58
58
|
|
|
59
|
-
for i, (file, level_name) in enumerate(zip(serialized_files,
|
|
59
|
+
for i, (file, level_name) in enumerate(zip(serialized_files, scene_names)):
|
|
60
60
|
print(f"Pruning {i + 1}/{len(paths)} [{level_name}] ", end="\r")
|
|
61
|
-
level_monsters =
|
|
61
|
+
level_monsters = scene_objects[level_name]
|
|
62
62
|
|
|
63
63
|
prune(file, level_monsters, [ClassIDType.RenderSettings])
|
|
64
64
|
|
|
@@ -74,7 +74,7 @@ def main():
|
|
|
74
74
|
print(f"Pruned {object_count_before} -> {object_count_after} objects")
|
|
75
75
|
|
|
76
76
|
prefix = "bundle"
|
|
77
|
-
new_bundle = repack_scene_bundle(dict(zip([f"{prefix}_{name}" for name in
|
|
77
|
+
new_bundle = repack_scene_bundle(dict(zip([f"{prefix}_{name}" for name in scene_names], serialized_files)))
|
|
78
78
|
|
|
79
79
|
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
80
80
|
with open(out_path, "wb") as f:
|
|
File without changes
|
{unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unity_scene_repacker-0.1.0 → unity_scene_repacker-1.0.0}/src/unity_scene_repacker/repack.py
RENAMED
|
File without changes
|
|
File without changes
|