unity_scene_repacker 2.1.0__tar.gz → 2.2.1__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.
Files changed (57) hide show
  1. unity_scene_repacker-2.2.1/.clang-format +1 -0
  2. unity_scene_repacker-2.2.1/.github/workflows/release.yml +176 -0
  3. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/.gitignore +8 -3
  4. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/Cargo.lock +127 -62
  5. unity_scene_repacker-2.2.1/Cargo.toml +48 -0
  6. unity_scene_repacker-2.2.1/PKG-INFO +10 -0
  7. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/README.md +8 -1
  8. unity_scene_repacker-2.2.1/cli/Cargo.toml +26 -0
  9. unity_scene_repacker-2.2.1/cli/src/completion.rs +33 -0
  10. unity_scene_repacker-2.2.1/cli/src/locate.rs +59 -0
  11. unity_scene_repacker-2.2.1/cli/src/logger.rs +25 -0
  12. unity_scene_repacker-2.2.1/cli/src/main.rs +286 -0
  13. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1/cli}/src/utils.rs +0 -18
  14. unity_scene_repacker-2.2.1/docs/release.md +2 -0
  15. unity_scene_repacker-2.2.1/examples/export_monobehaviour_typetrees.rs +230 -0
  16. unity_scene_repacker-2.2.1/justfile +24 -0
  17. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/objects/hk-enemies.jsonc +0 -174
  18. unity_scene_repacker-2.2.1/objects/hk-representative.jsonc +376 -0
  19. unity_scene_repacker-2.2.1/objects/ns-monsters.json +200 -0
  20. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/pyproject.toml +3 -6
  21. unity_scene_repacker-2.2.1/src/env.rs +172 -0
  22. unity_scene_repacker-2.2.1/src/game_files.rs +73 -0
  23. unity_scene_repacker-2.2.1/src/lib.rs +536 -0
  24. unity_scene_repacker-2.2.1/src/merge_serialized.rs +138 -0
  25. unity_scene_repacker-2.2.1/src/monobehaviour_typetree_export.rs +56 -0
  26. unity_scene_repacker-2.2.1/src/prune.rs +129 -0
  27. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/src/scene_lookup.rs +50 -42
  28. unity_scene_repacker-2.2.1/src/trace_pptr.rs +196 -0
  29. unity_scene_repacker-2.2.1/src/typetree_generator_cache.rs +45 -0
  30. unity_scene_repacker-2.2.1/src/unity/types/utils.rs +124 -0
  31. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/src/unity/types.rs +53 -1
  32. unity_scene_repacker-2.2.1/tt-api-lib/TypeTreeGeneratorAPI.lib +0 -0
  33. unity_scene_repacker-2.2.1/typetree-generator-api/Cargo.toml +8 -0
  34. unity_scene_repacker-2.2.1/typetree-generator-api/bindings.h +32 -0
  35. unity_scene_repacker-2.2.1/typetree-generator-api/build.rs +3 -0
  36. unity_scene_repacker-2.2.1/typetree-generator-api/src/generated.rs +82 -0
  37. unity_scene_repacker-2.2.1/typetree-generator-api/src/lib.rs +270 -0
  38. unity_scene_repacker-2.1.0/.github/workflows/release.yml +0 -168
  39. unity_scene_repacker-2.1.0/Cargo.toml +0 -34
  40. unity_scene_repacker-2.1.0/PKG-INFO +0 -106
  41. unity_scene_repacker-2.1.0/build.rs +0 -6
  42. unity_scene_repacker-2.1.0/justfile +0 -15
  43. unity_scene_repacker-2.1.0/objects/hk-palecourt.json +0 -141
  44. unity_scene_repacker-2.1.0/objects/hk-simple.json +0 -53
  45. unity_scene_repacker-2.1.0/objects/ns-bosses.json +0 -14
  46. unity_scene_repacker-2.1.0/objects/ns-monsters.json +0 -244
  47. unity_scene_repacker-2.1.0/resources/lz4.tpk +0 -0
  48. unity_scene_repacker-2.1.0/src/lib.rs +0 -1
  49. unity_scene_repacker-2.1.0/src/main.rs +0 -603
  50. unity_scene_repacker-2.1.0/src/trace_pptr.rs +0 -120
  51. unity_scene_repacker-2.1.0/src/typetree_cache.rs +0 -41
  52. unity_scene_repacker-2.1.0/src/typetree_generator_api.rs +0 -268
  53. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/LICENSE.md +0 -0
  54. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/docs/demo-cast.svg +0 -0
  55. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/docs/demo.cast +0 -0
  56. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/rustfmt.toml +0 -0
  57. {unity_scene_repacker-2.1.0 → unity_scene_repacker-2.2.1}/src/unity/mod.rs +0 -0
