diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-01-29 23:57:22 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-01-29 23:57:22 +0300 |
commit | 2caaf64ab10be6f03e234fa5b533e341512fbed5 (patch) | |
tree | 887f6d0d7c58939c9558c81407486d38072f9d47 /io_scene_gltf2/blender/imp/gltf2_blender_gltf.py | |
parent | e88c7ee2a7c091520efe006795817638cd4dcbb0 (diff) |
glTF importer: rewrite material import
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_gltf.py')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_gltf.py | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py index 7b259759..49cbcf64 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py @@ -87,76 +87,6 @@ class BlenderGlTF(): for material in gltf.data.materials: material.blender_material = {} - if material.pbr_metallic_roughness: - # Init - material.pbr_metallic_roughness.color_type = gltf.SIMPLE - material.pbr_metallic_roughness.vertex_color = False - material.pbr_metallic_roughness.metallic_type = gltf.SIMPLE - - if material.pbr_metallic_roughness.base_color_texture: - material.pbr_metallic_roughness.color_type = gltf.TEXTURE - - if material.pbr_metallic_roughness.metallic_roughness_texture: - material.pbr_metallic_roughness.metallic_type = gltf.TEXTURE - - if material.pbr_metallic_roughness.base_color_factor: - if material.pbr_metallic_roughness.color_type == gltf.TEXTURE and \ - material.pbr_metallic_roughness.base_color_factor != [1.0, 1.0, 1.0, 1.0]: - material.pbr_metallic_roughness.color_type = gltf.TEXTURE_FACTOR - else: - material.pbr_metallic_roughness.base_color_factor = [1.0, 1.0, 1.0, 1.0] - - if material.pbr_metallic_roughness.metallic_factor is not None: - if material.pbr_metallic_roughness.metallic_type == gltf.TEXTURE \ - and material.pbr_metallic_roughness.metallic_factor != 1.0: - material.pbr_metallic_roughness.metallic_type = gltf.TEXTURE_FACTOR - else: - material.pbr_metallic_roughness.metallic_factor = 1.0 - - if material.pbr_metallic_roughness.roughness_factor is not None: - if material.pbr_metallic_roughness.metallic_type == gltf.TEXTURE \ - and material.pbr_metallic_roughness.roughness_factor != 1.0: - material.pbr_metallic_roughness.metallic_type = gltf.TEXTURE_FACTOR - else: - material.pbr_metallic_roughness.roughness_factor = 1.0 - - # pre compute material for KHR_materials_pbrSpecularGlossiness - if material.extensions is not None \ - and 'KHR_materials_pbrSpecularGlossiness' in material.extensions.keys(): - # Init - material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuse_type'] = gltf.SIMPLE - material.extensions['KHR_materials_pbrSpecularGlossiness']['vertex_color'] = False - material.extensions['KHR_materials_pbrSpecularGlossiness']['specgloss_type'] = gltf.SIMPLE - - if 'diffuseTexture' in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys(): - material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuse_type'] = gltf.TEXTURE - - if 'diffuseFactor' in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys(): - if material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuse_type'] == gltf.TEXTURE \ - and material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuseFactor'] != \ - [1.0, 1.0, 1.0, 1.0]: - material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuse_type'] = \ - gltf.TEXTURE_FACTOR - else: - material.extensions['KHR_materials_pbrSpecularGlossiness']['diffuseFactor'] = \ - [1.0, 1.0, 1.0, 1.0] - - if 'specularGlossinessTexture' in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys(): - material.extensions['KHR_materials_pbrSpecularGlossiness']['specgloss_type'] = gltf.TEXTURE - - if 'specularFactor' in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys(): - if material.extensions['KHR_materials_pbrSpecularGlossiness']['specgloss_type'] == \ - gltf.TEXTURE \ - and material.extensions['KHR_materials_pbrSpecularGlossiness']['specularFactor'] != \ - [1.0, 1.0, 1.0]: - material.extensions['KHR_materials_pbrSpecularGlossiness']['specgloss_type'] = \ - gltf.TEXTURE_FACTOR - else: - material.extensions['KHR_materials_pbrSpecularGlossiness']['specularFactor'] = [1.0, 1.0, 1.0] - - if 'glossinessFactor' not in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys(): - material.extensions['KHR_materials_pbrSpecularGlossiness']['glossinessFactor'] = 1.0 - # images if gltf.data.images is not None: for img in gltf.data.images: |