Skip to content

Commit

Permalink
Fix a few bugs in json export
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Feb 28, 2024
1 parent 8a37012 commit e8e6e01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/mittsu/core/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def to_json
end
vertices = []
@vertices.each do |vert|
vertices << vertex.x << vertex.y << vertex.z
vertices << vert.x << vert.y << vert.z
end
faces = []
normals = []
Expand Down Expand Up @@ -507,7 +507,7 @@ def to_json
faces << get_uv_index(face_vertex_uvs[2], uvs_hash, uvs)
end
if has_face_normal
faces << get_normal_index(face.normal)
faces << get_normal_index(face.normal, normals_hash, normals)
end
if has_face_vertex_normal
vertex_normals = face.vertex_normals
Expand Down
2 changes: 1 addition & 1 deletion lib/mittsu/core/object_3d.rb
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def jsonify

if !self.children.empty?
data[:children] = @children.map do |child|
child.jsonify
child.to_json
end
end

Expand Down

0 comments on commit e8e6e01

Please sign in to comment.