Skip to content

Commit

Permalink
Include Addon updater, now this addon can check if a new update are a…
Browse files Browse the repository at this point in the history
…vaible.
  • Loading branch information
stilobique committed Jan 25, 2017
1 parent 634d395 commit 5717542
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
3 changes: 3 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import sys
import importlib

from . import addon_updater_ops

modulesNames = [
'config.settings',
# Models
Expand Down Expand Up @@ -61,6 +63,7 @@ def register():
if currentModule in sys.modules:
if hasattr(sys.modules[currentModule], 'register'):
sys.modules[currentModule].register()
addon_updater_ops.register(bl_info)


# -----------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions addon_updater_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Must declare this before classes are loaded
# otherwise the bl_idnames will not match and have errors.
# Must be all lowercase and no spaces
updater.addon = "addon_updater_demo"
updater.addon = "painter_addon_updater"


# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -718,10 +718,10 @@ def register(bl_info):
# print("Running updater reg")

# choose your own username
updater.user = "cgcookie"
updater.user = "stilobique"

# choose your own repository, must match github name
updater.repo = "blender-addon-updater"
updater.repo = "SubstanceBridge"

#updater.addon = # define at top of module, must be done first

Expand Down
38 changes: 38 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


from bpy.props import StringProperty
from .. import addon_updater_ops

# -----------------------------------------------------------------------------
# Settings for this addons
Expand All @@ -11,6 +12,40 @@
class SubstanceSettings(bpy.types.AddonPreferences):
bl_idname = "SubstanceBridge"

# addon updater preferences from `__init__`, be sure to copy all of them
auto_check_update = bpy.props.BoolProperty(
name="Auto-check for Update",
description="If enabled, auto-check for updates using an interval",
default=False,
)

updater_intrval_months = bpy.props.IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days = bpy.props.IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
)
updater_intrval_hours = bpy.props.IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes = bpy.props.IntProperty(
name='Minutes',
description="Number of minutes between checking for updates",
default=0,
min=0,
max=59
)

# All software path.
painterpath = StringProperty(
name="Substance Painter",
Expand Down Expand Up @@ -38,6 +73,9 @@ def draw(self, context):
# layout.prop(self, "path_batchtools")
# layout.prop(self, "path_designer")

# Show UI updater Addon
addon_updater_ops.update_settings_ui(self, context)


def register():
bpy.utils.register_class(SubstanceSettings)
Expand Down

0 comments on commit 5717542

Please sign in to comment.