1+ import os
2+
13import numpy as np
24import rerun as rr
5+ import rerun .blueprint as rrb
6+
37from .pyomarkers import PyoMarkers
48from .pyoemg import PyoMuscles
59
812from .model_phase import ModelRerunPhase
913from .timeless import Gravity , Floor , ForcePlate
1014from .timeless_components import TimelessRerunPhase
11- from .xp_components import MarkersXp , TimeSeriesQ , ForceVector , Video , VectorXp , PersistentMarkerOptions
15+ from .xp_components import MarkersXp , TimeSeriesQ , ForceVector , Video , VectorXp
1216from .xp_phase import XpRerunPhase
1317from .utils .markers_utils import check_and_adjust_markers
1418
@@ -237,7 +241,19 @@ def rerun_by_frame(
237241 self , name : str = "animation_phase" , init : bool = True , clear_last_node : bool = False , notebook : bool = False
238242 ) -> None :
239243 if init :
240- rr .init (f"{ name } _{ self .phase } " , spawn = True if not notebook else False )
244+ spawn = not notebook and os .environ .get ("PYORERUN_HEADLESS" , "0" ).lower () not in ("1" , "true" , "yes" )
245+ rr .init (f"{ name } _{ self .phase } " , spawn = spawn )
246+ rr .init (f"{ name } _{ self .phase } " , spawn = spawn )
247+ rr .log ("/" , rr .ViewCoordinates .RIGHT_HAND_Y_UP , static = True )
248+ rr .send_blueprint (
249+ rrb .Blueprint (
250+ rrb .Spatial3DView (
251+ name = "" ,
252+ origin = f"/" ,
253+ eye_controls = rrb .archetypes .EyeControls3D (eye_up = [0 , 1 , 0 ]), # Y-axis as up
254+ )
255+ )
256+ )
241257
242258 frame = 0
243259 rr .set_time ("stable_time" , duration = self .t_span [frame ])
@@ -262,7 +278,18 @@ def rerun(
262278 self , name : str = "animation_phase" , init : bool = True , clear_last_node : bool = False , notebook : bool = False
263279 ) -> None :
264280 if init :
265- rr .init (f"{ name } _{ self .phase } " , spawn = True if not notebook else False )
281+ spawn = not notebook and os .environ .get ("PYORERUN_HEADLESS" , "0" ).lower () not in ("1" , "true" , "yes" )
282+ rr .init (f"{ name } _{ self .phase } " , spawn = spawn )
283+ rr .log ("/" , rr .ViewCoordinates .RIGHT_HAND_Y_UP , static = True )
284+ rr .send_blueprint (
285+ rrb .Blueprint (
286+ rrb .Spatial3DView (
287+ name = "" ,
288+ origin = f"/" ,
289+ eye_controls = rrb .archetypes .EyeControls3D (eye_up = [0 , 1 , 0 ]), # Y-axis as up
290+ )
291+ )
292+ )
266293
267294 frame = 0
268295 rr .set_time ("stable_time" , duration = self .t_span [frame ])
0 commit comments