Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unitypack/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def read(self, buf):
return self

def __str__(self):
return "%s %s %s" % (-self.x, self.y, self.z)
return "%s %s %s" % (self.x, self.y, self.z)


class OBJVector4(OBJVector3):
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self, mesh):
@staticmethod
def face_str(indices, coords, normals):
ret = ["f "]
for i in indices[::-1]:
Copy link
Copy Markdown
Contributor

@robert-nix robert-nix Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this was done to convert from left-handed coordinates to right-handed coordinates, FWIW. So without this the face normals would all be inside out in tools that expect right-handed models.

Copy link
Copy Markdown
Author

@j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz j5rlLqM-rvsrY96V-GpVJP0F-IZFesRzy-ShMoz Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, um, TBH I thought pull requests would only add the commits from before they were made.
Either way, you are correct, however removing the - on line 31 inverts the models once, so the face normals are as they should.
I know it's a bit counter-intuitive but if you test it, it should be fine.

for i in indices:
ret.append(str(i + 1))
if coords or normals:
ret.append("/")
Expand Down