sc-file 0.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.
- sc_file-0.0.0/LICENSE +21 -0
- sc_file-0.0.0/PKG-INFO +140 -0
- sc_file-0.0.0/README.md +122 -0
- sc_file-0.0.0/pyproject.toml +55 -0
- sc_file-0.0.0/sc_file.egg-info/PKG-INFO +140 -0
- sc_file-0.0.0/sc_file.egg-info/SOURCES.txt +87 -0
- sc_file-0.0.0/sc_file.egg-info/dependency_links.txt +1 -0
- sc_file-0.0.0/sc_file.egg-info/entry_points.txt +2 -0
- sc_file-0.0.0/sc_file.egg-info/requires.txt +4 -0
- sc_file-0.0.0/sc_file.egg-info/top_level.txt +1 -0
- sc_file-0.0.0/scfile/__init__.py +19 -0
- sc_file-0.0.0/scfile/__main__.py +26 -0
- sc_file-0.0.0/scfile/cli/__init__.py +13 -0
- sc_file-0.0.0/scfile/cli/commands.py +121 -0
- sc_file-0.0.0/scfile/cli/types.py +21 -0
- sc_file-0.0.0/scfile/cli/utils.py +62 -0
- sc_file-0.0.0/scfile/consts.py +106 -0
- sc_file-0.0.0/scfile/convert/__init__.py +33 -0
- sc_file-0.0.0/scfile/convert/base.py +65 -0
- sc_file-0.0.0/scfile/convert/detect.py +89 -0
- sc_file-0.0.0/scfile/convert/factory.py +38 -0
- sc_file-0.0.0/scfile/convert/formats.py +163 -0
- sc_file-0.0.0/scfile/convert/legacy.py +87 -0
- sc_file-0.0.0/scfile/core/__init__.py +29 -0
- sc_file-0.0.0/scfile/core/base.py +20 -0
- sc_file-0.0.0/scfile/core/context/__init__.py +16 -0
- sc_file-0.0.0/scfile/core/context/content.py +92 -0
- sc_file-0.0.0/scfile/core/context/options.py +24 -0
- sc_file-0.0.0/scfile/core/decoder.py +104 -0
- sc_file-0.0.0/scfile/core/encoder.py +111 -0
- sc_file-0.0.0/scfile/core/io/__init__.py +13 -0
- sc_file-0.0.0/scfile/core/io/base.py +55 -0
- sc_file-0.0.0/scfile/core/io/streams.py +39 -0
- sc_file-0.0.0/scfile/core/types.py +14 -0
- sc_file-0.0.0/scfile/enums.py +119 -0
- sc_file-0.0.0/scfile/exceptions.py +109 -0
- sc_file-0.0.0/scfile/formats/__init__.py +22 -0
- sc_file-0.0.0/scfile/formats/dae/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/dae/encoder.py +218 -0
- sc_file-0.0.0/scfile/formats/dae/utils.py +38 -0
- sc_file-0.0.0/scfile/formats/dds/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/dds/encoder.py +99 -0
- sc_file-0.0.0/scfile/formats/dds/enums.py +40 -0
- sc_file-0.0.0/scfile/formats/dds/header.py +26 -0
- sc_file-0.0.0/scfile/formats/dds/mask.py +12 -0
- sc_file-0.0.0/scfile/formats/glb/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/glb/base.py +26 -0
- sc_file-0.0.0/scfile/formats/glb/encoder.py +339 -0
- sc_file-0.0.0/scfile/formats/glb/enums.py +17 -0
- sc_file-0.0.0/scfile/formats/hdri/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/hdri/decoder.py +27 -0
- sc_file-0.0.0/scfile/formats/mcsa/__init__.py +9 -0
- sc_file-0.0.0/scfile/formats/mcsa/decoder.py +242 -0
- sc_file-0.0.0/scfile/formats/mcsa/exceptions.py +47 -0
- sc_file-0.0.0/scfile/formats/mcsa/io.py +129 -0
- sc_file-0.0.0/scfile/formats/mcsa/versions.py +14 -0
- sc_file-0.0.0/scfile/formats/mcsb/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/mcsb/decoder.py +11 -0
- sc_file-0.0.0/scfile/formats/mic/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/mic/decoder.py +17 -0
- sc_file-0.0.0/scfile/formats/ms3d/__init__.py +8 -0
- sc_file-0.0.0/scfile/formats/ms3d/encoder.py +140 -0
- sc_file-0.0.0/scfile/formats/ms3d/exceptions.py +23 -0
- sc_file-0.0.0/scfile/formats/ms3d/io.py +18 -0
- sc_file-0.0.0/scfile/formats/obj/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/obj/encoder.py +67 -0
- sc_file-0.0.0/scfile/formats/obj/faces.py +17 -0
- sc_file-0.0.0/scfile/formats/ol/__init__.py +9 -0
- sc_file-0.0.0/scfile/formats/ol/decoder.py +71 -0
- sc_file-0.0.0/scfile/formats/ol/exceptions.py +21 -0
- sc_file-0.0.0/scfile/formats/ol/formats.py +9 -0
- sc_file-0.0.0/scfile/formats/ol/io.py +22 -0
- sc_file-0.0.0/scfile/formats/png/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/png/encoder.py +12 -0
- sc_file-0.0.0/scfile/formats/texarr/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/texarr/decoder.py +30 -0
- sc_file-0.0.0/scfile/formats/zip/__init__.py +4 -0
- sc_file-0.0.0/scfile/formats/zip/encoder.py +13 -0
- sc_file-0.0.0/scfile/structures/__init__.py +16 -0
- sc_file-0.0.0/scfile/structures/animation.py +35 -0
- sc_file-0.0.0/scfile/structures/flags.py +18 -0
- sc_file-0.0.0/scfile/structures/mesh.py +55 -0
- sc_file-0.0.0/scfile/structures/scene.py +77 -0
- sc_file-0.0.0/scfile/structures/skeleton.py +122 -0
- sc_file-0.0.0/scfile/structures/texture.py +57 -0
- sc_file-0.0.0/scfile/structures/types.py +6 -0
- sc_file-0.0.0/scfile/structures/vectors.py +18 -0
- sc_file-0.0.0/scfile/types.py +7 -0
- sc_file-0.0.0/setup.cfg +4 -0
sc_file-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 onejeuu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sc_file-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sc-file
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: Utility & Library for decoding stalcraft assets
|
|
5
|
+
Author-email: onejeuu <mail@66rk.ru>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/onejeuu/sc-file
|
|
8
|
+
Project-URL: Repository, https://github.com/onejeuu/sc-file
|
|
9
|
+
Project-URL: Documentation, https://sc-file.readthedocs.io
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click<9.0.0,>=8.2.0
|
|
14
|
+
Requires-Dist: lz4<5.0.0,>=4.4.0
|
|
15
|
+
Requires-Dist: numpy<3.0.0,>=2.3.0
|
|
16
|
+
Requires-Dist: rich<15.0.0,>=14.1.0
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# sc-file
|
|
20
|
+
|
|
21
|
+
<!-- Links -->
|
|
22
|
+
|
|
23
|
+
[pypi]: https://pypi.org/project/sc-file
|
|
24
|
+
[license]: https://opensource.org/licenses/MIT
|
|
25
|
+
[tests]: https://github.com/onejeuu/sc-file/actions/workflows/tests.yml
|
|
26
|
+
[build]: https://github.com/onejeuu/sc-file/actions/workflows/release.yml
|
|
27
|
+
[issues]: https://github.com/onejeuu/sc-file/issues
|
|
28
|
+
[releases]: https://github.com/onejeuu/sc-file/releases
|
|
29
|
+
[docs]: https://sc-file.readthedocs.io/en/latest
|
|
30
|
+
[readme-ru]: README-RU.md
|
|
31
|
+
|
|
32
|
+
<!-- Usage -->
|
|
33
|
+
|
|
34
|
+
[usage-dragndrop]: https://en.wikipedia.org/wiki/Drag_and_drop
|
|
35
|
+
[usage-defaultapp]: https://support.microsoft.com/en-us/windows/e5d82cad-17d1-c53b-3505-f10a32e1894d
|
|
36
|
+
[usage-cli]: https://en.wikipedia.org/wiki/Command-line_interface
|
|
37
|
+
[usage-library]: https://pypi.org/project/sc-file
|
|
38
|
+
|
|
39
|
+
<!-- Docs -->
|
|
40
|
+
|
|
41
|
+
[docs-usage]: https://sc-file.readthedocs.io/en/latest/usage.html
|
|
42
|
+
[docs-faq]: https://sc-file.readthedocs.io/en/latest/faq.html
|
|
43
|
+
[docs-formats]: https://sc-file.readthedocs.io/en/latest/formats.html
|
|
44
|
+
[docs-support]: https://sc-file.readthedocs.io/en/latest/support.html
|
|
45
|
+
[docs-compile]: https://sc-file.readthedocs.io/en/latest/compile.html
|
|
46
|
+
[docs-library]: https://sc-file.readthedocs.io/en/latest/api/index.html
|
|
47
|
+
|
|
48
|
+
<!-- Badges -->
|
|
49
|
+
|
|
50
|
+
[badge-pypi]: https://img.shields.io/pypi/v/sc-file.svg
|
|
51
|
+
[badge-license]: https://img.shields.io/github/license/onejeuu/sc-file
|
|
52
|
+
[badge-docs]: https://img.shields.io/readthedocs/sc-file
|
|
53
|
+
[badge-tests]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/tests.yml?label=tests
|
|
54
|
+
[badge-build]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/release.yml?label=build
|
|
55
|
+
[badge-issues]: https://img.shields.io/github/issues/onejeuu/sc-file
|
|
56
|
+
[badge-ru]: https://img.shields.io/badge/перевод%20на-🇷🇺%20Русский-0096FF
|
|
57
|
+
|
|
58
|
+
<img src="assets/scfile.svg" alt="icon" width="96" />
|
|
59
|
+
|
|
60
|
+
[![Pypi][badge-pypi]][pypi] [![License][badge-license]][license] [![Docs][badge-docs]][docs] [![Tests][badge-tests]][tests] [![Build][badge-build]][build] [![Issues][badge-issues]][issues]
|
|
61
|
+
|
|
62
|
+
[![RU][badge-ru]][readme-ru]
|
|
63
|
+
|
|
64
|
+
## Overview
|
|
65
|
+
|
|
66
|
+
**scfile** is a utility and library for converting stalcraft assets (such as models and textures), into standard formats.
|
|
67
|
+
|
|
68
|
+
_this project is unofficial and not related to stalcraft devs. all trademarks and assets belong to their respective owners._
|
|
69
|
+
|
|
70
|
+
📚 Documentation: [sc-file.readthedocs.io][docs] \
|
|
71
|
+
[Usage][docs-usage] / [FAQ][docs-faq] / [Game Formats][docs-formats] / [Formats Support][docs-support] / [Compile Guide][docs-compile] / [Library API Reference][docs-library]
|
|
72
|
+
|
|
73
|
+
🗂️ Supported game formats: `.mcsb`, `.mcsa`, `.mcvd`, `.ol`, `.mic`, `.texarr`. \
|
|
74
|
+
[More about Game Formats...][docs-formats]
|
|
75
|
+
|
|
76
|
+
💻 Executable utility `scfile.exe` can be downloaded from [Releases page][releases] or [compiled from source][docs-compile] \
|
|
77
|
+
[More about Usage...][docs-usage]
|
|
78
|
+
|
|
79
|
+
❓ **Why reverse encoding into game formats is unsupported?** \
|
|
80
|
+
And other common questions are answered on [FAQ page][docs-faq].
|
|
81
|
+
|
|
82
|
+
## 🛠️ Supported Formats
|
|
83
|
+
|
|
84
|
+
| Type | Source | Output |
|
|
85
|
+
| ---------- | ------------------------- | ------------------------------- |
|
|
86
|
+
| 🧊 Model | `.mcsb`, `.mcsa`, `.mcvd` | `.glb`, `.obj`, `.dae`, `.ms3d` |
|
|
87
|
+
| 🧱 Texture | `.ol` | `.dds` |
|
|
88
|
+
| 🖼️ Image | `.mic` | `.png` |
|
|
89
|
+
| 📦 Archive | `.texarr` | `.zip` |
|
|
90
|
+
|
|
91
|
+
[More about Formats Support…][docs-support]
|
|
92
|
+
|
|
93
|
+
## 🚀 Usage
|
|
94
|
+
|
|
95
|
+
- **Easiest way is [Drag & Drop][usage-dragndrop]**. Just drag and drop your files onto `scfile.exe`.
|
|
96
|
+
- **Set scfile.exe as the [default application][usage-defaultapp]** for the required file types.
|
|
97
|
+
- **Via terminal as [CLI][usage-cli]** for specifying parameters.
|
|
98
|
+
- **As [Python library][usage-library]** for complex tasks.
|
|
99
|
+
|
|
100
|
+
Command example:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
scfile.exe model.mcsb -F dae --skeleton
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
[More about Usage...][docs-usage]
|
|
107
|
+
|
|
108
|
+
## 📖 Library
|
|
109
|
+
|
|
110
|
+
To install library for coding, use following command:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install sc-file -U
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Simple usage example:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from scfile import UserOptions, convert
|
|
120
|
+
|
|
121
|
+
# Optional convert settings
|
|
122
|
+
options = UserOptions(parse_skeleton=True)
|
|
123
|
+
|
|
124
|
+
# Specific format to format
|
|
125
|
+
convert.mcsb_to_obj(source="path/to/model.mcsb", options=options)
|
|
126
|
+
|
|
127
|
+
# Or auto detect by file suffix
|
|
128
|
+
convert.auto(source="path/to/model.mcsb", options=options)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
[More details about Library...][docs-library]
|
|
132
|
+
|
|
133
|
+
## 🤝 Acknowledgments
|
|
134
|
+
|
|
135
|
+
- `kommunist2021` – file structure research.
|
|
136
|
+
- `Art3mLapa` – advice, bug reports, contribution.
|
|
137
|
+
- `n1kodim` – advice, contribution.
|
|
138
|
+
- `IExploitableMan` – contribution.
|
|
139
|
+
- `Sarioga` – feedback, bug reports.
|
|
140
|
+
- `Hazart` – bug reports.
|
sc_file-0.0.0/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# sc-file
|
|
2
|
+
|
|
3
|
+
<!-- Links -->
|
|
4
|
+
|
|
5
|
+
[pypi]: https://pypi.org/project/sc-file
|
|
6
|
+
[license]: https://opensource.org/licenses/MIT
|
|
7
|
+
[tests]: https://github.com/onejeuu/sc-file/actions/workflows/tests.yml
|
|
8
|
+
[build]: https://github.com/onejeuu/sc-file/actions/workflows/release.yml
|
|
9
|
+
[issues]: https://github.com/onejeuu/sc-file/issues
|
|
10
|
+
[releases]: https://github.com/onejeuu/sc-file/releases
|
|
11
|
+
[docs]: https://sc-file.readthedocs.io/en/latest
|
|
12
|
+
[readme-ru]: README-RU.md
|
|
13
|
+
|
|
14
|
+
<!-- Usage -->
|
|
15
|
+
|
|
16
|
+
[usage-dragndrop]: https://en.wikipedia.org/wiki/Drag_and_drop
|
|
17
|
+
[usage-defaultapp]: https://support.microsoft.com/en-us/windows/e5d82cad-17d1-c53b-3505-f10a32e1894d
|
|
18
|
+
[usage-cli]: https://en.wikipedia.org/wiki/Command-line_interface
|
|
19
|
+
[usage-library]: https://pypi.org/project/sc-file
|
|
20
|
+
|
|
21
|
+
<!-- Docs -->
|
|
22
|
+
|
|
23
|
+
[docs-usage]: https://sc-file.readthedocs.io/en/latest/usage.html
|
|
24
|
+
[docs-faq]: https://sc-file.readthedocs.io/en/latest/faq.html
|
|
25
|
+
[docs-formats]: https://sc-file.readthedocs.io/en/latest/formats.html
|
|
26
|
+
[docs-support]: https://sc-file.readthedocs.io/en/latest/support.html
|
|
27
|
+
[docs-compile]: https://sc-file.readthedocs.io/en/latest/compile.html
|
|
28
|
+
[docs-library]: https://sc-file.readthedocs.io/en/latest/api/index.html
|
|
29
|
+
|
|
30
|
+
<!-- Badges -->
|
|
31
|
+
|
|
32
|
+
[badge-pypi]: https://img.shields.io/pypi/v/sc-file.svg
|
|
33
|
+
[badge-license]: https://img.shields.io/github/license/onejeuu/sc-file
|
|
34
|
+
[badge-docs]: https://img.shields.io/readthedocs/sc-file
|
|
35
|
+
[badge-tests]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/tests.yml?label=tests
|
|
36
|
+
[badge-build]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/release.yml?label=build
|
|
37
|
+
[badge-issues]: https://img.shields.io/github/issues/onejeuu/sc-file
|
|
38
|
+
[badge-ru]: https://img.shields.io/badge/перевод%20на-🇷🇺%20Русский-0096FF
|
|
39
|
+
|
|
40
|
+
<img src="assets/scfile.svg" alt="icon" width="96" />
|
|
41
|
+
|
|
42
|
+
[![Pypi][badge-pypi]][pypi] [![License][badge-license]][license] [![Docs][badge-docs]][docs] [![Tests][badge-tests]][tests] [![Build][badge-build]][build] [![Issues][badge-issues]][issues]
|
|
43
|
+
|
|
44
|
+
[![RU][badge-ru]][readme-ru]
|
|
45
|
+
|
|
46
|
+
## Overview
|
|
47
|
+
|
|
48
|
+
**scfile** is a utility and library for converting stalcraft assets (such as models and textures), into standard formats.
|
|
49
|
+
|
|
50
|
+
_this project is unofficial and not related to stalcraft devs. all trademarks and assets belong to their respective owners._
|
|
51
|
+
|
|
52
|
+
📚 Documentation: [sc-file.readthedocs.io][docs] \
|
|
53
|
+
[Usage][docs-usage] / [FAQ][docs-faq] / [Game Formats][docs-formats] / [Formats Support][docs-support] / [Compile Guide][docs-compile] / [Library API Reference][docs-library]
|
|
54
|
+
|
|
55
|
+
🗂️ Supported game formats: `.mcsb`, `.mcsa`, `.mcvd`, `.ol`, `.mic`, `.texarr`. \
|
|
56
|
+
[More about Game Formats...][docs-formats]
|
|
57
|
+
|
|
58
|
+
💻 Executable utility `scfile.exe` can be downloaded from [Releases page][releases] or [compiled from source][docs-compile] \
|
|
59
|
+
[More about Usage...][docs-usage]
|
|
60
|
+
|
|
61
|
+
❓ **Why reverse encoding into game formats is unsupported?** \
|
|
62
|
+
And other common questions are answered on [FAQ page][docs-faq].
|
|
63
|
+
|
|
64
|
+
## 🛠️ Supported Formats
|
|
65
|
+
|
|
66
|
+
| Type | Source | Output |
|
|
67
|
+
| ---------- | ------------------------- | ------------------------------- |
|
|
68
|
+
| 🧊 Model | `.mcsb`, `.mcsa`, `.mcvd` | `.glb`, `.obj`, `.dae`, `.ms3d` |
|
|
69
|
+
| 🧱 Texture | `.ol` | `.dds` |
|
|
70
|
+
| 🖼️ Image | `.mic` | `.png` |
|
|
71
|
+
| 📦 Archive | `.texarr` | `.zip` |
|
|
72
|
+
|
|
73
|
+
[More about Formats Support…][docs-support]
|
|
74
|
+
|
|
75
|
+
## 🚀 Usage
|
|
76
|
+
|
|
77
|
+
- **Easiest way is [Drag & Drop][usage-dragndrop]**. Just drag and drop your files onto `scfile.exe`.
|
|
78
|
+
- **Set scfile.exe as the [default application][usage-defaultapp]** for the required file types.
|
|
79
|
+
- **Via terminal as [CLI][usage-cli]** for specifying parameters.
|
|
80
|
+
- **As [Python library][usage-library]** for complex tasks.
|
|
81
|
+
|
|
82
|
+
Command example:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
scfile.exe model.mcsb -F dae --skeleton
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
[More about Usage...][docs-usage]
|
|
89
|
+
|
|
90
|
+
## 📖 Library
|
|
91
|
+
|
|
92
|
+
To install library for coding, use following command:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pip install sc-file -U
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Simple usage example:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from scfile import UserOptions, convert
|
|
102
|
+
|
|
103
|
+
# Optional convert settings
|
|
104
|
+
options = UserOptions(parse_skeleton=True)
|
|
105
|
+
|
|
106
|
+
# Specific format to format
|
|
107
|
+
convert.mcsb_to_obj(source="path/to/model.mcsb", options=options)
|
|
108
|
+
|
|
109
|
+
# Or auto detect by file suffix
|
|
110
|
+
convert.auto(source="path/to/model.mcsb", options=options)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
[More details about Library...][docs-library]
|
|
114
|
+
|
|
115
|
+
## 🤝 Acknowledgments
|
|
116
|
+
|
|
117
|
+
- `kommunist2021` – file structure research.
|
|
118
|
+
- `Art3mLapa` – advice, bug reports, contribution.
|
|
119
|
+
- `n1kodim` – advice, contribution.
|
|
120
|
+
- `IExploitableMan` – contribution.
|
|
121
|
+
- `Sarioga` – feedback, bug reports.
|
|
122
|
+
- `Hazart` – bug reports.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "sc-file"
|
|
3
|
+
description = "Utility & Library for decoding stalcraft assets"
|
|
4
|
+
|
|
5
|
+
dynamic = ["version"]
|
|
6
|
+
|
|
7
|
+
requires-python = ">=3.11"
|
|
8
|
+
|
|
9
|
+
authors = [{ name = "onejeuu", email = "mail@66rk.ru" }]
|
|
10
|
+
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
license = "MIT"
|
|
13
|
+
|
|
14
|
+
dependencies = [
|
|
15
|
+
"click>=8.2.0,<9.0.0",
|
|
16
|
+
"lz4>=4.4.0,<5.0.0",
|
|
17
|
+
"numpy>=2.3.0,<3.0.0",
|
|
18
|
+
"rich>=14.1.0,<15.0.0",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[dependency-groups]
|
|
22
|
+
dev = [
|
|
23
|
+
"pyinstaller>=6.15.0,<7.0.0",
|
|
24
|
+
"pytest>=8.4.0,<9.0.0",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
docs = [
|
|
28
|
+
"sphinx>=8.2.3,<9.0.0",
|
|
29
|
+
"sphinx-autobuild>=2025.8.25",
|
|
30
|
+
"sphinx-autodoc-typehints>=3.5.2",
|
|
31
|
+
"sphinx-book-theme>=1.1.4",
|
|
32
|
+
"sphinx-intl>=2.3.2",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/onejeuu/sc-file"
|
|
37
|
+
Repository = "https://github.com/onejeuu/sc-file"
|
|
38
|
+
Documentation = "https://sc-file.readthedocs.io"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
scfile = "scfile.__main__:main"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools]
|
|
44
|
+
packages = { find = { include = ["scfile", "scfile.*"] } }
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
ignore = ["E701"]
|
|
48
|
+
|
|
49
|
+
[tool.isort]
|
|
50
|
+
lines_after_imports = 2
|
|
51
|
+
skip = ["__init__.py"]
|
|
52
|
+
|
|
53
|
+
[build-system]
|
|
54
|
+
requires = ["setuptools"]
|
|
55
|
+
build-backend = "setuptools.build_meta"
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sc-file
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: Utility & Library for decoding stalcraft assets
|
|
5
|
+
Author-email: onejeuu <mail@66rk.ru>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/onejeuu/sc-file
|
|
8
|
+
Project-URL: Repository, https://github.com/onejeuu/sc-file
|
|
9
|
+
Project-URL: Documentation, https://sc-file.readthedocs.io
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: click<9.0.0,>=8.2.0
|
|
14
|
+
Requires-Dist: lz4<5.0.0,>=4.4.0
|
|
15
|
+
Requires-Dist: numpy<3.0.0,>=2.3.0
|
|
16
|
+
Requires-Dist: rich<15.0.0,>=14.1.0
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# sc-file
|
|
20
|
+
|
|
21
|
+
<!-- Links -->
|
|
22
|
+
|
|
23
|
+
[pypi]: https://pypi.org/project/sc-file
|
|
24
|
+
[license]: https://opensource.org/licenses/MIT
|
|
25
|
+
[tests]: https://github.com/onejeuu/sc-file/actions/workflows/tests.yml
|
|
26
|
+
[build]: https://github.com/onejeuu/sc-file/actions/workflows/release.yml
|
|
27
|
+
[issues]: https://github.com/onejeuu/sc-file/issues
|
|
28
|
+
[releases]: https://github.com/onejeuu/sc-file/releases
|
|
29
|
+
[docs]: https://sc-file.readthedocs.io/en/latest
|
|
30
|
+
[readme-ru]: README-RU.md
|
|
31
|
+
|
|
32
|
+
<!-- Usage -->
|
|
33
|
+
|
|
34
|
+
[usage-dragndrop]: https://en.wikipedia.org/wiki/Drag_and_drop
|
|
35
|
+
[usage-defaultapp]: https://support.microsoft.com/en-us/windows/e5d82cad-17d1-c53b-3505-f10a32e1894d
|
|
36
|
+
[usage-cli]: https://en.wikipedia.org/wiki/Command-line_interface
|
|
37
|
+
[usage-library]: https://pypi.org/project/sc-file
|
|
38
|
+
|
|
39
|
+
<!-- Docs -->
|
|
40
|
+
|
|
41
|
+
[docs-usage]: https://sc-file.readthedocs.io/en/latest/usage.html
|
|
42
|
+
[docs-faq]: https://sc-file.readthedocs.io/en/latest/faq.html
|
|
43
|
+
[docs-formats]: https://sc-file.readthedocs.io/en/latest/formats.html
|
|
44
|
+
[docs-support]: https://sc-file.readthedocs.io/en/latest/support.html
|
|
45
|
+
[docs-compile]: https://sc-file.readthedocs.io/en/latest/compile.html
|
|
46
|
+
[docs-library]: https://sc-file.readthedocs.io/en/latest/api/index.html
|
|
47
|
+
|
|
48
|
+
<!-- Badges -->
|
|
49
|
+
|
|
50
|
+
[badge-pypi]: https://img.shields.io/pypi/v/sc-file.svg
|
|
51
|
+
[badge-license]: https://img.shields.io/github/license/onejeuu/sc-file
|
|
52
|
+
[badge-docs]: https://img.shields.io/readthedocs/sc-file
|
|
53
|
+
[badge-tests]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/tests.yml?label=tests
|
|
54
|
+
[badge-build]: https://img.shields.io/github/actions/workflow/status/onejeuu/sc-file/release.yml?label=build
|
|
55
|
+
[badge-issues]: https://img.shields.io/github/issues/onejeuu/sc-file
|
|
56
|
+
[badge-ru]: https://img.shields.io/badge/перевод%20на-🇷🇺%20Русский-0096FF
|
|
57
|
+
|
|
58
|
+
<img src="assets/scfile.svg" alt="icon" width="96" />
|
|
59
|
+
|
|
60
|
+
[![Pypi][badge-pypi]][pypi] [![License][badge-license]][license] [![Docs][badge-docs]][docs] [![Tests][badge-tests]][tests] [![Build][badge-build]][build] [![Issues][badge-issues]][issues]
|
|
61
|
+
|
|
62
|
+
[![RU][badge-ru]][readme-ru]
|
|
63
|
+
|
|
64
|
+
## Overview
|
|
65
|
+
|
|
66
|
+
**scfile** is a utility and library for converting stalcraft assets (such as models and textures), into standard formats.
|
|
67
|
+
|
|
68
|
+
_this project is unofficial and not related to stalcraft devs. all trademarks and assets belong to their respective owners._
|
|
69
|
+
|
|
70
|
+
📚 Documentation: [sc-file.readthedocs.io][docs] \
|
|
71
|
+
[Usage][docs-usage] / [FAQ][docs-faq] / [Game Formats][docs-formats] / [Formats Support][docs-support] / [Compile Guide][docs-compile] / [Library API Reference][docs-library]
|
|
72
|
+
|
|
73
|
+
🗂️ Supported game formats: `.mcsb`, `.mcsa`, `.mcvd`, `.ol`, `.mic`, `.texarr`. \
|
|
74
|
+
[More about Game Formats...][docs-formats]
|
|
75
|
+
|
|
76
|
+
💻 Executable utility `scfile.exe` can be downloaded from [Releases page][releases] or [compiled from source][docs-compile] \
|
|
77
|
+
[More about Usage...][docs-usage]
|
|
78
|
+
|
|
79
|
+
❓ **Why reverse encoding into game formats is unsupported?** \
|
|
80
|
+
And other common questions are answered on [FAQ page][docs-faq].
|
|
81
|
+
|
|
82
|
+
## 🛠️ Supported Formats
|
|
83
|
+
|
|
84
|
+
| Type | Source | Output |
|
|
85
|
+
| ---------- | ------------------------- | ------------------------------- |
|
|
86
|
+
| 🧊 Model | `.mcsb`, `.mcsa`, `.mcvd` | `.glb`, `.obj`, `.dae`, `.ms3d` |
|
|
87
|
+
| 🧱 Texture | `.ol` | `.dds` |
|
|
88
|
+
| 🖼️ Image | `.mic` | `.png` |
|
|
89
|
+
| 📦 Archive | `.texarr` | `.zip` |
|
|
90
|
+
|
|
91
|
+
[More about Formats Support…][docs-support]
|
|
92
|
+
|
|
93
|
+
## 🚀 Usage
|
|
94
|
+
|
|
95
|
+
- **Easiest way is [Drag & Drop][usage-dragndrop]**. Just drag and drop your files onto `scfile.exe`.
|
|
96
|
+
- **Set scfile.exe as the [default application][usage-defaultapp]** for the required file types.
|
|
97
|
+
- **Via terminal as [CLI][usage-cli]** for specifying parameters.
|
|
98
|
+
- **As [Python library][usage-library]** for complex tasks.
|
|
99
|
+
|
|
100
|
+
Command example:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
scfile.exe model.mcsb -F dae --skeleton
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
[More about Usage...][docs-usage]
|
|
107
|
+
|
|
108
|
+
## 📖 Library
|
|
109
|
+
|
|
110
|
+
To install library for coding, use following command:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install sc-file -U
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Simple usage example:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from scfile import UserOptions, convert
|
|
120
|
+
|
|
121
|
+
# Optional convert settings
|
|
122
|
+
options = UserOptions(parse_skeleton=True)
|
|
123
|
+
|
|
124
|
+
# Specific format to format
|
|
125
|
+
convert.mcsb_to_obj(source="path/to/model.mcsb", options=options)
|
|
126
|
+
|
|
127
|
+
# Or auto detect by file suffix
|
|
128
|
+
convert.auto(source="path/to/model.mcsb", options=options)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
[More details about Library...][docs-library]
|
|
132
|
+
|
|
133
|
+
## 🤝 Acknowledgments
|
|
134
|
+
|
|
135
|
+
- `kommunist2021` – file structure research.
|
|
136
|
+
- `Art3mLapa` – advice, bug reports, contribution.
|
|
137
|
+
- `n1kodim` – advice, contribution.
|
|
138
|
+
- `IExploitableMan` – contribution.
|
|
139
|
+
- `Sarioga` – feedback, bug reports.
|
|
140
|
+
- `Hazart` – bug reports.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
sc_file.egg-info/PKG-INFO
|
|
5
|
+
sc_file.egg-info/SOURCES.txt
|
|
6
|
+
sc_file.egg-info/dependency_links.txt
|
|
7
|
+
sc_file.egg-info/entry_points.txt
|
|
8
|
+
sc_file.egg-info/requires.txt
|
|
9
|
+
sc_file.egg-info/top_level.txt
|
|
10
|
+
scfile/__init__.py
|
|
11
|
+
scfile/__main__.py
|
|
12
|
+
scfile/consts.py
|
|
13
|
+
scfile/enums.py
|
|
14
|
+
scfile/exceptions.py
|
|
15
|
+
scfile/types.py
|
|
16
|
+
scfile/cli/__init__.py
|
|
17
|
+
scfile/cli/commands.py
|
|
18
|
+
scfile/cli/types.py
|
|
19
|
+
scfile/cli/utils.py
|
|
20
|
+
scfile/convert/__init__.py
|
|
21
|
+
scfile/convert/base.py
|
|
22
|
+
scfile/convert/detect.py
|
|
23
|
+
scfile/convert/factory.py
|
|
24
|
+
scfile/convert/formats.py
|
|
25
|
+
scfile/convert/legacy.py
|
|
26
|
+
scfile/core/__init__.py
|
|
27
|
+
scfile/core/base.py
|
|
28
|
+
scfile/core/decoder.py
|
|
29
|
+
scfile/core/encoder.py
|
|
30
|
+
scfile/core/types.py
|
|
31
|
+
scfile/core/context/__init__.py
|
|
32
|
+
scfile/core/context/content.py
|
|
33
|
+
scfile/core/context/options.py
|
|
34
|
+
scfile/core/io/__init__.py
|
|
35
|
+
scfile/core/io/base.py
|
|
36
|
+
scfile/core/io/streams.py
|
|
37
|
+
scfile/formats/__init__.py
|
|
38
|
+
scfile/formats/dae/__init__.py
|
|
39
|
+
scfile/formats/dae/encoder.py
|
|
40
|
+
scfile/formats/dae/utils.py
|
|
41
|
+
scfile/formats/dds/__init__.py
|
|
42
|
+
scfile/formats/dds/encoder.py
|
|
43
|
+
scfile/formats/dds/enums.py
|
|
44
|
+
scfile/formats/dds/header.py
|
|
45
|
+
scfile/formats/dds/mask.py
|
|
46
|
+
scfile/formats/glb/__init__.py
|
|
47
|
+
scfile/formats/glb/base.py
|
|
48
|
+
scfile/formats/glb/encoder.py
|
|
49
|
+
scfile/formats/glb/enums.py
|
|
50
|
+
scfile/formats/hdri/__init__.py
|
|
51
|
+
scfile/formats/hdri/decoder.py
|
|
52
|
+
scfile/formats/mcsa/__init__.py
|
|
53
|
+
scfile/formats/mcsa/decoder.py
|
|
54
|
+
scfile/formats/mcsa/exceptions.py
|
|
55
|
+
scfile/formats/mcsa/io.py
|
|
56
|
+
scfile/formats/mcsa/versions.py
|
|
57
|
+
scfile/formats/mcsb/__init__.py
|
|
58
|
+
scfile/formats/mcsb/decoder.py
|
|
59
|
+
scfile/formats/mic/__init__.py
|
|
60
|
+
scfile/formats/mic/decoder.py
|
|
61
|
+
scfile/formats/ms3d/__init__.py
|
|
62
|
+
scfile/formats/ms3d/encoder.py
|
|
63
|
+
scfile/formats/ms3d/exceptions.py
|
|
64
|
+
scfile/formats/ms3d/io.py
|
|
65
|
+
scfile/formats/obj/__init__.py
|
|
66
|
+
scfile/formats/obj/encoder.py
|
|
67
|
+
scfile/formats/obj/faces.py
|
|
68
|
+
scfile/formats/ol/__init__.py
|
|
69
|
+
scfile/formats/ol/decoder.py
|
|
70
|
+
scfile/formats/ol/exceptions.py
|
|
71
|
+
scfile/formats/ol/formats.py
|
|
72
|
+
scfile/formats/ol/io.py
|
|
73
|
+
scfile/formats/png/__init__.py
|
|
74
|
+
scfile/formats/png/encoder.py
|
|
75
|
+
scfile/formats/texarr/__init__.py
|
|
76
|
+
scfile/formats/texarr/decoder.py
|
|
77
|
+
scfile/formats/zip/__init__.py
|
|
78
|
+
scfile/formats/zip/encoder.py
|
|
79
|
+
scfile/structures/__init__.py
|
|
80
|
+
scfile/structures/animation.py
|
|
81
|
+
scfile/structures/flags.py
|
|
82
|
+
scfile/structures/mesh.py
|
|
83
|
+
scfile/structures/scene.py
|
|
84
|
+
scfile/structures/skeleton.py
|
|
85
|
+
scfile/structures/texture.py
|
|
86
|
+
scfile/structures/types.py
|
|
87
|
+
scfile/structures/vectors.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
scfile
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
__version__ = "4.1.2"
|
|
2
|
+
__author__ = "onejeuu"
|
|
3
|
+
__license__ = "MIT"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
from . import cli, convert, core, exceptions, formats, structures, consts, enums
|
|
7
|
+
from .core.context.options import UserOptions
|
|
8
|
+
|
|
9
|
+
__all__ = (
|
|
10
|
+
"cli",
|
|
11
|
+
"convert",
|
|
12
|
+
"core",
|
|
13
|
+
"exceptions",
|
|
14
|
+
"formats",
|
|
15
|
+
"structures",
|
|
16
|
+
"consts",
|
|
17
|
+
"enums",
|
|
18
|
+
"UserOptions",
|
|
19
|
+
)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
from rich import print
|
|
5
|
+
|
|
6
|
+
from scfile.cli import scfile
|
|
7
|
+
from scfile.enums import L
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
"""Program entrypoint."""
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
scfile(standalone_mode=False)
|
|
15
|
+
|
|
16
|
+
except click.ClickException as err:
|
|
17
|
+
print(L.INVALID, str(err))
|
|
18
|
+
|
|
19
|
+
except (KeyboardInterrupt, click.exceptions.Abort):
|
|
20
|
+
print("[yellow]Operation aborted.[/]")
|
|
21
|
+
|
|
22
|
+
sys.exit()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if __name__ == "__main__":
|
|
26
|
+
main()
|