[Bf-extensions-cvs] [11bc851e] master: glTF: Draco: Directly look at path specified by environment variable
Julien Duroure
noreply at git.blender.org
Wed Jun 29 18:02:24 CEST 2022
Commit: 11bc851e16ae792fa7738827de114f5ace628260
Author: Julien Duroure
Date: Wed Jun 29 18:02:03 2022 +0200
Branches: master
https://developer.blender.org/rBA11bc851e16ae792fa7738827de114f5ace628260
glTF: Draco: Directly look at path specified by environment variable
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 8bea4aae..7c6b128e 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (3, 3, 9),
+ "version": (3, 3, 10),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
index 28f06e51..b9f9ccec 100644
--- a/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
+++ b/io_scene_gltf2/io/com/gltf2_io_draco_compression_extension.py
@@ -27,7 +27,7 @@ def dll_path() -> Path:
'darwin': blender_root.parent / 'Resources' / python_lib / python_version / 'site-packages'
}.get(sys.platform)
else:
- path = Path(path)
+ return Path(path)
library_name = {
'win32': '{}.dll'.format(lib_name),
@@ -46,12 +46,11 @@ def dll_exists(quiet=False) -> bool:
Checks whether the DLL path exists.
:return: True if the DLL exists.
"""
- exists = dll_path().exists()
+ path = dll_path()
+ exists = path.exists() and path.is_file()
if quiet is False:
- print("'{}' ".format(dll_path().absolute()) + ("exists, draco mesh compression is available" if exists else
- "{} {} {}".format(
- "does not exist, draco mesh compression not available,",
- "please add it or create environment variable BLENDER_EXTERN_DRACO_LIBRARY_PATH",
- "pointing to the folder"
- )))
+ if exists:
+ print_console('INFO', 'Draco mesh compression is available, use library at %s' % dll_path().absolute())
+ else:
+ print_console('ERROR', 'Draco mesh compression is not available because library could not be found at %s' % dll_path().absolute())
return exists
More information about the Bf-extensions-cvs
mailing list