@@ -65,6 +65,10 @@ impl ThreadInfo {
6565 Self :: with ( |ti| ti. set_time ( timeline, time_int) ) ;
6666 }
6767
68+ pub fn reset_thread_time ( ) {
69+ Self :: with ( |ti| ti. reset_time ( ) ) ;
70+ }
71+
6872 /// Get access to the thread-local [`ThreadInfo`].
6973 fn with < R > ( f : impl FnOnce ( & mut ThreadInfo ) -> R ) -> R {
7074 use std:: cell:: RefCell ;
@@ -92,6 +96,10 @@ impl ThreadInfo {
9296 self . time_point . remove ( & timeline) ;
9397 }
9498 }
99+
100+ fn reset_time ( & mut self ) {
101+ self . time_point = TimePoint :: default ( ) ;
102+ }
95103}
96104
97105// ----------------------------------------------------------------------------
@@ -155,6 +163,7 @@ fn rerun_bindings(py: Python<'_>, m: &PyModule) -> PyResult<()> {
155163 m. add_function ( wrap_pyfunction ! ( set_time_sequence, m) ?) ?;
156164 m. add_function ( wrap_pyfunction ! ( set_time_seconds, m) ?) ?;
157165 m. add_function ( wrap_pyfunction ! ( set_time_nanos, m) ?) ?;
166+ m. add_function ( wrap_pyfunction ! ( reset_time, m) ?) ?;
158167
159168 m. add_function ( wrap_pyfunction ! ( log_unknown_transform, m) ?) ?;
160169 m. add_function ( wrap_pyfunction ! ( log_rigid3, m) ?) ?;
@@ -486,6 +495,11 @@ fn set_time_nanos(timeline: &str, ns: Option<i64>) {
486495 ) ;
487496}
488497
498+ #[ pyfunction]
499+ fn reset_time ( ) {
500+ ThreadInfo :: reset_thread_time ( ) ;
501+ }
502+
489503fn convert_color ( color : Vec < u8 > ) -> PyResult < [ u8 ; 4 ] > {
490504 match & color[ ..] {
491505 [ r, g, b] => Ok ( [ * r, * g, * b, 255 ] ) ,
0 commit comments