diff --git a/addon/flamenco/preferences.py b/addon/flamenco/preferences.py index 9a05923c..31bc231c 100644 --- a/addon/flamenco/preferences.py +++ b/addon/flamenco/preferences.py @@ -143,6 +143,11 @@ class FlamencoPreferences(bpy.types.AddonPreferences): def project_root(self) -> Path: """Use the configured project finder to find the project root directory.""" + if not self.project_finder: + # Just a sanity fallback for missing preferences. It should be + # covered by the 'default=...' of the property, but just to be sure. + self.project_finder = "BLENDER_PROJECT" + # It is assumed that the blendfile is saved. blendfile = Path(bpy.data.filepath) return projects.for_blendfile(blendfile, self.project_finder) diff --git a/addon/flamenco/projects.py b/addon/flamenco/projects.py index cb0eece6..1a090c39 100644 --- a/addon/flamenco/projects.py +++ b/addon/flamenco/projects.py @@ -28,10 +28,6 @@ def for_blendfile(blendfile: Path, strategy: str) -> Path: return finder_info.finder(blendfile) -def _finder_none(blendfile: Path) -> Path: - return blendfile.absolute().parent - - def _finder_blender_project(blendfile: Path) -> Path: return _search_path_marker(blendfile, ".blender_project") @@ -77,11 +73,6 @@ class FinderInfo: finders: dict[str, FinderInfo] = { - "NONE": FinderInfo( - "None", - "Just use the directory containing the current blend file as the project directory.", - _finder_none, - ), "BLENDER_PROJECT": FinderInfo( "Blender Project", "Find a .blend_project directory and use that as indicator for the top level project directory.",