Skip to main content

Azur Lane painting reconstructor/extractor.

Project description

azurpaint

PyPI supported Python versions MIT

Azur Lane painting reconstructor/extractor.

Install

Python 3.9.0 or higher is required

pip install azurpaint

Usage

Simple example to extract painting

  • create new folder
  • get and extract /Android/obb/com.YoStarEN.AzurLane/*.obb to new folder
  • copy AssetBundles from /Android/data/com.YoStarEN.AzurLane/files/AssetBundles

[!NOTE] only painting, paintings and paintingface folder are required from AssetBundles.

from pathlib import Path
from azurpaint import Azurpaint
from azurpaint.exception import PrefabNotFound

# extract painting with default expression/face
def extract(asset_bundle_path, prefab_path):
  try:
    azurpaint = Azurpaint(asset_bundle_path, prefab_path)

    # search dependencies automatically within AssetBundles (root)
    # this is still in experimental mode so far on testing the result is good
    # load_dependencies only searching in local file and it doesn't know
    # if there any missing dependency it doesn't know what file it is
    # so you should provide complete asset include extracted OBB before running this
    azurpaint.load_dependencies()

    # PIL.Image.Image
    return azurpaint.create()
  except PrefabNotFound:
    print(f"{prefab_path} is not an prefab.")


# extract painting with all face/expression into output_dir
def extract_all_face(asset_bundle_path, prefab_path, output_dir):
  try:
    azurpaint = Azurpaint(asset_bundle_path, prefab_path)
    azurpaint.load_dependencies()

    Path(output_dir).mkdir(parents=True, exist_ok=True)
    azurpaint.create().save(Path(output_dir, f"{azurpaint.prefab.name}-default.png"))

    for face in azurpaint.face_list:
      azurpaint.change_face(face)
      azurpaint.create().save(Path(output_dir, f"{azurpaint.prefab.name}-{face}.png"))

  except PrefabNotFound:
    print(f"{prefab_path} is not an prefab.")


if __name__ == '__main__':
  # azurpaint require asset that have .prefab
  # will raise PrefabNotFound if file is not an prefab
  extract('path_to/AssetBundles', 'painting/tashigan')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azurpaint-1.0.2.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azurpaint-1.0.2-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file azurpaint-1.0.2.tar.gz.

File metadata

  • Download URL: azurpaint-1.0.2.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for azurpaint-1.0.2.tar.gz
Algorithm Hash digest
SHA256 5b84c4216b1ba1bba954da2d95e4b0a93629615645dbaff14a03c7780a654707
MD5 eb6ce85985baa7853445a3d33d3973b7
BLAKE2b-256 4bedb9544e7fe3b0585634b95c4f27bed57cec0adb99668558f1cfecade6f5e0

See more details on using hashes here.

File details

Details for the file azurpaint-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: azurpaint-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for azurpaint-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 540f7cfcaf7a64404d387d23500951fbc4ed54a25a5f24e9f8b12a0389317129
MD5 a654a810df45eb5a6ed5da63b2da6dd8
BLAKE2b-256 6738b58d43e9edc3ccc26d05adcc22a97e198e96413ee58f7cb30709dcd49818

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page