@@ -0,0 +1 @@
1
+ ColumnLimit: 120
@@ -0,0 +1,176 @@
1
+ name: Build & Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ${{ matrix.runner }}
15
+ strategy:
16
+ matrix:
17
+ include:
18
+ # Linux manylinux
19
+ - runner: ubuntu-22.04
20
+ target: x86_64
21
+ rid: linux-x64
22
+ manylinux: manylinux_2_34
23
+ # - runner: ubuntu-22.04 # disabled: lz c dep doesn't build
24
+ # target: aarch64
25
+ # rid: linux-arm64
26
+ # manylinux: manylinux_2_34
27
+ # # Linux musllinux # disabled: dotnet still references glibc
28
+ # - runner: ubuntu-22.04
29
+ # target: x86_64
30
+ # rid: linux-musl-x64
31
+ # manylinux: musllinux_1_2
32
+ # - runner: ubuntu-22.04
33
+ # target: aarch64
34
+ # rid: linux-musl-arm64
35
+ # manylinux: musllinux_1_2
36
+ # Windows
37
+ - runner: windows-latest
38
+ target: x64
39
+ rid: win-x64
40
+ manylinux: ""
41
+ # MacOS
42
+ - runner: macos-13
43
+ target: x86_64
44
+ rid: osx-x64
45
+ manylinux: ""
46
+ - runner: macos-14
47
+ target: aarch64
48
+ rid: osx-arm64
49
+ manylinux: ""
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+ - uses: actions/setup-dotnet@v4
53
+ with:
54
+ dotnet-version: "9.x"
55
+
56
+ - name: Clone TypeTreeGeneratorAPI
57
+ uses: actions/checkout@v4
58
+ with:
59
+ repository: jakobhellermann/TypeTreeGeneratorAPI
60
+ submodules: true
61
+ ref: wip
62
+ path: TypeTreeGeneratorAPI
63
+ - name: Publish TypeTreeGeneratorAPI with dotnet
64
+ run: dotnet publish TypeTreeGeneratorAPI/TypeTreeGeneratorAPI -o out --runtime ${{ matrix.rid }} -p:EnableAssetRipper=false -p:EnableAssetStudio=false -p:EnableAssetsTools=true -p:EnableIL2CPP=false
65
+ - name: Copy importlib to out
66
+ if: runner.os == 'windows'
67
+ run: cp TypeTreeGeneratorAPI/TypeTreeGeneratorAPI/bin/Release/net9.0/win-x64/native/TypeTreeGeneratorAPI.lib ./out/
68
+
69
+ - name: Build bindings
70
+ env:
71
+ RUSTFLAGS: "-L out"
72
+ run: cargo build --release -p bindings
73
+ - name: Copy artifacts
74
+ shell: bash # todo: replace this with --artifact-dir when finally stable
75
+ run: |
76
+ if [[ "${{ runner.os }}" == "Windows" ]]; then
77
+ cp target/release/unityscenerepacker.dll out/unityscenerepacker.dll
78
+ elif [[ "${{ runner.os }}" == "macOS" ]]; then
79
+ cp target/release/libunityscenerepacker.dylib out/libunityscenerepacker.dylib
80
+ else
81
+ cp target/release/libunityscenerepacker.so out/libunityscenerepacker.so
82
+ fi
83
+
84
+ - name: Upload bindings
85
+ uses: actions/upload-artifact@v4
86
+ with:
87
+ name: bindings-${{ matrix.rid }}
88
+ path: out/*
89
+
90
+ - name: Build cli wheels
91
+ env:
92
+ RUSTFLAGS: "-L out"
93
+ LD_LIBRARY_PATH: "${{ github.workspace }}/out"
94
+ uses: jakobhellermann/maturin-action@allow-ld-env
95
+ with:
96
+ target: ${{ matrix.target }}
97
+ args: --release --out dist
98
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
99
+ manylinux: ${{ matrix.manylinux }}
100
+
101
+ - name: Upload wheels
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: ${{ matrix.runner }}-${{ matrix.target }}${{ matrix.manylinux }}
105
+ path: dist
106
+
107
+ sdist:
108
+ runs-on: ubuntu-latest
109
+ steps:
110
+ - uses: actions/checkout@v4
111
+ - name: Build sdist
112
+ uses: PyO3/maturin-action@v1
113
+ with:
114
+ command: sdist
115
+ args: --out dist
116
+ - name: Upload sdist
117
+ uses: actions/upload-artifact@v4
118
+ with:
119
+ name: wheels-sdist
120
+ path: dist
121
+
122
+ nuget:
123
+ name: Pack and Push NuGet Package
124
+ runs-on: ubuntu-latest
125
+ needs: build
126
+
127
+ steps:
128
+ - uses: actions/checkout@v4
129
+ - run: sudo apt install mono-devel # https://github.com/NuGet/setup-nuget/issues/168
130
+ - uses: nuget/setup-nuget@v2
131
+
132
+ - name: Download artifacts
133
+ uses: actions/download-artifact@v4
134
+ with:
135
+ pattern: bindings-*
136
+ path: out
137
+
138
+ - name: List built files
139
+ run: ls -R out
140
+
141
+ - name: Pack NuGet package
142
+ run: nuget pack ./bindings/nuget/unityscenerepacker.nuspec
143
+
144
+ - name: Push to NuGet
145
+ env:
146
+ NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
147
+ run: nuget push unityscenerepacker.*.nupkg --skip-duplicate -Source https://api.nuget.org/v3/index.json -ApiKey $NUGET_API_KEY
148
+
149
+ release:
150
+ name: Release
151
+ runs-on: ubuntu-latest
152
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
153
+ needs: [build, sdist]
154
+ permissions:
155
+ # Use to sign the release artifacts
156
+ id-token: write
157
+ # Used to upload release artifacts
158
+ contents: write
159
+ # Used to generate artifact attestation
160
+ attestations: write
161
+ steps:
162
+ - uses: actions/download-artifact@v4
163
+ with:
164
+ pattern: wheels-*
165
+ - name: Generate artifact attestation
166
+ uses: actions/attest-build-provenance@v2
167
+ with:
168
+ subject-path: "wheels-*/*"
169
+ - name: Publish to PyPI
170
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
171
+ uses: PyO3/maturin-action@v1
172
+ env:
173
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
174
+ with:
175
+ command: upload
176
+ args: --non-interactive --skip-existing wheels-*/*
@@ -1,11 +1,16 @@
1
1
  /target
2
2
  /uv.lock
3
3
 
4
- /out
4
+ /out*
5
+ *.nupkg
5
6
  /*.unity3d
6
7
  /*.bundle
7
- /*.so
8
- /*.dll
8
+
9
+ *.so
10
+ *.a
11
+ *.dll
12
+ *.lib
13
+ *.pdb
9
14
 
10
15
  __pycache__
11
16
  *.pyc
@@ -2,17 +2,6 @@
2
2
  # It is not intended for manual editing.
3
3
  version = 4
4
4
 
5
- [[package]]
6
- name = "aes"
7
- version = "0.8.4"
8
- source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
10
- dependencies = [
11
- "cfg-if",
12
- "cipher",
13
- "cpufeatures",
14
- ]
15
-
16
5
  [[package]]
17
6
  name = "anstream"
18
7
  version = "0.6.19"
@@ -69,6 +58,17 @@ version = "1.0.98"
69
58
  source = "registry+https://github.com/rust-lang/crates.io-index"
70
59
  checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
71
60
 
61
+ [[package]]
62
+ name = "bindings"
63
+ version = "2.2.1"
64
+ dependencies = [
65
+ "anyhow",
66
+ "indexmap",
67
+ "rabex",
68
+ "serde_json",
69
+ "unity-scene-repacker",
70
+ ]
71
+
72
72
  [[package]]
73
73
  name = "bitflags"
74
74
  version = "2.9.1"
@@ -84,35 +84,17 @@ dependencies = [
84
84
  "generic-array",
85
85
  ]
86
86
 
87
- [[package]]
88
- name = "block-padding"
89
- version = "0.3.3"
90
- source = "registry+https://github.com/rust-lang/crates.io-index"
91
- checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
92
- dependencies = [
93
- "generic-array",
94
- ]
95
-
96
87
  [[package]]
97
88
  name = "byteorder"
98
89
  version = "1.5.0"
99
90
  source = "registry+https://github.com/rust-lang/crates.io-index"
100
91
  checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
101
92
 
102
- [[package]]
103
- name = "cbc"
104
- version = "0.1.2"
105
- source = "registry+https://github.com/rust-lang/crates.io-index"
106
- checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
107
- dependencies = [
108
- "cipher",
109
- ]
110
-
111
93
  [[package]]
112
94
  name = "cc"
113
- version = "1.2.27"
95
+ version = "1.2.29"
114
96
  source = "registry+https://github.com/rust-lang/crates.io-index"
115
- checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc"
97
+ checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362"
116
98
  dependencies = [
117
99
  "shlex",
118
100
  ]
@@ -123,16 +105,6 @@ version = "1.0.1"
123
105
  source = "registry+https://github.com/rust-lang/crates.io-index"
124
106
  checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
125
107
 
126
- [[package]]
127
- name = "cipher"
128
- version = "0.4.4"
129
- source = "registry+https://github.com/rust-lang/crates.io-index"
130
- checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
131
- dependencies = [
132
- "crypto-common",
133
- "inout",
134
- ]
135
-
136
108
  [[package]]
137
109
  name = "clap"
138
110
  version = "4.5.40"
@@ -217,6 +189,31 @@ version = "2.4.0"
217
189
  source = "registry+https://github.com/rust-lang/crates.io-index"
218
190
  checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5"
219
191
 
192
+ [[package]]
193
+ name = "crossbeam-deque"
194
+ version = "0.8.6"
195
+ source = "registry+https://github.com/rust-lang/crates.io-index"
196
+ checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
197
+ dependencies = [
198
+ "crossbeam-epoch",
199
+ "crossbeam-utils",
200
+ ]
201
+
202
+ [[package]]
203
+ name = "crossbeam-epoch"
204
+ version = "0.9.18"
205
+ source = "registry+https://github.com/rust-lang/crates.io-index"
206
+ checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
207
+ dependencies = [
208
+ "crossbeam-utils",
209
+ ]
210
+
211
+ [[package]]
212
+ name = "crossbeam-utils"
213
+ version = "0.8.21"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
216
+
220
217
  [[package]]
221
218
  name = "crypto-common"
222
219
  version = "0.1.6"
@@ -237,6 +234,12 @@ dependencies = [
237
234
  "crypto-common",
238
235
  ]
239
236
 
237
+ [[package]]
238
+ name = "either"
239
+ version = "1.15.0"
240
+ source = "registry+https://github.com/rust-lang/crates.io-index"
241
+ checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
242
+
240
243
  [[package]]
241
244
  name = "elsa"
242
245
  version = "1.11.2"
@@ -285,25 +288,16 @@ dependencies = [
285
288
 
286
289
  [[package]]
287
290
  name = "indexmap"
288
- version = "2.9.0"
291
+ version = "2.10.0"
289
292
  source = "registry+https://github.com/rust-lang/crates.io-index"
290
- checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
293
+ checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
291
294
  dependencies = [
292
295
  "equivalent",
293
296
  "hashbrown",
297
+ "rayon",
294
298
  "serde",
295
299
  ]
296
300
 
297
- [[package]]
298
- name = "inout"
299
- version = "0.1.4"
300
- source = "registry+https://github.com/rust-lang/crates.io-index"
301
- checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
302
- dependencies = [
303
- "block-padding",
304
- "generic-array",
305
- ]
306
-
307
301
  [[package]]
308
302
  name = "is_executable"
309
303
  version = "1.0.4"
@@ -319,6 +313,12 @@ version = "1.70.1"
319
313
  source = "registry+https://github.com/rust-lang/crates.io-index"
320
314
  checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
321
315
 
316
+ [[package]]
317
+ name = "itoa"
318
+ version = "1.0.15"
319
+ source = "registry+https://github.com/rust-lang/crates.io-index"
320
+ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
321
+
322
322
  [[package]]
323
323
  name = "json5"
324
324
  version = "0.4.1"
@@ -357,6 +357,12 @@ version = "0.2.174"
357
357
  source = "registry+https://github.com/rust-lang/crates.io-index"
358
358
  checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
359
359
 
360
+ [[package]]
361
+ name = "log"
362
+ version = "0.4.27"
363
+ source = "registry+https://github.com/rust-lang/crates.io-index"
364
+ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
365
+
360
366
  [[package]]
361
367
  name = "lz4"
362
368
  version = "1.28.1"
@@ -516,13 +522,10 @@ dependencies = [
516
522
  [[package]]
517
523
  name = "rabex"
518
524
  version = "0.0.3"
519
- source = "git+https://github.com/jakobhellermann/RustyAssetBundleEXtractor?branch=all#21860af76e5b730b3dfe3986520d82336912194d"
525
+ source = "git+https://github.com/jakobhellermann/RustyAssetBundleEXtractor?branch=all#750976c75cead5985e15a1f5773be4597b343bd2"
520
526
  dependencies = [
521
- "aes",
522
- "anyhow",
523
527
  "bitflags",
524
528
  "byteorder",
525
- "cbc",
526
529
  "elsa",
527
530
  "lz4",
528
531
  "lz4_flex",
@@ -533,6 +536,26 @@ dependencies = [
533
536
  "serde_derive",
534
537
  ]
535
538
 
539
+ [[package]]
540
+ name = "rayon"
541
+ version = "1.10.0"
542
+ source = "registry+https://github.com/rust-lang/crates.io-index"
543
+ checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
544
+ dependencies = [
545
+ "either",
546
+ "rayon-core",
547
+ ]
548
+
549
+ [[package]]
550
+ name = "rayon-core"
551
+ version = "1.12.1"
552
+ source = "registry+https://github.com/rust-lang/crates.io-index"
553
+ checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
554
+ dependencies = [
555
+ "crossbeam-deque",
556
+ "crossbeam-utils",
557
+ ]
558
+
536
559
  [[package]]
537
560
  name = "rustc-hash"
538
561
  version = "2.1.1"
@@ -545,6 +568,12 @@ version = "1.0.21"
545
568
  source = "registry+https://github.com/rust-lang/crates.io-index"
546
569
  checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"
547
570
 
571
+ [[package]]
572
+ name = "ryu"
573
+ version = "1.0.20"
574
+ source = "registry+https://github.com/rust-lang/crates.io-index"
575
+ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
576
+
548
577
  [[package]]
549
578
  name = "serde"
550
579
  version = "1.0.219"
@@ -565,6 +594,19 @@ dependencies = [
565
594
  "syn",
566
595
  ]
567
596
 
597
+ [[package]]
598
+ name = "serde_json"
599
+ version = "1.0.140"
600
+ source = "registry+https://github.com/rust-lang/crates.io-index"
601
+ checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
602
+ dependencies = [
603
+ "indexmap",
604
+ "itoa",
605
+ "memchr",
606
+ "ryu",
607
+ "serde",
608
+ ]
609
+
568
610
  [[package]]
569
611
  name = "sha2"
570
612
  version = "0.10.9"
@@ -665,6 +707,13 @@ version = "1.18.0"
665
707
  source = "registry+https://github.com/rust-lang/crates.io-index"
666
708
  checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
667
709
 
710
+ [[package]]
711
+ name = "typetree-generator-api"
712
+ version = "1.0.0"
713
+ dependencies = [
714
+ "rabex",
715
+ ]
716
+
668
717
  [[package]]
669
718
  name = "ucd-trie"
670
719
  version = "0.1.7"
@@ -685,22 +734,38 @@ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
685
734
 
686
735
  [[package]]
687
736
  name = "unity-scene-repacker"
688
- version = "2.1.0"
737
+ version = "2.2.1"
689
738
  dependencies = [
690
739
  "anyhow",
691
740
  "byteorder",
692
- "clap",
693
- "clap_complete",
694
741
  "elsa",
695
742
  "indexmap",
696
- "json5",
743
+ "log",
744
+ "lz4_flex",
697
745
  "memmap2",
698
- "paris",
699
746
  "rabex",
747
+ "rayon",
700
748
  "rustc-hash",
701
749
  "serde",
702
750
  "serde_derive",
751
+ "serde_json",
752
+ "typetree-generator-api",
753
+ ]
754
+
755
+ [[package]]
756
+ name = "unity-scene-repacker-bin"
757
+ version = "2.2.1"
758
+ dependencies = [
759
+ "anyhow",
760
+ "clap",
761
+ "clap_complete",
762
+ "indexmap",
763
+ "json5",
764
+ "log",
765
+ "paris",
766
+ "rabex",
703
767
  "steamlocate",
768
+ "unity-scene-repacker",
704
769
  ]
705
770
 
706
771
  [[package]]
@@ -0,0 +1,48 @@
1
+ [package]
2
+ name = "unity-scene-repacker"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ license.workspace = true
6
+ repository.workspace = true
7
+ description.workspace = true
8
+
9
+ [dependencies]
10
+ anyhow = "1.0"
11
+ byteorder = "1.5"
12
+ elsa = "1.11"
13
+ indexmap = { version = "2.9", features = ["serde", "rayon"] }
14
+ log = "0.4"
15
+ lz4_flex = { version = "0.11", default-features = false }
16
+ memmap2 = "0.9"
17
+ rabex.workspace = true
18
+ rayon = "1.10"
19
+ rustc-hash = "2.1"
20
+ serde = { version = "1.0", default-features = false }
21
+ serde_derive = "1.0"
22
+ serde_json = { version = "1.0", features = ["preserve_order"] }
23
+ typetree-generator-api.workspace = true
24
+
25
+ [workspace]
26
+ members = ["cli", "typetree-generator-api"]
27
+ default-members = [".", "bindings", "cli", "typetree-generator-api"]
28
+
29
+ package.version = "2.2.1"
30
+ package.edition = "2024"
31
+ package.license = "MIT"
32
+ package.repository = "https://github.com/jakobhellermann/unity-scene-repacker"
33
+ package.description = "Repack unity level files into filtered asset bundles you can load at runtime"
34
+
35
+ [lints.clippy]
36
+ redundant_pattern_matching = "allow"
37
+ too_many_arguments = "allow"
38
+ type_complexity = "allow"
39
+
40
+ [workspace.dependencies]
41
+ typetree-generator-api = { path = "./typetree-generator-api" }
42
+ rabex = { git = "https://github.com/jakobhellermann/RustyAssetBundleEXtractor", branch = "all", default-features = false, features = [
43
+ "embed-tpk",
44
+ # "serde_path_to_error", nicer errors for debugging, at a 2x speed cost
45
+ ] }
46
+
47
+ # [patch."https://github.com/jakobhellermann/RustyAssetBundleEXtractor"]
48
+ # rabex = { path = "/home/jakob/dev/unity/RustyAssetBundleEXtractor" }
@@ -0,0 +1,10 @@
1
+ Metadata-Version: 2.4
2
+ Name: unity-scene-repacker
3
+ Version: 2.2.1
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Topic :: Games/Entertainment
6
+ License-File: LICENSE.md
7
+ Summary: Repack unity level files into filtered asset bundles you can load at runtime
8
+ License: MIT
9
+ Requires-Python: >=3.8
10
+ Project-URL: Source Code, https://github.com/jakobhellermann/unity-scene-repacker
@@ -12,7 +12,7 @@ This project lets you read scenes from the distributed game, take only what you
12
12
 
13
13
  ```sh
14
14
  uv tool install unity-scene-repacker # if you have uv installed
15
- cargo install --git https://github.com/jakobhellermann/unity-scene-repacker # to compile from source
15
+ cargo install --git https://github.com/jakobhellermann/unity-scene-repacker --locked # to compile from source
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -52,6 +52,13 @@ Options:
52
52
  --steam-game <STEAM_GAME>
53
53
  App ID or search term for the steam game to detect
54
54
 
55
+ --mode <MODE>
56
+ [default: asset]
57
+
58
+ Possible values:
59
+ - scene: Contains filtered 1:1 scenes you can load via LoadScene
60
+ - asset: A single bundle letting you load specific objects using LoadAsset
61
+
55
62
  --objects <OBJECTS>
56
63
  Path to JSON file, containing a map of scene name to a list of gameobject paths to include
57
64
 
@@ -0,0 +1,26 @@
1
+ [package]
2
+ name = "unity-scene-repacker-bin"
3
+ version.workspace = true
4
+ edition.workspace = true
5
+ license.workspace = true
6
+ repository.workspace = true
7
+ description.workspace = true
8
+
9
+ [dependencies]
10
+ anyhow = "1.0"
11
+ clap = { version = "4.5", features = ["derive", "unstable-markdown"] }
12
+ clap_complete = { version = "4.5", features = ["unstable-dynamic"] }
13
+ indexmap = "2.9"
14
+ json5 = "0.4"
15
+ log = "0.4"
16
+ paris = { version = "1.5", features = ["macros", "no_logger"] }
17
+ rabex = { workspace = true, features = ["compression-all"] }
18
+ steamlocate = "2.0"
19
+ unity-scene-repacker = { version = "2.1", path = ".." }
20
+
21
+ [features]
22
+ dhat-heap = []
23
+
24
+ [[bin]]
25
+ name = "unity-scene-repacker"
26
+ path = "src/main.rs"
@@ -0,0 +1,33 @@
1
+ use anyhow::Result;
2
+ use std::ffi::{OsStr, OsString};
3
+ use std::path::Path;
4
+
5
+ use clap_complete::CompletionCandidate;
6
+
7
+ use crate::locate::find_unity_data_dir;
8
+ pub fn complete_steam_game(current: &OsStr) -> Vec<CompletionCandidate> {
9
+ fn complete_steam_game_inner(_: &OsStr) -> Result<Vec<CompletionCandidate>> {
10
+ let steam = steamlocate::SteamDir::locate()?;
11
+
12
+ let mut candidates = Vec::new();
13
+
14
+ for library in steam.libraries()?.filter_map(Result::ok) {
15
+ for app in library.apps().filter_map(Result::ok) {
16
+ let app_dir = library.resolve_app_dir(&app);
17
+ let Some(_) = find_unity_data_dir(&app_dir).transpose() else {
18
+ continue;
19
+ };
20
+ let name = app
21
+ .name
22
+ .map(OsString::from)
23
+ .unwrap_or(Path::new(&app.install_dir).file_name().unwrap().to_owned());
24
+ candidates
25
+ .push(CompletionCandidate::new(name).help(Some(app.app_id.to_string().into())));
26
+ }
27
+ }
28
+
29
+ Ok(candidates)
30
+ }
31
+
32
+ complete_steam_game_inner(current).unwrap_or_default()
33
+ }