Remove code to support Blender 2.79 and older

This commit is contained in:
2021-02-16 11:33:48 +01:00
parent 8b49c5505e
commit 14778e5c08
9 changed files with 65 additions and 459 deletions

View File

@@ -36,7 +36,7 @@ from bpy.props import (
)
import rna_prop_ui
from . import compatibility, pillar, async_loop, flamenco, project_specific
from . import pillar, async_loop, flamenco, project_specific
from .utils import pyside_cache, redraw
PILLAR_WEB_SERVER_URL = os.environ.get("BCLOUD_SERVER", "https://cloud.blender.org/")
@@ -58,9 +58,8 @@ def blender_syncable_versions(self, context):
return [(v, v, "") for v in versions]
@compatibility.convert_properties
class SyncStatusProperties(PropertyGroup):
status = EnumProperty(
status: EnumProperty(
items=[
("NONE", "NONE", "We have done nothing at all yet."),
(
@@ -75,14 +74,14 @@ class SyncStatusProperties(PropertyGroup):
update=redraw,
)
version = EnumProperty(
version: EnumProperty(
items=blender_syncable_versions,
name="Version of Blender from which to pull",
description="Version of Blender from which to pull",
)
message = StringProperty(name="message", update=redraw)
level = EnumProperty(
message: StringProperty(name="message", update=redraw)
level: EnumProperty(
items=[
("INFO", "INFO", ""),
("WARNING", "WARNING", ""),
@@ -152,9 +151,8 @@ def project_extensions(project_id) -> set:
return set(proj.get("enabled_for", ()))
@compatibility.convert_properties
class BlenderCloudProjectGroup(PropertyGroup):
status = EnumProperty(
status: EnumProperty(
items=[
("NONE", "NONE", "We have done nothing at all yet"),
(
@@ -168,7 +166,7 @@ class BlenderCloudProjectGroup(PropertyGroup):
update=redraw,
)
project = EnumProperty(
project: EnumProperty(
items=bcloud_available_projects,
name="Cloud project",
description="Which Blender Cloud project to work with",
@@ -187,26 +185,25 @@ class BlenderCloudProjectGroup(PropertyGroup):
project_specific.handle_project_update()
@compatibility.convert_properties
class BlenderCloudPreferences(AddonPreferences):
bl_idname = ADDON_NAME
# The following property is read-only to limit the scope of the
# addon and allow for proper testing within this scope.
pillar_server = StringProperty(
pillar_server: StringProperty(
name="Blender Cloud Server",
description="URL of the Blender Cloud backend server",
default=PILLAR_SERVER_URL,
get=lambda self: PILLAR_SERVER_URL,
)
local_texture_dir = StringProperty(
local_texture_dir: StringProperty(
name="Default Blender Cloud Texture Storage Directory",
subtype="DIR_PATH",
default="//textures",
)
open_browser_after_share = BoolProperty(
open_browser_after_share: BoolProperty(
name="Open Browser after Sharing File",
description="When enabled, Blender will open a webbrowser",
default=True,
@@ -214,9 +211,9 @@ class BlenderCloudPreferences(AddonPreferences):
# TODO: store project-dependent properties with the project, so that people
# can switch projects and the Attract and Flamenco properties switch with it.
project = PointerProperty(type=BlenderCloudProjectGroup)
project: PointerProperty(type=BlenderCloudProjectGroup)
cloud_project_local_path = StringProperty(
cloud_project_local_path: StringProperty(
name="Local Project Path",
description="Local path of your Attract project, used to search for blend files; "
"usually best to set to an absolute path",
@@ -225,29 +222,29 @@ class BlenderCloudPreferences(AddonPreferences):
update=project_specific.store,
)
flamenco_manager = PointerProperty(type=flamenco.FlamencoManagerGroup)
flamenco_exclude_filter = StringProperty(
flamenco_manager: PointerProperty(type=flamenco.FlamencoManagerGroup)
flamenco_exclude_filter: StringProperty(
name="File Exclude Filter",
description='Space-separated list of filename filters, like "*.abc *.mkv", to prevent '
"matching files from being packed into the output directory",
default="",
update=project_specific.store,
)
flamenco_job_file_path = StringProperty(
flamenco_job_file_path: StringProperty(
name="Job Storage Path",
description="Path where to store job files, should be accesible for Workers too",
subtype="DIR_PATH",
default=tempfile.gettempdir(),
update=project_specific.store,
)
flamenco_job_output_path = StringProperty(
flamenco_job_output_path: StringProperty(
name="Job Output Path",
description="Path where to store output files, should be accessible for Workers",
subtype="DIR_PATH",
default=tempfile.gettempdir(),
update=project_specific.store,
)
flamenco_job_output_strip_components = IntProperty(
flamenco_job_output_strip_components: IntProperty(
name="Job Output Path Strip Components",
description="The final output path comprises of the job output path, and the blend file "
"path relative to the project with this many path components stripped off "
@@ -257,7 +254,7 @@ class BlenderCloudPreferences(AddonPreferences):
soft_max=4,
update=project_specific.store,
)
flamenco_relative_only = BoolProperty(
flamenco_relative_only: BoolProperty(
name="Relative Paths Only",
description="When enabled, only assets that are referred to with a relative path are "
"packed, and assets referred to by an absolute path are excluded from the "
@@ -266,12 +263,12 @@ class BlenderCloudPreferences(AddonPreferences):
update=project_specific.store,
)
flamenco_open_browser_after_submit = BoolProperty(
flamenco_open_browser_after_submit: BoolProperty(
name="Open Browser after Submitting Job",
description="When enabled, Blender will open a webbrowser",
default=True,
)
flamenco_show_quit_after_submit_button = BoolProperty(
flamenco_show_quit_after_submit_button: BoolProperty(
name='Show "Submit & Quit" button',
description='When enabled, next to the "Render on Flamenco" button there will be a button '
'"Submit & Quit" that silently quits Blender after submitting the render job '
@@ -343,7 +340,7 @@ class BlenderCloudPreferences(AddonPreferences):
bss = context.window_manager.blender_sync_status
bsync_box = layout.box()
bsync_box.enabled = msg_icon != "ERROR"
row = bsync_box.row().split(**compatibility.factor(0.33))
row = bsync_box.row().split(factor=0.33)
row.label(text="Blender Sync with Blender Cloud", icon_value=icon("CLOUD"))
icon_for_level = {
@@ -386,7 +383,7 @@ class BlenderCloudPreferences(AddonPreferences):
layout.enabled = bss.status in {"NONE", "IDLE"}
buttons = layout.column()
row_buttons = buttons.row().split(**compatibility.factor(0.5))
row_buttons = buttons.row().split(factor=0.5)
row_push = row_buttons.row()
row_pull = row_buttons.row(align=True)
@@ -411,7 +408,7 @@ class BlenderCloudPreferences(AddonPreferences):
props.action = "PULL"
props.blender_version = bss.version
row_pull.operator(
"pillar.sync", text="", icon=compatibility.SYNC_SELECT_VERSION_ICON
"pillar.sync", text="", icon="DOWNARROW_HLT"
).action = "SELECT"
else:
row_pull.label(text="Cloud Sync is running.")
@@ -460,7 +457,7 @@ class BlenderCloudPreferences(AddonPreferences):
header_row = flamenco_box.row(align=True)
header_row.label(text="Flamenco:", icon_value=icon("CLOUD"))
manager_split = flamenco_box.split(**compatibility.factor(0.32), align=True)
manager_split = flamenco_box.split(factor=0.32, align=True)
manager_split.label(text="Manager:")
manager_box = manager_split.row(align=True)
@@ -477,7 +474,7 @@ class BlenderCloudPreferences(AddonPreferences):
else:
manager_box.label(text="Fetching available managers.")
path_split = flamenco_box.split(**compatibility.factor(0.32), align=True)
path_split = flamenco_box.split(factor=0.32, align=True)
path_split.label(text="Job File Path:")
path_box = path_split.row(align=True)
path_box.prop(self, "flamenco_job_file_path", text="")
@@ -487,7 +484,7 @@ class BlenderCloudPreferences(AddonPreferences):
props.path = self.flamenco_job_file_path
job_output_box = flamenco_box.column(align=True)
path_split = job_output_box.split(**compatibility.factor(0.32), align=True)
path_split = job_output_box.split(factor=0.32, align=True)
path_split.label(text="Job Output Path:")
path_box = path_split.row(align=True)
path_box.prop(self, "flamenco_job_output_path", text="")
@@ -497,7 +494,7 @@ class BlenderCloudPreferences(AddonPreferences):
props.path = self.flamenco_job_output_path
job_output_box.prop(self, "flamenco_exclude_filter")
prop_split = job_output_box.split(**compatibility.factor(0.32), align=True)
prop_split = job_output_box.split(factor=0.32, align=True)
prop_split.label(text="Strip Components:")
prop_split.prop(self, "flamenco_job_output_strip_components", text="")
@@ -586,13 +583,12 @@ class PILLAR_OT_subscribe(Operator):
return {"FINISHED"}
@compatibility.convert_properties
class PILLAR_OT_project_open_in_browser(Operator):
bl_idname = "pillar.project_open_in_browser"
bl_label = "Open in Browser"
bl_description = "Opens a webbrowser to show the project"
project_id = StringProperty(name="Project ID")
project_id: StringProperty(name="Project ID")
def execute(self, context):
if not self.project_id: