Skip to content

Commit 46044aa

Browse files
New Extension Spec Compatibility and Usability Improvements (#36)
* improve recursive import by default it will now detect common prefixes and eliminate them. in the future it might be interesting to have an option to keep prefixes and simply use blenders naming to create a new one with an incremented name. * show hidden option that changes the relative root path * add blender manifest for 4.2 marketplace support * change to relative imports to not make blender angry from changing sys.path * update for new spec * change maintainer
1 parent d89c62d commit 46044aa

File tree

15 files changed

+147
-39
lines changed

15 files changed

+147
-39
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ __pycache__/
22
.DS_Store
33
.vscode/
44
*.zip
5+
*.whl
56

67
# the following ignores are used to ignore the local softlink files
78
# the extern folder won't be affected by this
@@ -10,4 +11,4 @@ meshio
1011
future
1112
fileseq
1213

13-
docs/_build/*
14+
docs/_build/*

__init__.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
1-
bl_info = {
2-
"name": "Sequence Loader",
3-
"description": "Loader for meshio supported mesh files/ simulation sequences",
4-
"author": "Interactive Computer Graphics",
5-
"version": (0, 3, 2),
6-
"blender": (4, 0, 0),
7-
"warning": "",
8-
"support": "COMMUNITY",
9-
"category": "Import-Export",
10-
}
11-
121
import bpy
132
import os
143
import sys
154

16-
current_folder = os.path.dirname(os.path.abspath(__file__))
17-
if current_folder not in sys.path:
18-
sys.path.append(current_folder)
19-
# add paths of external libraries to sys.path
20-
if os.path.exists(os.path.join(current_folder, "extern")):
21-
external_libs = ["fileseq/src", "meshio/src", "python-future/src", "rich"]
22-
for lib in external_libs:
23-
lib_path = os.path.join(current_folder, "extern", lib)
24-
if lib_path not in sys.path:
25-
sys.path.append(lib_path)
5+
# current_folder = os.path.dirname(os.path.abspath(__file__))
6+
# if current_folder not in sys.path:
7+
# sys.path.append(current_folder)
8+
# # add paths of external libraries to sys.path
9+
# if os.path.exists(os.path.join(current_folder, "extern")):
10+
# external_libs = ["fileseq/src", "meshio/src", "python-future/src", "rich"]
11+
# for lib in external_libs:
12+
# lib_path = os.path.join(current_folder, "extern", lib)
13+
# if lib_path not in sys.path:
14+
# sys.path.append(lib_path)
2615

2716

28-
if bpy.context.preferences.filepaths.use_relative_paths == True:
29-
bpy.context.preferences.filepaths.use_relative_paths = False
17+
# if bpy.context.preferences.filepaths.use_relative_paths == True:
18+
# bpy.context.preferences.filepaths.use_relative_paths = False
3019

31-
from bseq import *
32-
from bseq.operators import menu_func_import, add_keymap, delete_keymap
20+
from .bseq import *
21+
from .bseq.operators import menu_func_import, add_keymap, delete_keymap
3322

3423
classes = [
3524
BSEQ_obj_property,

blender_manifest.toml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
schema_version = "1.0.0"
2+
3+
# Example of manifest file for a Blender extension
4+
# Change the values according to your extension
5+
id = "sequence_loader"
6+
version = "0.3.3"
7+
name = "Blender Sequence Loader"
8+
tagline = "Just-in-time loader for meshio-supported mesh file sequences"
9+
maintainer = "Stefan Rhys Jeske <[email protected]>"
10+
# Supported types: "add-on", "theme"
11+
type = "add-on"
12+
13+
# # Optional: link to documentation, support, source files, etc
14+
website = "https://github.com/InteractiveComputerGraphics/blender-sequence-loader"
15+
16+
# # Optional: tag list defined by Blender and server, see:
17+
# # https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html
18+
tags = ["Animation", "Object"]
19+
20+
blender_version_min = "4.2.0"
21+
# # Optional: Blender version that the extension does not support, earlier versions are supported.
22+
# # This can be omitted and defined later on the extensions platform if an issue is found.
23+
# blender_version_max = "5.1.0"
24+
25+
# License conforming to https://spdx.org/licenses/ (use "SPDX: prefix)
26+
# https://docs.blender.org/manual/en/dev/advanced/extensions/licenses.html
27+
license = [
28+
"SPDX:MIT",
29+
]
30+
# # Optional: required by some licenses.
31+
# copyright = [
32+
# "2002-2024 Developer Name",
33+
# "1998 Company Name",
34+
# ]
35+
36+
# # Optional: list of supported platforms. If omitted, the extension will be available in all operating systems.
37+
# platforms = ["windows-x64", "macos-arm64", "linux-x64"]
38+
# # Other supported platforms: "windows-arm64", "macos-x64"
39+
40+
# # Optional: bundle 3rd party Python modules.
41+
# # https://docs.blender.org/manual/en/dev/advanced/extensions/python_wheels.html
42+
wheels = [
43+
"./wheels/Fileseq-1.15.2-py3-none-any.whl",
44+
"./wheels/future-0.18.3-py3-none-any.whl",
45+
"./wheels/meshio-5.3.4-py3-none-any.whl",
46+
"./wheels/rich-13.7.0-py3-none-any.whl",
47+
]
48+
49+
# # Optional: add-ons can list which resources they will require:
50+
# # * files (for access of any filesystem operations)
51+
# # * network (for internet access)
52+
# # * clipboard (to read and/or write the system clipboard)
53+
# # * camera (to capture photos and videos)
54+
# # * microphone (to capture audio)
55+
# #
56+
# # If using network, remember to also check `bpy.app.online_access`
57+
# # https://docs.blender.org/manual/en/dev/advanced/extensions/addons.html#internet-access
58+
# #
59+
# # For each permission it is important to also specify the reason why it is required.
60+
# # Keep this a single short sentence without a period (.) at the end.
61+
# # For longer explanations use the documentation or detail page.
62+
#
63+
[permissions]
64+
files = "Core functionality to load files from disk"
65+
66+
# # Optional: advanced build settings.
67+
# # https://docs.blender.org/manual/en/dev/advanced/extensions/command_line_arguments.html#command-line-args-extension-build
68+
[build]
69+
# These are the default build excluded patterns.
70+
# You only need to edit them if you want different options.
71+
paths_exclude_pattern = [
72+
"__pycache__/",
73+
"/.git/",
74+
"/*.zip",
75+
"/extern/",
76+
"/docs/",
77+
"/images/",
78+
"build_addon.py",
79+
"download_wheels.sh"
80+
]

bseq/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
from bseq.utils import refresh_obj
1+
from .utils import refresh_obj
22
from .operators import BSEQ_OT_load, BSEQ_OT_edit, BSEQ_OT_resetpt, BSEQ_OT_resetmesh, BSEQ_OT_resetins, BSEQ_OT_set_as_split_norm, BSEQ_OT_remove_split_norm, BSEQ_OT_disable_selected, BSEQ_OT_enable_selected, BSEQ_OT_refresh_seq, BSEQ_OT_disable_all, BSEQ_OT_enable_all, BSEQ_OT_refresh_sequences, BSEQ_OT_set_start_end_frames, BSEQ_OT_batch_sequences, BSEQ_PT_batch_sequences_settings, BSEQ_OT_meshio_object, BSEQ_OT_import_zip, BSEQ_OT_delete_zips, BSEQ_addon_preferences, BSEQ_OT_load_all, BSEQ_OT_load_all_recursive
33
from .properties import BSEQ_scene_property, BSEQ_obj_property, BSEQ_mesh_property
44
from .panels import BSEQ_UL_Obj_List, BSEQ_List_Panel, BSEQ_Settings, BSEQ_PT_Import, BSEQ_PT_Import_Child1, BSEQ_PT_Import_Child2, BSEQ_Globals_Panel, BSEQ_Advanced_Panel, BSEQ_Templates, BSEQ_UL_Att_List, draw_template
55
from .messenger import subscribe_to_selected, unsubscribe_to_selected
6-
import bpy
7-
from bpy.app.handlers import persistent
86
from .importer import update_obj
97
from .globals import *
108

9+
import bpy
10+
from bpy.app.handlers import persistent
11+
1112

1213
@persistent
1314
def BSEQ_initialize(scene):
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)