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>2020-09-17 20:00:16 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-09-17 20:00:24 +0300
commit9db2451888a5f5a67d3d3d0fc2a967c208a3a801 (patch)
tree238533f0cdd2b4b287b96f54ed6c43a7dc0a1e8e /io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
parentec4ad081e564781230e3a9b31ef48f1f8fb71899 (diff)
glTF exporter: fix UVMap export when ORM are using different maps
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py')
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py32
1 files changed, 21 insertions, 11 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 8dc5896f..c346a831 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_materials.py
@@ -146,7 +146,7 @@ def __gather_emissive_texture(blender_material, export_settings):
emissive = gltf2_blender_get.get_socket(blender_material, "Emissive")
if emissive is None:
emissive = gltf2_blender_get.get_socket_old(blender_material, "Emissive")
- return gltf2_blender_gather_texture_info.gather_texture_info((emissive,), export_settings)
+ return gltf2_blender_gather_texture_info.gather_texture_info(emissive, (emissive,), export_settings)
def __gather_extensions(blender_material, export_settings):
@@ -187,6 +187,7 @@ def __gather_normal_texture(blender_material, export_settings):
if normal is None:
normal = gltf2_blender_get.get_socket_old(blender_material, "Normal")
return gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class(
+ normal,
(normal,),
export_settings)
@@ -226,22 +227,19 @@ def __gather_orm_texture(blender_material, export_settings):
return None
# Double-check this will past the filter in texture_info
- info = gltf2_blender_gather_texture_info.gather_texture_info(result, export_settings)
+ info = gltf2_blender_gather_texture_info.gather_texture_info(result[0], result, export_settings)
if info is None:
return None
return result
def __gather_occlusion_texture(blender_material, orm_texture, export_settings):
- if orm_texture is not None:
- return gltf2_blender_gather_texture_info.gather_material_occlusion_texture_info_class(
- orm_texture,
- export_settings)
occlusion = gltf2_blender_get.get_socket(blender_material, "Occlusion")
if occlusion is None:
occlusion = gltf2_blender_get.get_socket_old(blender_material, "Occlusion")
return gltf2_blender_gather_texture_info.gather_material_occlusion_texture_info_class(
- (occlusion,),
+ occlusion,
+ orm_texture or (occlusion,),
export_settings)
@@ -297,14 +295,22 @@ def __gather_clearcoat_extension(blender_material, export_settings):
clearcoat_roughness_slots = (clearcoat_roughness_socket,)
if len(clearcoat_roughness_slots) > 0:
- combined_texture = gltf2_blender_gather_texture_info.gather_texture_info(clearcoat_roughness_slots, export_settings)
if has_clearcoat_texture:
- clearcoat_extension['clearcoatTexture'] = combined_texture
+ clearcoat_extension['clearcoatTexture'] = gltf2_blender_gather_texture_info.gather_texture_info(
+ clearcoat_socket,
+ clearcoat_roughness_slots,
+ export_settings,
+ )
if has_clearcoat_roughness_texture:
- clearcoat_extension['clearcoatRoughnessTexture'] = combined_texture
+ clearcoat_extension['clearcoatRoughnessTexture'] = gltf2_blender_gather_texture_info.gather_texture_info(
+ clearcoat_roughness_socket,
+ clearcoat_roughness_slots,
+ export_settings,
+ )
if __has_image_node_from_socket(clearcoat_normal_socket):
clearcoat_extension['clearcoatNormalTexture'] = gltf2_blender_gather_texture_info.gather_material_normal_texture_info_class(
+ clearcoat_normal_socket,
(clearcoat_normal_socket,),
export_settings
)
@@ -336,7 +342,11 @@ def __gather_transmission_extension(blender_material, export_settings):
transmission_slots = (transmission_socket,)
if len(transmission_slots) > 0:
- combined_texture = gltf2_blender_gather_texture_info.gather_texture_info(transmission_slots, export_settings)
+ combined_texture = gltf2_blender_gather_texture_info.gather_texture_info(
+ transmission_socket,
+ transmission_slots,
+ export_settings,
+ )
if has_transmission_texture:
transmission_extension['transmissionTexture'] = combined_texture