Skip to content

Commit ae236d7

Browse files
committed
fix: fix
1 parent d79498f commit ae236d7

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ trimesh = [
6767

6868
# this is the base extra most users will want
6969
easy = [
70+
"DracoPy",
7071
"colorlog",
7172
"manifold3d>=2.3.0",
7273
"charset-normalizer",

trimesh/exchange/gltf/extensions.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515
from ...caching import hash_fast
1616
from ...constants import log
17+
from ...exceptions import ExceptionWrapper
18+
19+
try:
20+
import DracoPy as dpy
21+
except BaseException as E:
22+
dpy = exceptions.ExceptionWrapper(E)
1723

1824
# GL geometry modes
1925
_GL_TRIANGLES = 4
@@ -299,7 +305,6 @@ def _draco_mesh_compression(context: PrimitivePreprocessContext) -> None:
299305
context
300306
PrimitivePreprocessContext with extension data.
301307
"""
302-
import DracoPy as dpy
303308
primitive = context["primitive"]
304309

305310
if primitive.get("mode") not in [_GL_STRIP, _GL_TRIANGLES]:
@@ -344,12 +349,6 @@ def _draco_mesh_compression(context: PrimitiveExportContext) -> None:
344349
context
345350
PrimitiveExportContext with extension data.
346351
"""
347-
import DracoPy as dpy
348-
349-
# For index accessor + attribute accessors:
350-
# - Replace the accessor information
351-
# - Extract data from buffers
352-
353352
primitive = context.get("primitive")
354353
if not primitive:
355354
return
@@ -418,8 +417,8 @@ def _draco_mesh_compression(context: PrimitiveExportContext) -> None:
418417
tex_coord=tex_coord,
419418
normals=normals,
420419
generic_attributes=generic_attributes or None,
421-
quantization_bits=14,
422-
compression_level=2,
420+
quantization_bits=14, # blender defaults
421+
compression_level=6, # blender defaults
423422
)
424423
dpy_mesh = dpy.decode_buffer_to_mesh(buf)
425424

0 commit comments

Comments
 (0)