Skip to content

Closes #7765: Default IFC file path to relative and auto-convert on blend save#7795

Open
theoryshaw wants to merge 3 commits intov0.8.0from
default_relative_path
Open

Closes #7765: Default IFC file path to relative and auto-convert on blend save#7795
theoryshaw wants to merge 3 commits intov0.8.0from
default_relative_path

Conversation

@theoryshaw
Copy link
Copy Markdown
Member

Previously, saving an IFC file stored an absolute path in bim_props.ifc_file by default. Users had to manually check "Use Relative Path" each time. This made projects less portable — moving or sharing a project folder broke the stored path, requiring manual relinking.

What changed:

  • use_relative_project_path now defaults to True in BIMProjectProperties, LoadProject, ExportIFC, and SelectIfcFile. Relative paths are opt-out rather than opt-in.

  • Added a save_post handler in handler.py (registered in __init__.py) that fires whenever the user saves the .blend file. If use_relative_project_path is enabled and the stored ifc_file path is still absolute, it converts it to a path relative to the blend file's directory. IfcStore.path is kept absolute internally so file loading continues to work correctly.

Generated with the assistance of an AI coding tool.

…lend save

Previously, saving an IFC file stored an absolute path in `bim_props.ifc_file` by default. Users had to manually check "Use Relative Path" each time. This made projects less portable — moving or sharing a project folder broke the stored path, requiring manual relinking.

What changed:

-   `use_relative_project_path` now defaults to `True` in `BIMProjectProperties`, `LoadProject`, `ExportIFC`, and `SelectIfcFile`. Relative paths are opt-out rather than opt-in.

-   Added a `save_post` handler in `handler.py` (registered in `__init__.py`) that fires whenever the user saves the `.blend` file. If `use_relative_project_path` is enabled and the stored `ifc_file` path is still absolute, it converts it to a path relative to the blend file's directory. `IfcStore.path` is kept absolute internally so file loading continues to work correctly.

Generated with the assistance of an AI coding tool.
When use_relative_path is enabled, Path.relative_to() raises
ValueError if the IFC file is on a different path than the
.blend file. Fall back to the absolute path in that case.

Generated with the assistance of an AI coding tool.
@theoryshaw theoryshaw force-pushed the default_relative_path branch from bc428ab to 6c231f0 Compare March 16, 2026 14:00
  so IFC files always open in a clean session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant