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

MeshTessellate : Store subdivision scheme as string #5787

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

danieldresser-ie
Copy link
Contributor

Switches our representation of subdivision scheme to just be a string rather than a custom enum. This is a bit simpler, and will be more consistent when other subdivision options are stored as strings ( the other options will come later, but we want to get this merged while 1.4 is still in beta, and it shouldn't cause problems to change this ).

All pretty straightforward - the only possible point of discussion I can think of is "bilinear" vs "linear". I think the approach of taken is correct - "bilinear" is the name of a subdivision scheme ( as is the convention in USD and OpenSubdiv ). "linear" is something we store in the interpolation property of a mesh, which means the mesh should be interpreted as simple polygons.

In the long term, we should support "bilinear" in the interpolation property of a mesh, to indicate a mesh which needs tessellation, but with a flat limit surface, and we should potentially rename "linear" to "none". I think this PR helps move us in that direction.

One tiny downside to this PR - in the UI, scheme = "" is represented as "From Mesh", so the UI is clear. But the API to MeshAlgo::tessellateMesh now just has scheme = "", which is a bit less clear that it's coming from the mesh than when it was scheme = SubdivisionScheme::FromMesh. There is maybe more of an argument now for naming it overrideScheme? But it's probably more important that the UI be nice and clear, and we want to match the name used in the UI, so this is probably fine?

@johnhaddon johnhaddon merged commit 324df5f into GafferHQ:main Apr 12, 2024
5 checks passed
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.

2 participants