Fix set_time_ctrl
not doing anything when called twice
#10547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To repro the original issue on
main
:viewer.set_time_ctrl
viewer_set_time_ctrl
again with the same arguments (same time/timeline)(3) would not adjust the time cursor like in step (1). This is due to
_time_ctrl
being stateful, but not bidirectionally synchronized between the Viewer and SDK. Moving the time cursor doesn't update the_time_ctrl
value back in Python land, and so the_time_ctrl
value in (3) isn't changed from (1), resulting in no state update for the Viewer.For these kinds of things it makes more sense to use custom messages for SDK->Viewer uni-directional things. For Viewer->SDK, we have events exposed for timeline state, which are correctly fired whenever a user input in the Viewer results in the state changing.