blender 4.2 - fix errors detecting last commit hash

1) __file__ / bim no longer exists as 'bim' is moved to the wheel
2) there also was an issue detecting hash after it was moved from bim to blenderbim package in c0635af
This commit is contained in:
Andrej730
2024-07-22 14:06:51 +05:00
parent ffbade0f7a
commit 44fc5768af
3 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -147,8 +147,7 @@ if IN_BLENDER:
# We can't just use __file__ as blenderbim/__init__.py is typically not symlinked
# as Blender have errors symlinking main addon package file.
path = Path(__file__).parent / "bim" / "__init__.py"
path = path.resolve().parent
path = Path(__file__).resolve().parent
repo = git.Repo(str(path), search_parent_directories=True)
last_commit_hash = repo.head.object.hexsha
except:
@@ -196,7 +196,6 @@ for mod in modules.values():
addon_keymaps = []
icons = None
is_registering = False
last_commit_hash = "8888888"
original_scene_panels_polls: dict[bpy.types.Panel, Union[Callable, None]] = dict()
+2 -1
View File
@@ -920,7 +920,8 @@ class Blender(blenderbim.core.tool.Blender):
@classmethod
def get_last_commit_hash(cls) -> Union[str, None]:
"""Get 8 symbols of last commit hash if it's present or return None otherwise."""
commit_hash = blenderbim.bim.last_commit_hash
bbim = cls.get_bbim_extension_package()
commit_hash = bbim.last_commit_hash
# Commit hash is unset - user is using __init__ from repo
# without setting up git repository.