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

MeshSmoother destroys original mesh #53

Closed
Cameron-Micka opened this issue Jul 6, 2022 · 0 comments · Fixed by #85
Closed

MeshSmoother destroys original mesh #53

Cameron-Micka opened this issue Jul 6, 2022 · 0 comments · Fixed by #85
Labels
bug Something isn't working in progress This issue is currently being worked on

Comments

@Cameron-Micka
Copy link
Member

Original issue: microsoft/MixedRealityToolkit-Unity#9307

Describe the bug

I am currently using the MeshSmoother together with the Outline shading using the MRTK2 shader. In our scenario, this needs to be done and undone programatically and leaving the original mesh untoched. It just so happens that when the MeshSmoother component is destroyed, its OnDestroy method wipes out the object mesh and I can't show the original object anymore.

Expected behavior

MeshSmoother.OnDestroy not having the desctructive behavior.

Additional context

I realize that the smoothed normals are written to the UV2 channel and I might as well just keep them until the object is actually destroyed but I don't think the fix I suggested as any downsides and has the upside of being able to safely remove a MeshSmoother component without issues.

Another problem is that you can't use MeshOutlineHierarchy if you want to disable outlines since it can only be destroyed. It doesn't implement OnEnable/OnDisable. My workaround is to disable MeshOutline components instead of destroying them.

@Cameron-Micka Cameron-Micka added the bug Something isn't working label Jul 6, 2022
@Cameron-Micka Cameron-Micka added the in progress This issue is currently being worked on label Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue is currently being worked on
Projects
None yet
1 participant