Skip to content

Commit

Permalink
Use gltf2_blender_math.swizzle_yup_location
Browse files Browse the repository at this point in the history
Fixes loading error
  • Loading branch information
nasser committed Dec 4, 2020
1 parent 7e2736f commit cd4c4fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from . import gltf2_blender_export_keys
from ...io.com.gltf2_io_debug import print_console
from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins
from io_scene_gltf2.blender.exp.gltf2_blender_gather_nodes import __convert_swizzle_location
from io_scene_gltf2.blender.com.gltf2_blender_math import swizzle_yup_location


def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vertex_groups, modifiers, export_settings):
Expand Down Expand Up @@ -329,7 +329,7 @@ def extract_line_primitives(blender_mesh, excluded_indices, export_settings):
for edge in valid_edges:
for j in edge.vertices:
vertex = blender_mesh.vertices[j]
attributes['POSITION'][i, :] = __convert_swizzle_location(vertex.co, export_settings)
attributes['POSITION'][i, :] = swizzle_yup_location(vertex.co) if export_settings[gltf2_blender_export_keys.YUP] else vertex.co
attributes['NORMAL'][i, :] = vertex.normal
primitive['indices'][i] = i
i += 1
Expand Down Expand Up @@ -361,7 +361,7 @@ def extract_point_primitives(blender_mesh, excluded_indices, export_settings):
}

for i, vertex in enumerate(valid_vertices):
attributes['POSITION'][i, :] = __convert_swizzle_location(vertex.co, export_settings)
attributes['POSITION'][i, :] = swizzle_yup_location(vertex.co) if export_settings[gltf2_blender_export_keys.YUP] else vertex.co
attributes['NORMAL'][i, :] = vertex.normal
primitive['indices'][i] = i

Expand Down

0 comments on commit cd4c4fb

Please sign in to comment.