Skip to content

Commit

Permalink
Extensionify!
Browse files Browse the repository at this point in the history
  • Loading branch information
gregzaal committed Jul 17, 2024
1 parent eeafa5c commit 1f8d17c
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
hat_updater
polyhaven_hat-*.zip

# ------------------------ Pre-populated by GitHub template ------------------------

Expand Down
4 changes: 0 additions & 4 deletions _UPDATE.bat

This file was deleted.

13 changes: 0 additions & 13 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@
import bpy
from bpy.app.handlers import persistent

bl_info = {
"name": "HAT: Haven Asset Tester",
"description": "Internal quality control tool for polyhaven.com",
"author": "Poly Haven: Greg Zaal, James Cock",
"version": (1, 0, 17),
"blender": (3, 2, 0),
"location": "Properties > Scene",
"warning": "",
"wiki_url": "https://github.com/Poly-Haven/HAT",
"tracker_url": "https://github.com/Poly-Haven/HAT/issues",
"category": "Scene",
}


class HATProperties(bpy.types.PropertyGroup):
asset_type: bpy.props.EnumProperty(
Expand Down
73 changes: 73 additions & 0 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
schema_version = "1.0.0"

# Example of manifest file for a Blender extension
# Change the values according to your extension
id = "polyhaven_hat"
version = "1.0.18"
name = "HAT"
tagline = "Internal quality control tool for polyhaven.com"
maintainer = "Greg Zaal <greg@polyhaven.com>"
# Supported types: "add-on", "theme"
type = "add-on"

# Optional link to documentation, support, source files, etc
website = "https://github.com/Poly-Haven/HAT"

# Optional list defined by Blender and server, see:
# https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html
tags = ["Scene", "Import-Export"]

blender_version_min = "4.2.0"
# # Optional: Blender version that the extension does not support, earlier versions are supported.
# # This can be omitted and defined later on the extensions platform if an issue is found.
# blender_version_max = "5.1.0"

# License conforming to https://spdx.org/licenses/ (use "SPDX: prefix)
# https://docs.blender.org/manual/en/dev/advanced/extensions/licenses.html
license = ["SPDX:GPL-2.0-or-later"]
# Optional: required by some licenses.
# copyright = [
# "2002-2024 Developer Name",
# "1998 Company Name",
# ]

# Optional list of supported platforms. If omitted, the extension will be available in all operating systems.
# platforms = ["windows-x64", "macos-arm64", "linux-x64"]
# Other supported platforms: "windows-arm64", "macos-x64"

# Optional: bundle 3rd party Python modules.
# https://docs.blender.org/manual/en/dev/advanced/extensions/python_wheels.html
# wheels = [
# "./wheels/hexdump-3.3-py3-none-any.whl",
# "./wheels/jsmin-3.0.1-py3-none-any.whl",
# ]

# # Optional: add-ons can list which resources they will require:
# # * files (for access of any filesystem operations)
# # * network (for internet access)
# # * clipboard (to read and/or write the system clipboard)
# # * camera (to capture photos and videos)
# # * microphone (to capture audio)
# #
# # If using network, remember to also check `bpy.app.online_access`
# # https://docs.blender.org/manual/en/dev/advanced/extensions/addons.html#internet-access
# #
# # For each permission it is important to also specify the reason why it is required.
# # Keep this a single short sentence without a period (.) at the end.
# # For longer explanations use the documentation or detail page.
#
# [permissions]
# network = "Need to sync motion-capture data to server"
files = "Import/export"
# clipboard = "Copy and paste bone transforms"

# Optional: build settings.
# https://docs.blender.org/manual/en/dev/advanced/extensions/command_line_arguments.html#command-line-args-extension-build
# [build]
paths_exclude_pattern = [
"__pycache__/",
"/.git/",
"/*.zip",
"/*.bat",
".gitignore",
]
1 change: 1 addition & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blender --factory-startup --command extension build
27 changes: 27 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "v1",
"blocklist": [],
"data": [
{
"schema_version": "1.0.0",
"id": "polyhaven_hat",
"name": "HAT",
"tagline": "Internal quality control tool for polyhaven.com",
"version": "1.0.18",
"type": "add-on",
"maintainer": "Greg Zaal <greg@polyhaven.com>",
"license": [
"SPDX:GPL-2.0-or-later"
],
"blender_version_min": "4.2.0",
"website": "https://github.com/Poly-Haven/HAT",
"tags": [
"Scene",
"Import-Export"
],
"archive_url": "./polyhaven_hat-1.0.18.zip",
"archive_size": 182269,
"archive_hash": "sha256:ad3b82d9cb9a0b73b4887e5856aeb2fd14ddbce436e426f744cd87f1a6c17693"
}
]
}
4 changes: 2 additions & 2 deletions operators/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
checks = {}
for c in check_list:
if "bpy" not in locals():
m = importlib.import_module("." + c, "HAT.operators.checks")
m = importlib.import_module(".checks." + c, __package__)
else:
m = sys.modules["HAT.operators.checks." + c]
m = sys.modules["bl_ext.user_default.polyhaven_hat.operators.checks." + c]
importlib.reload(m)
checks[c] = m

Expand Down

0 comments on commit 1f8d17c

Please sign in to comment.