diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-18 12:40:23 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-18 12:46:26 +0300 |
commit | 8d30ed32b4293143672fd250ae377c3bd33f2b00 (patch) | |
tree | 3e342480f59357aec8b742c4c443a27771c07575 /io_scene_gltf2/blender | |
parent | ca5a47570fd872f03aa9a8ad95c6375df91cd002 (diff) |
Updates for removal of mesh.show_double_sided
Change glTF to use the new material backface culling option, which is more
correct since the Blender double sided option was about lighting only, not
culling.
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py index 79ed5fd7..e981fad2 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_primitives.py @@ -53,7 +53,7 @@ def gather_primitives( extensions=None, extras=None, indices=__gather_indices(internal_primitive, blender_mesh, modifiers, export_settings), - material=__gather_materials(internal_primitive, blender_mesh, modifiers, export_settings), + material=__gather_materials(internal_primitive, modifiers, export_settings), mode=None, targets=__gather_targets(internal_primitive, blender_mesh, modifiers, export_settings) ) @@ -62,13 +62,13 @@ def gather_primitives( return primitives -def __gather_materials(blender_primitive, blender_mesh, modifiers, export_settings): +def __gather_materials(blender_primitive, modifiers, export_settings): if not blender_primitive['material']: # TODO: fix 'extract_primitives' so that the value of 'material' is None and not empty string return None - mesh_double_sided = blender_mesh.show_double_sided material = bpy.data.materials[blender_primitive['material']] - return gltf2_blender_gather_materials.gather_material(material, mesh_double_sided, export_settings) + material_double_sided = not material.use_backface_culling + return gltf2_blender_gather_materials.gather_material(material, material_double_sided, export_settings) def __gather_indices(blender_primitive, blender_mesh, modifiers, export_settings): |