Skip to content

Commit

Permalink
fix: unexpected exception on glTF material texture export
Browse files Browse the repository at this point in the history
  • Loading branch information
saturday06 committed Aug 1, 2024
1 parent 234dcb1 commit e2ca54f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/io_scene_vrm/external/io_scene_gltf2_support.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dataclasses
import datetime
import importlib
import logging
from collections.abc import Set as AbstractSet

import bpy
Expand Down Expand Up @@ -78,7 +79,9 @@ def init_extras_export() -> None:


def create_export_settings() -> dict[str, object]:
return {
loglevel = logging.INFO
export_settings: dict[str, object] = {
"loglevel": loglevel,
# https://github.com/KhronosGroup/glTF-Blender-IO/blob/67b2ed150b0eba08129b970dbe1116c633a77d24/addons/io_scene_gltf2/__init__.py#L522
"timestamp": datetime.datetime.now(datetime.timezone.utc),
# https://github.com/KhronosGroup/glTF-Blender-IO/blob/67b2ed150b0eba08129b970dbe1116c633a77d24/addons/io_scene_gltf2/__init__.py#L258-L268
Expand Down Expand Up @@ -130,6 +133,13 @@ def create_export_settings() -> dict[str, object]:
"KHR_animation_pointer": {"materials": {}, "lights": {}, "cameras": {}},
}

if bpy.app.version < (4, 2):
return export_settings

gltf2_io_debug = importlib.import_module("io_scene_gltf2.io.com.gltf2_io_debug")
export_settings["log"] = gltf2_io_debug.Log(loglevel)
return export_settings


@dataclasses.dataclass
class ExportSceneGltfArguments:
Expand Down

0 comments on commit e2ca54f

Please sign in to comment.