Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_variants.py')
-rw-r--r--io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_variants.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_variants.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_variants.py
new file mode 100644
index 00000000..4c452e6a
--- /dev/null
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials_variants.py
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: Apache-2.0
+# Copyright 2018-2022 The glTF-Blender-IO authors.
+
+import bpy
+from typing import Dict, Any
+from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached
+from io_scene_gltf2.io.com import gltf2_io_variants
+
+
+@cached
+def gather_variant(variant_idx, export_settings) -> Dict[str, Any]:
+
+ variant = gltf2_io_variants.Variant(
+ name=bpy.data.scenes[0].gltf2_KHR_materials_variants_variants[variant_idx].name,
+ extensions=None,
+ extras=None
+ )
+ return variant.to_dict()