Added --relative-only option to bat pack command
This makes BAT skip assets that are referred to with an absolute path. It is assumed that the receiver of the BAT pack can access those assets at the same path.
This commit is contained in:
@@ -99,12 +99,14 @@ class Packer:
|
||||
target: pathlib.Path,
|
||||
*,
|
||||
noop=False,
|
||||
compress=False) -> None:
|
||||
compress=False,
|
||||
relative_only=False) -> None:
|
||||
self.blendfile = bfile
|
||||
self.project = project
|
||||
self.target = target
|
||||
self.noop = noop
|
||||
self.compress = compress
|
||||
self.relative_only = relative_only
|
||||
self._aborted = threading.Event()
|
||||
self._abort_lock = threading.RLock()
|
||||
|
||||
@@ -233,6 +235,10 @@ class Packer:
|
||||
log.info('Excluding file: %s', asset_path)
|
||||
continue
|
||||
|
||||
if self.relative_only and not usage.asset_path.startswith(b'//'):
|
||||
log.info('Skipping absolute path: %s', usage.asset_path)
|
||||
continue
|
||||
|
||||
if usage.is_sequence:
|
||||
self._visit_sequence(asset_path, usage)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user