polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

Callbacks get called before view data is initialized on the first main loop iteration

Open nmwsharp opened this issue 4 years ago • 0 comments

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().

nmwsharp avatar Jan 16 '22 21:01 nmwsharp