Skip to content

Commit b8a14c1

Browse files
committed
Mesh.obj export
1 parent fb2f5f5 commit b8a14c1

7 files changed

Lines changed: 397 additions & 170 deletions

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ for obj in env.objects:
204204

205205
### [AudioClip](UnityPy/classes/AudioClip.py)
206206

207-
* ``.samples`` - ``{sample-name : sample-data}`` dict
207+
* ``.samples`` - ``{sample-name : sample-data}``
208208

209209
The samples are converted into the .wav format.
210210
The sample-data is a .wav file in bytes.
@@ -216,6 +216,19 @@ for name, data in clip.samples.items():
216216
f.write(data)
217217
```
218218

219+
### [Mesh](UnityPy/classes/Mesh.py)
220+
221+
* ``.export()`` - mesh exported as .obj (str)
222+
223+
The mesh is converted into an Wavefront .obj file.
224+
225+
```python
226+
mesh : Mesh
227+
with open(f"{mesh.name}.obj", "wt", newlines = "") as f:
228+
# newlines = "" is important
229+
f.write(mesh.export())
230+
```
231+
219232
## Goals
220233

221234
### WIP

UnityPy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.6.0.3"
1+
__version__ = "1.6.1.0"
22

33
from .environment import Environment
44

0 commit comments

Comments
 (0)