Skip to content

Commit

Permalink
Repo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroGravitasIndeed authored May 27, 2023
0 parents commit cff3b12
Show file tree
Hide file tree
Showing 7 changed files with 1,750 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

Binary file added SWTOR Character Locator.zip
Binary file not shown.
Empty file added readme.md
Empty file.
674 changes: 674 additions & 0 deletions swtor-character-locator/LICENSE

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions swtor-character-locator/__init__.py
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()#
44 changes: 44 additions & 0 deletions swtor-character-locator/preferences.py
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()
Loading

0 comments on commit cff3b12

Please sign in to comment.