Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is how to unzip the file to get .obj. If I want to recompress it, how do I write it? #304

Open
MKapers opened this issue Mar 2, 2025 · 0 comments

Comments

@MKapers
Copy link

MKapers commented Mar 2, 2025

import os
import UnityPy

env = UnityPy.load("name.assetbundle")

extract_dir = 'Mesh/name'
os.makedirs(extract_dir, exist_ok=True)

for obj in env.objects:
if obj.type.name == "Mesh":
mesh = obj.read()

    output_path = os.path.join(extract_dir, f"{mesh.name}.obj")
    
    with open(output_path, "wt", newline="") as f:
        f.write(mesh.export())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant