Skip to content

Commit 5717542

Browse files
committed
Include Addon updater, now this addon can check if a new update are avaible.
1 parent 634d395 commit 5717542

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import sys
1111
import importlib
1212

13+
from . import addon_updater_ops
14+
1315
modulesNames = [
1416
'config.settings',
1517
# Models
@@ -61,6 +63,7 @@ def register():
6163
if currentModule in sys.modules:
6264
if hasattr(sys.modules[currentModule], 'register'):
6365
sys.modules[currentModule].register()
66+
addon_updater_ops.register(bl_info)
6467

6568

6669
# -----------------------------------------------------------------------------

addon_updater_ops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Must declare this before classes are loaded
2525
# otherwise the bl_idnames will not match and have errors.
2626
# Must be all lowercase and no spaces
27-
updater.addon = "addon_updater_demo"
27+
updater.addon = "painter_addon_updater"
2828

2929

3030
# -----------------------------------------------------------------------------
@@ -718,10 +718,10 @@ def register(bl_info):
718718
# print("Running updater reg")
719719

720720
# choose your own username
721-
updater.user = "cgcookie"
721+
updater.user = "stilobique"
722722

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

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

config/settings.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
from bpy.props import StringProperty
5+
from .. import addon_updater_ops
56

67
# -----------------------------------------------------------------------------
78
# Settings for this addons
@@ -11,6 +12,40 @@
1112
class SubstanceSettings(bpy.types.AddonPreferences):
1213
bl_idname = "SubstanceBridge"
1314

15+
# addon updater preferences from `__init__`, be sure to copy all of them
16+
auto_check_update = bpy.props.BoolProperty(
17+
name="Auto-check for Update",
18+
description="If enabled, auto-check for updates using an interval",
19+
default=False,
20+
)
21+
22+
updater_intrval_months = bpy.props.IntProperty(
23+
name='Months',
24+
description="Number of months between checking for updates",
25+
default=0,
26+
min=0
27+
)
28+
updater_intrval_days = bpy.props.IntProperty(
29+
name='Days',
30+
description="Number of days between checking for updates",
31+
default=7,
32+
min=0,
33+
)
34+
updater_intrval_hours = bpy.props.IntProperty(
35+
name='Hours',
36+
description="Number of hours between checking for updates",
37+
default=0,
38+
min=0,
39+
max=23
40+
)
41+
updater_intrval_minutes = bpy.props.IntProperty(
42+
name='Minutes',
43+
description="Number of minutes between checking for updates",
44+
default=0,
45+
min=0,
46+
max=59
47+
)
48+
1449
# All software path.
1550
painterpath = StringProperty(
1651
name="Substance Painter",
@@ -38,6 +73,9 @@ def draw(self, context):
3873
# layout.prop(self, "path_batchtools")
3974
# layout.prop(self, "path_designer")
4075

76+
# Show UI updater Addon
77+
addon_updater_ops.update_settings_ui(self, context)
78+
4179

4280
def register():
4381
bpy.utils.register_class(SubstanceSettings)

0 commit comments

Comments
 (0)