Giter Site home page Giter Site logo

uuunyaa / blender_mmd_assets Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 2.0 38 KB

blender_mmd_assets is an asset maintenance project for Blender and MMD. The results of this project are being used by UuuNyaa/blender_mmd_uuunyaa_tools.

Home Page: https://github.com/UuuNyaa/blender_mmd_uuunyaa_tools/wiki

License: Creative Commons Attribution 4.0 International

Python 100.00%
blender mmd

blender_mmd_assets's Introduction

blender_mmd_assets

blender_mmd_assets is an asset maintenance project for Blender and MMD.

The results of this project are being used by UuuNyaa/blender_mmd_uuunyaa_tools.

Examples

Get latest assets.json

# Get latest asset download URL
import json
import requests

repo = 'UuuNyaa/blender_mmd_assets'
response = requests.get(
    f'https://api.github.com/repos/{repo}/releases/latest',
    headers={'Accept': 'application/vnd.github.v3+json'}
)

asset = json.loads(response.text)['assets'][0]
browser_download_url = asset['browser_download_url']

# Get assets zip file
response = requests.get(
    browser_download_url,
    headers={'Accept': 'application/zip'}
)

# Extract assets.json
import io
import zipfile

with zipfile.ZipFile(io.BytesIO(response.content)) as zip:
    assets_json = zip.read('assets.json').decode('utf-8')

print(assets_json)

Format of assets.json

{
  "format": "blender_mmd_assets:3",
  "description": "This file is a release asset of blender_mmd_assets",
  "license": "CC-BY-4.0 License",
  "created_at": "yyyy-mm-ddTHH:MM:SSZ",
  "asset_count": 9999,
  "assets": [
    {
      "id": "99999",
      "type": "MODEL_MMD",
      "url": "https://api.github.com/repos/UuuNyaa/blender_mmd_assets/issues/99999",
      "name": "English name",
      "tags": {
        "Male": "Male / 男性",
        "Official": "Official / 公式"
        ...
      },
      "updated_at": "yyyy-mm-ddTHH:MM:SSZ",
      "thumbnail_url": "https://.../thumbnail.png",
      "source_url": "https://.../distribution/source/url",
      "download_action": "get('https://.../download_asset.zip')",
      "import_action": "unzip(encoding='cp932'); import_pmx('path/to.pmx',scale=0.08)",
      "aliases": {
        "en": "English name",
        "zh": "Chinese name",
        "ja": "Japanese name",
        ...
      },
      "note": "Something note"
    },
    ...
  ]
}

Types

Tags

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.