From 7bdfa28a3f321ccb4223597552e5e1156503daf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 24 Jun 2016 13:03:10 +0200 Subject: [PATCH] After pushing, change the 'pull' version to the current version of Blender. Or to the latest version, if by some mistake somewhere the current push isn't available after all. --- blender_cloud/settings_sync.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/blender_cloud/settings_sync.py b/blender_cloud/settings_sync.py index 47630d7..0a77197 100644 --- a/blender_cloud/settings_sync.py +++ b/blender_cloud/settings_sync.py @@ -287,9 +287,10 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin, ], name='action') + CURRENT_BLENDER_VERSION = '%i.%i' % bpy.app.version[:2] blender_version = bpy.props.StringProperty(name='blender_version', description='Blender version to sync for', - default='%i.%i' % bpy.app.version[:2]) + default=CURRENT_BLENDER_VERSION) def bss_report(self, level, message): bss = bpy.context.window_manager.blender_sync_status @@ -415,6 +416,16 @@ class PILLAR_OT_sync(pillar.PillarOperatorMixin, future=self.signalling_future) await self.action_refresh(context) + + # After pushing, change the 'pull' version to the current version of Blender. + # Or to the latest version, if by some mistake somewhere the current push + # isn't available after all. + bss = bpy.context.window_manager.blender_sync_status + if self.CURRENT_BLENDER_VERSION in bss.available_blender_versions: + bss.version = self.CURRENT_BLENDER_VERSION + else: + bss.version = max(bss.available_blender_versions) + self.bss_report({'INFO'}, 'Settings pushed to Blender Cloud.') async def action_pull(self, context):