Skip to content

Commit

Permalink
Prepare for beta 1 release, for issue #206
Browse files Browse the repository at this point in the history
  • Loading branch information
joepal1976 committed Jul 23, 2024
1 parent da56948 commit 7b8291e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
17 changes: 10 additions & 7 deletions src/mpfb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""This is the MakeHuman Plugin For Blender (MPFB). For more information, see
the README.md file in the zip."""

bl_info = { # pylint: disable=C0103
bl_info = { # pylint: disable=C0103
"name": "mpfb",
"author": "Joel Palmius",
"version": (2, 0, 4),
"version": (2, 0, 5),
"blender": (4, 1, 0),
"warning": "Plugin is in Alpha stage",
"location": "View3D > Properties > MPFB",
"description": "MakeHuman Plugin For Blender",
"doc_url": "http://static.makehumancommunity.org/mpfb.html",
Expand Down Expand Up @@ -37,6 +36,7 @@

_OLD_EXCEPTHOOK = None


def log_crash(type, value, tb):
global _OLD_EXCEPTHOOK
stacktrace = "\n"
Expand All @@ -46,6 +46,7 @@ def log_crash(type, value, tb):
if _OLD_EXCEPTHOOK:
_OLD_EXCEPTHOOK(type, value, tb)


def get_preference(name):
_LOG.enter()
if "mpfb" in bpy.context.preferences.addons:
Expand All @@ -66,8 +67,10 @@ def get_preference(name):
_LOG.crash("The 'mpfb' addon does not exist!?")
raise ValueError("I don't seem to exist")


ClassManager = None


def register():
"""At this point blender is ready enough for it to make sense to
start initializing python singletons"""
Expand All @@ -79,8 +82,8 @@ def register():
except:
print("WARNING: Could not register preferences class. Maybe it was registered by an earlier version of MPFB?")

global _LOG # pylint: disable=W0603
global _OLD_EXCEPTHOOK # pylint: disable=W0603
global _LOG # pylint: disable=W0603
global _OLD_EXCEPTHOOK # pylint: disable=W0603

from mpfb.services.logservice import LogService
_LOG = LogService.get_logger("mpfb.init")
Expand All @@ -103,7 +106,7 @@ def register():
ClassManager = _ClassManager

if not ClassManager.isinitialized():
classmanager = ClassManager() # pylint: disable=W0612
classmanager = ClassManager() # pylint: disable=W0612

_LOG.debug("About to import mpfb.services")
import mpfb.services.locationservice
Expand Down Expand Up @@ -147,7 +150,7 @@ def register():
def unregister():
"""Deconstruct all loaded blenderish classes"""

global _LOG # pylint: disable=W0603
global _LOG # pylint: disable=W0603

_LOG.debug("About to unregister classes")
global ClassManager
Expand Down
10 changes: 7 additions & 3 deletions src/mpfb/services/uiservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ def __init__(self):
_LOG.debug("Constructing ui service")
self._state = dict()
self.set_value("PROPERTYPREFIX", "MPFB_")
ui_prefix = "MPFB v%d.%d-a%d" % (VERSION[0], VERSION[1], VERSION[2])

# For beta version. Will change back for the next nightly build
ui_prefix = "MPFB v%d.%d-b1" % (VERSION[0], VERSION[1])

# ui_prefix = "MPFB v%d.%d-a%d" % (VERSION[0], VERSION[1], VERSION[2])

label = get_preference("mpfb_shelf_label")
_LOG.debug("Shelf label", label)
if label and not str(label).strip() == "":
ui_prefix = label

multi = False #get_preference("multi_panel")
multi = False # get_preference("multi_panel")
_LOG.debug("multi_panel", multi)

self.set_value("UIPREFIX", ui_prefix)
Expand Down Expand Up @@ -169,6 +173,6 @@ def as_valid_identifier(self, raw_string):
return re.sub(r'[^a-zA-Z0-9_]', "_", raw_string)


UiService = _UiService() # pylint: disable=C0103
UiService = _UiService() # pylint: disable=C0103
UiService.rebuild_importer_presets_panel_list()
UiService.rebuild_importer_panel_list()

0 comments on commit 7b8291e

Please sign in to comment.