-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cff3b12
Showing
7 changed files
with
1,750 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import sys | ||
import importlib | ||
|
||
# Add-on Metadata | ||
|
||
bl_info = { | ||
"name": "SWTOR Character Locator", | ||
"author": "ZeroGravitas", | ||
"version": (1, 0, 0), | ||
"blender": (3, 1, 0), | ||
"category": "SWTOR", | ||
"location": "View 3D > Sidebar > ZG SWTOR", | ||
"description": "Processes SWTOR characters and NPCs' folders exported from TORCommunity.com", | ||
"doc_url": "https://github.com/SWTOR-Slicers/swtor-character-locator", | ||
"tracker_url": "", | ||
} | ||
|
||
# Add-on modules loader: | ||
# Simplifies coding the loading of the modules to keeping a list of their names | ||
# (See https://b3d.interplanety.org/en/creating-multifile-add-on-for-blender/ ) | ||
|
||
modulesNames = [ | ||
'preferences', | ||
'swtor_character_locator', | ||
] | ||
|
||
modulesFullNames = {} | ||
for currentModuleName in modulesNames: | ||
modulesFullNames[currentModuleName] = ('{}.{}'.format(__name__, currentModuleName)) | ||
|
||
for currentModuleFullName in modulesFullNames.values(): | ||
if currentModuleFullName in sys.modules: | ||
importlib.reload(sys.modules[currentModuleFullName]) | ||
else: | ||
globals()[currentModuleFullName] = importlib.import_module(currentModuleFullName) | ||
setattr(globals()[currentModuleFullName], 'modulesNames', modulesFullNames) | ||
|
||
|
||
def register(): | ||
for currentModuleName in modulesFullNames.values(): | ||
if currentModuleName in sys.modules: | ||
if hasattr(sys.modules[currentModuleName], 'register'): | ||
sys.modules[currentModuleName].register() | ||
|
||
def unregister(): | ||
for currentModuleName in modulesFullNames.values(): | ||
if currentModuleName in sys.modules: | ||
if hasattr(sys.modules[currentModuleName], 'unregister'): | ||
sys.modules[currentModuleName].unregister() | ||
|
||
if __name__ == "__main__": | ||
register()# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import bpy | ||
import os | ||
from pathlib import Path | ||
|
||
class SWCL_addonPreferences(bpy.types.AddonPreferences): | ||
bl_idname = __package__ | ||
|
||
# Preferences properties -------------------- | ||
|
||
# resources folderpath | ||
swtor_resources_folderpath: bpy.props.StringProperty( | ||
name = "SWTOR Resources", | ||
description = 'Path to the "resources" folder produced by a SWTOR assets extraction', | ||
subtype = "DIR_PATH", | ||
default = "Choose or type the folder's path", | ||
maxlen = 1024 | ||
) | ||
|
||
|
||
# UI ---------------------------------------- | ||
|
||
def draw(self, context): | ||
layout = self.layout | ||
|
||
# resources folderpath preferences UI | ||
pref_box = layout.box() | ||
col=pref_box.column() | ||
col.scale_y = 0.7 | ||
col.label(text="Path to the 'resources' folder in a SWTOR assets extraction") | ||
col.label(text="produced by the Slicers GUI app, EasyMYP, or any similar tool.") | ||
pref_box.prop(self, 'swtor_resources_folderpath', expand=True) | ||
|
||
|
||
|
||
# Registrations | ||
|
||
def register(): | ||
bpy.utils.register_class(SWCL_addonPreferences) | ||
|
||
def unregister(): | ||
bpy.utils.unregister_class(SWCL_addonPreferences) | ||
|
||
if __name__ == "__main__": | ||
register() |
Oops, something went wrong.