Skip to content

Commit 04e798c

Browse files
committed
Add update notification when trying to use node that created with newer addon version.
1 parent a9b6412 commit 04e798c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ui.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,6 +4165,22 @@ def main_draw(self, context):
41654165
col.operator("wm.y_update_yp_trees", text='Update node to version ' + get_current_version_str(), icon='ERROR')
41664166
return
41674167

4168+
# Message will appear when opening file with newer node version
4169+
if version_tuple(yp.version) > version_tuple(get_current_version_str()):
4170+
col = layout.column()
4171+
col.alert = True
4172+
col.label(text='This node uses newer version!', icon='ERROR')
4173+
if 'addon_updater_ops' not in dir():
4174+
# Extension platform releases link
4175+
col.operator('wm.url_open', text='Update '+get_addon_title(), icon='ERROR').url = 'https://extensions.blender.org/add-ons/ucupaint/'
4176+
else:
4177+
if is_online():
4178+
# Blender with online access already has the update button
4179+
col.label(text='Please update the addon!', icon='BLANK1')
4180+
else:
4181+
# Github releases link
4182+
col.operator('wm.url_open', text='Update '+get_addon_title(), icon='ERROR').url = 'https://github.com/ucupumar/ucupaint/releases'
4183+
41684184
if ypup.developer_mode:
41694185
height_root_ch = get_root_height_channel(yp)
41704186
if height_root_ch and height_root_ch.enable_smooth_bump:

0 commit comments

Comments
 (0)