Skip to content

Commit a727187

Browse files
committed
edited openvdb import
1 parent 4c0e63e commit a727187

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gridData/core.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
import pickle
3939

4040
import numpy
41-
import openvdb as vdb
41+
42+
try:
43+
import openvdb as vdb
44+
except ImportError:
45+
vdb = None
4246

4347
# For interpolated grids: need scipy.ndimage but we import it only when needed:
4448
# import scipy
@@ -639,7 +643,7 @@ def _is_native_object(self, obj):
639643
bool
640644
True if obj is a native format object
641645
"""
642-
if isinstance(obj, vdb.GridBase):
646+
if vdb is not None and isinstance(obj, vdb.GridBase):
643647
return True
644648

645649
return False

0 commit comments

Comments
 (0)