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
MeshDataTool.get_edge_faces giving incorrect faces. #91536
Comments
I just tested with built in
The same problem happens:
I don't think blender has anything to do with it. |
After playing around with a few meshes, I don't actually think this is a bug. Maybe there could be some extra documentation to make this clearer though. The fix is simple: Shade the model smooth. It treats edges as unique if there are any properties at all that are not shared by the vertices. The mesh I was working with was this one: Because the mesh is flat, most of the time it recognises that the flat shaded vertices are identical and treats them as such, but I guess sometimes they are slightly different (Moving the mesh around is enough to causes changes) and splits them up during import. I have solved my problem, but I can imagine this might stump a lot of people trying to write code to work with meshes. |
Open edges are going to occur at any boundary between patches of triangles. A sharp normal, a UV map seam, or even random breaks if there's triangle strips involved. This cube for example, might have 5 common edges and 14 seams. There's many ways it can be rearranged though... Processing any mesh data, from blender or otherwise, I've found it easiest to treat each face as completely individual, then worry about re-reducing shared vertices later. |
This is a common misunderstanding, which should eventually be added to the docs. 24 is 6*4 (for each corner of each face) Edges are not shared if the normals are different. Godot vertices cannot have multiple normals, or multiple UVs. Where the position is the same and other attributes differ, the vertex is duplicated (sometimes on import). This is in effect a duplicate of #75279. |
Tested versions
v4.2.2.stable.official [15073af]
System information
Godot v4.2.2.stable - Fedora Linux 40 (Workstation Edition) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 XT (RADV NAVI10) () - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)
Issue description
MeshDataTool.get_edge_faces()
incorrectly reports 1 face (An open edge) on some edges that should share a face.Steps to reproduce
Import a blend file with default cube.
Place the blend file in the scene
Put this script in the root of the scene:
Output I get:
Output I expect (Cube is triangulated during import):
It should not be possible for a cube to have open edges, but for some reason it does.
Minimal reproduction project (MRP)
BlenderImportFaceEdges.zip
The text was updated successfully, but these errors were encountered: