Local project path is used by both Attract and Flamenco

It's now shown whenever the project is set up for either one.
This commit is contained in:
Sybren A. Stüvel 2017-03-21 14:06:45 +01:00
parent 74220e4fc4
commit cf7adb065f
2 changed files with 14 additions and 18 deletions

View File

@ -220,7 +220,7 @@ class BlenderCloudPreferences(AddonPreferences):
# can switch projects and the Attract and Flamenco properties switch with it.
project = PointerProperty(type=BlenderCloudProjectGroup)
attract_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',
@ -345,11 +345,6 @@ class BlenderCloudPreferences(AddonPreferences):
self.draw_project_selector(project_box, self.project)
extensions = project_extensions(self.project.project)
# Attract stuff
if 'attract' in extensions:
attract_box = project_box.column()
self.draw_attract_buttons(attract_box, self.project)
# Flamenco stuff
if 'flamenco' in extensions:
flamenco_box = project_box.column()
@ -411,18 +406,19 @@ class BlenderCloudPreferences(AddonPreferences):
row_buttons.label('Fetching available projects.')
enabled_for = project_extensions(project)
if project:
if enabled_for:
if not project:
return
if not enabled_for:
project_box.label('This project is not set up for Attract or Flamenco')
return
project_box.label('This project is set up for: %s' %
', '.join(sorted(enabled_for)))
else:
project_box.label('This project is not set up for Attract or Flamenco')
def draw_attract_buttons(self, attract_box, bcp: BlenderCloudProjectGroup):
header_row = attract_box.row(align=True)
header_row.label('Attract:', icon_value=icon('CLOUD'))
attract_box.prop(self, 'attract_project_local_path',
text='Local Attract project path')
# This is only needed when the project is set up for either Attract or Flamenco.
project_box.prop(self, 'cloud_project_local_path',
text='Local Cloud project path')
def draw_flamenco_buttons(self, flamenco_box, bcp: flamenco.FlamencoManagerGroup, context):
header_row = flamenco_box.row(align=True)

View File

@ -514,7 +514,7 @@ def render_output_path(context, filepath: Path = None) -> typing.Optional[PurePa
filepath = Path(context.blend_data.filepath)
return _render_output_path(
prefs.attract_project_local_path,
prefs.cloud_project_local_path,
filepath,
prefs.flamenco_job_output_strip_components,
prefs.flamenco_job_output_path,