-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy path__init__.py
More file actions
40 lines (32 loc) · 1.37 KB
/
Copy path__init__.py
File metadata and controls
40 lines (32 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
from pathlib import Path
if "SourceIO" not in sys.modules:
sys.modules['SourceIO'] = sys.modules[Path(__file__).parent.stem]
if sys.version_info < (3, 11, 0):
raise Exception("SourceIO requires python 3.11+ or Blender 4.2.0+")
from SourceIO.library import loaded_as_addon, running_in_blender
try:
import bpy
# 4.2 LTS is the oldest Blender bundling Python 3.11, which is the stable-ABI
# floor the bundled pylib is built against; 4.0/4.1 ship 3.10 and cannot load it.
if bpy.app.version < (4, 2, 0):
raise Exception("SourceIO only support blender 4.2.0 and above")
except ImportError:
bpy = ...
bl_info = {
"name": "SourceIO",
"author": "RED_EYE, ShadelessFox, Syborg64",
"version": (5, 5, 5),
"blender": (4, 2, 0),
"location": "File > Import > SourceEngine assets",
"description": "GoldSrc/Source1/Source2 Engine assets(.mdl, .bsp, .vmt, .vtf, .vmdl_c, .vwrld_c, .vtex_c)"
"Notice that you cannot delete this addon via blender UI, remove it manually from addons folder",
"category": "Import-Export"
}
import warnings
warnings.simplefilter("always", DeprecationWarning)
from SourceIO.library import loaded_as_addon, running_in_blender
if running_in_blender() and loaded_as_addon():
from SourceIO.blender_bindings.bindings import register, unregister
if __name__ == "__main__":
register()