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:
authorJulien Duroure <julien.duroure@gmail.com>2019-01-09 21:46:45 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-01-09 21:46:45 +0300
commitb410a70fa9ba09bf9c1091d87f38f0ed8dae4895 (patch)
tree1d29e31952f861dbf02f8433f6e6861f5607f587 /io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
parent52111c31d7d0d39893b11a5242cbfe2bfbda0d12 (diff)
glTF export: enhancement & fixes:
* implement KHR_materials_unlit export * Fix primitive restart values * Fix jpg uri/mime type * Fix bug when image has no color channels * Check animation has actions * Ignore meshes without primitives * Fix materials when not selected in export settings * Improve error message for invalid animation target type * Animation with errors are ignored, but export continues * Export of BaseColorFactor
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
index 427f07ce..e1c17480 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
@@ -16,7 +16,8 @@ import bpy
from io_scene_gltf2.blender.exp.gltf2_blender_gather_cache import cached
from io_scene_gltf2.io.com import gltf2_io
-from io_scene_gltf2.blender.exp import gltf2_blender_gather_texture_info
+from io_scene_gltf2.io.com.gltf2_io_extensions import Extension
+from io_scene_gltf2.blender.exp import gltf2_blender_gather_texture_info, gltf2_blender_export_keys
from io_scene_gltf2.blender.exp import gltf2_blender_gather_material_normal_texture_info_class
from io_scene_gltf2.blender.exp import gltf2_blender_gather_material_occlusion_texture_info_class
@@ -69,11 +70,7 @@ def gather_material(blender_material, export_settings):
def __filter_material(blender_material, export_settings):
- # if not blender_material.use_nodes:
- # return False
- # if not blender_material.node_tree:
- # return False
- return True
+ return export_settings[gltf2_blender_export_keys.MATERIALS]
def __gather_alpha_cutoff(blender_material, export_settings):
@@ -113,6 +110,8 @@ def __gather_emissive_texture(blender_material, export_settings):
def __gather_extensions(blender_material, export_settings):
extensions = {}
+ if gltf2_blender_get.get_socket_or_texture_slot(blender_material, "Background") is not None:
+ extensions["KHR_materials_unlit"] = Extension("KHR_materials_unlit", {}, False)
# TODO specular glossiness extension