diff --git a/CHANGELOG.md b/CHANGELOG.md index f91e1a8..db5b9fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ changed functionality, fixed bugs). - Migrated from Pipenv to Poetry for managing Python package dependencies. - Windows compatibility fix when using mapped network storage. +- Windows compatibility fix when using different assets with the same path but on different drives. ## Version 1.1.1 (2019-04-18) diff --git a/blender_asset_tracer/pack/__init__.py b/blender_asset_tracer/pack/__init__.py index c48a9ed..52561e3 100644 --- a/blender_asset_tracer/pack/__init__.py +++ b/blender_asset_tracer/pack/__init__.py @@ -329,8 +329,16 @@ class Packer: for path in self._new_location_paths: act = self._actions[path] assert isinstance(act, AssetAction) - # Like a join, but ignoring the fact that 'path' is absolute. - act.new_path = pathlib.Path(self._target_path, '_outside_project', *path.parts[1:]) + + # Remove the base of the path, effectively removing the 'absoluteness'. + # On POSIX this turns '/path/file.txt' into 'path/file.txt'. + # On Windows this turns 'X:/path/file.txt' into 'X/path/file.txt'. + if path.drive: + path_parts = (path.drive[0], *path.parts[1:]) + else: + path_parts = path.parts[1:] + + act.new_path = pathlib.Path(self._target_path, '_outside_project', *path_parts) def _group_rewrites(self) -> None: """For each blend file, collect which fields need rewriting.