Skip to content

Commit 25826da

Browse files
committed
make test work for ipy
1 parent 441d38e commit 25826da

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/compas/files/gltf/data_classes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class MineType(object):
1616

1717
# I changed the name of this so as not to collide with compas.Base
1818
class BaseGLTFDataClass(object):
19+
20+
IS_BASE_GLTF_DATA = True # only needed for ipy in `GLTFContent.check_extensions_texture_recursively`
21+
1922
def __init__(self, extras=None, extensions=None):
2023
self.extras = extras
2124
self.extensions = extensions
@@ -140,6 +143,9 @@ def from_data(cls, texture):
140143

141144

142145
class TextureInfoData(BaseGLTFDataClass):
146+
147+
IS_TEXTURE_INFO_DATA = True # only needed for ipy in `GLTFContent.check_extensions_texture_recursively`
148+
143149
def __init__(self, index, tex_coord=None, extras=None, extensions=None):
144150
super(TextureInfoData, self).__init__(extras, extensions)
145151
self.index = index

src/compas/files/gltf/gltf_content.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ def check_extensions_texture_recursively(item):
161161
# get the extensions that are in the attributes
162162
for a in dir(item):
163163
if not a.startswith("__") and not callable(getattr(item, a)):
164-
if isinstance(getattr(item, a), TextureInfoData):
164+
# ipy does not like this one: if isinstance(getattr(item, a), TextureInfoData):
165+
if getattr(getattr(item, a), "IS_TEXTURE_INFO_DATA", False):
165166
texture_visit_log[getattr(item, a).index] = True
166-
elif isinstance(getattr(item, a), BaseGLTFDataClass):
167+
# ipy does not like this one: elif isinstance(getattr(item, a), BaseGLTFDataClass):
168+
elif getattr(getattr(item, a), "IS_BASE_GLTF_DATA", False):
167169
check_extensions_texture_recursively(getattr(item, a))
168170
if item.extensions is not None:
169171
for _, e in item.extensions.items():

0 commit comments

Comments
 (0)