Flamenco: Allow BAT-packing of only relative-path assets

This commit is contained in:
2018-12-06 15:46:54 +01:00
parent 1f13b4d249
commit 4f32b49ad3
6 changed files with 50 additions and 13 deletions

View File

@@ -87,10 +87,9 @@ def manager_updated(self: 'FlamencoManagerGroup', context):
return
with project_specific.mark_as_loading():
for name in project_specific.FLAMENCO_PER_PROJECT_PER_MANAGER:
if name not in pppm:
continue
setattr(prefs, name, pppm[name])
project_specific.update_preferences(prefs,
project_specific.FLAMENCO_PER_PROJECT_PER_MANAGER,
pppm)
class FlamencoManagerGroup(PropertyGroup):
@@ -422,6 +421,7 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
proj_abspath = bpy.path.abspath(prefs.cloud_project_local_path)
projdir = Path(proj_abspath).resolve()
exclusion_filter = (prefs.flamenco_exclude_filter or '').strip()
relative_only = prefs.flamenco_relative_only
self.log.debug('outdir : %s', outdir)
self.log.debug('projdir: %s', projdir)
@@ -436,7 +436,8 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
try:
outfile, missing_sources = await bat_interface.copy(
bpy.context, filepath, projdir, outdir, exclusion_filter)
bpy.context, filepath, projdir, outdir, exclusion_filter,
relative_only=relative_only)
except bat_interface.FileTransferError as ex:
self.log.error('Could not transfer %d files, starting with %s',
len(ex.files_remaining), ex.files_remaining[0])

View File

@@ -10,7 +10,6 @@ import bpy
from blender_asset_tracer import pack
from blender_asset_tracer.pack import progress, transfer
log = logging.getLogger(__name__)
_running_packer = None # type: pack.Packer
@@ -97,7 +96,9 @@ async def copy(context,
base_blendfile: pathlib.Path,
project: pathlib.Path,
target: pathlib.Path,
exclusion_filter: str) -> typing.Tuple[pathlib.Path, typing.Set[pathlib.Path]]:
exclusion_filter: str,
*,
relative_only: bool) -> typing.Tuple[pathlib.Path, typing.Set[pathlib.Path]]:
"""Use BAT🦇 to copy the given file and dependencies to the target location.
:raises: FileTransferError if a file couldn't be transferred.
@@ -109,7 +110,8 @@ async def copy(context,
wm = bpy.context.window_manager
with pack.Packer(base_blendfile, project, target, compress=True) as packer:
with pack.Packer(base_blendfile, project, target, compress=True, relative_only=relative_only) \
as packer:
with _packer_lock:
if exclusion_filter:
packer.exclude(*exclusion_filter.split())