Archive 17/01/2023.

Update StaticModel by timer inside Editor

Eugene

I need to update (i.e. change model and material of) some StaticModel component every X (m)sec in paused Editor.
I tried to use LogicComponent::Update but it does not work in pause, of course.
I tried to use StaticModel::UpdateGeometry but even if called from main thread, destruction of old model in the middle of rendering cause crash inside Urho renderer.
Now I just stored old StaticModel::GetModel to prevent destruction. Is there more clean way to do what I want?
This hack just move my problem aside. It is not solution.

cadaver

“Update” event (the application-wide one, not scene update) should be safe, and run irrespective of whether scene(s) are paused or not.

Eugene

Damn, I have completely forgotten about events… Thank you, it works.