polyscope
polyscope copied to clipboard
Callbacks get called before view data is initialized on the first main loop iteration
If you create a callback function, register it, and then show() in the usual fashion, on the first main loop iteration the callback will be invoked before the view data is initialized. If the callback accesses e.g. the camera parameters, it will get NaNs on the first iteration, which can be a confusing source of errors (even if transient).
We should make sure everything is initialized right away at the beginning of show(), before anything else happens. More deeply, maybe we should reconsider why we initialize view parameters lazily in show() rather than init().