Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Error when Exporting a Shape Key's Normals (#56) #99

Merged
merged 1 commit into from May 6, 2021

Conversation

sercero
Copy link
Collaborator

@sercero sercero commented May 6, 2021

  • fixes "Unknown Location -1" Error when Exporting a Shape Key's Normals and/or Animations #56

  • Created a mapping between tesselated faces and polygon faces, before the untesselated mesh was being indexed by tesselated indexes

  • Normals were being stored as a delta from original normal to shape normal, PlayPenTests.cpp shows that is not how it should be done.

  • Tested with all Blender basic meshes and different shape keys: Cube / Plane / Triangle / Icosphere / Sphere / Cylinder

  • Tested in Ogre with a geometry shader that shows Normals, that the normals are being correctly deformed by the Shape Keys

  • Tested with MBetters model (still won't work for him due to OgreMeshTool Fails #78, which is a Ogre 2.x bug)

  • Custom Normals were not being taken into account

  • (Progress Bug) Fix: Avoid division by zero for meshes with only one triangle

  • (README) Fix: "Exporting Skeletal Animations" was not in the index

There is still work to do, becase the fix in this case is actually a patch on a bad design.
The proper way to export the Shape Keys would be to apply only the Shape Key to export, create a copy mesh, tesselate it and then export that.
(Crossing fingers that the vertex indexes will be the same as the tesselated mesh without the shape key applied, I don't know if the algorithm is consistent so this approach might fail)

Anyway, the current fix is good enough (for now).

@paroj paroj merged commit 5d9f2ed into OGRECave:master May 6, 2021
@sercero sercero deleted the shape_keys-fix branch May 7, 2021 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Unknown Location -1" Error when Exporting a Shape Key's Normals and/or Animations
2 participants