1 # SPDX-License-Identifier: Apache-2.0
2 # Copyright 2018-2021 The glTF-Blender-IO authors.
8 class BlenderJSONEncoder(json
.JSONEncoder
):
9 """Blender JSON Encoder."""
11 def default(self
, obj
):
12 if isinstance(obj
, bpy
.types
.ID
):
15 type=obj
.__class
__.__name
__
17 return super(BlenderJSONEncoder
, self
).default(obj
)
20 def is_json_convertible(data
):
21 """Test, if a data set can be expressed as JSON."""
23 json
.dumps(data
, cls
=BlenderJSONEncoder
)