Hey guys. Can you tell me how to update edge-lines (added with enableEdgesRendering) positions after applying bakeTransformIntoVertices for the mesh? Thank you
Hi A. You can simply re- .enableEdgesRendering(); on the transformed mesh.
https://www.babylonjs-playground.com/#TYAHX#130 line 26
Sort of a bad fix, though. We MIGHT want to think about a mod/PR for the two mesh.ts “bake” methods… so that edgesRendering is updated automatically after bakes.
We should probably check highlightLayer, glowLayer, VLS, and lensFlare… to make sure THEY survive bakings, too. (I think those will be fine, as they are different than edgesRendering). Feel free to test them, Avin, and report findings.
For now, you have a temp fix/updater, and we’ll listen for experts’ comments about modifying .bake methods (wise/not), and the best way to code the changes.
Nice find, Avin. Interesting… worthy of some thought/attention.
Wingy bumps. This might be the time to look at THIS issue, because the guys are doing OTHER WORK at the mesh bakery, too. Maybe we can kill 2 bugs/anomalies… with one can of bug spray.
Hey @Drigax … any chance we could piggy-back another mod onto your PR? (pending @Deltakosh approvals, of course.) @drm … this might pertain to you, too, cuz you said “remove all edges” in that other thread, and that is the secret code-phrase for THIS thread.
@Wingnut Agreed. Simply disableEdgesRendering() before the bake and enableEdgesRendering() after the bake workes for me
Got a confirm on the repro:
Thanks for the scene @Wingnut
I’ll take some time to look at the edges renderer implementation. This definitely needs to be addressed!
Currently in the other thread, we’re resetting our mesh transform, but not updating our child transforms to include the offset. If edges renderer is implemented as a child mesh of the base mesh, then that fix should cover both. Otherwise I may want to look into an alternative. Maybe something event driven that anything interested in mesh geometry can hook into to update whenever that changes?
Unfortunately, looks like my fix doesn’t quite address the edges rendering issue, just child meshes. I’ll have to take a closer look at this later today or tomorrow, after I address another issue
As an update, I didn’t forget about this issue, I’m still preoccupied currently with some urgent deadlines!
Thanks for your patience.