Skip to content

Commit c59f3df

Browse files
authored
Merge pull request #97 from Ipuch/trc-reading
feat: trc-data-reader on conda
2 parents 1b60382 + 0aefb52 commit c59f3df

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ And also animate biorbd models from the pyomeca organization.
77

88
```bash
99
conda install -c conda-forge pyorerun rerun-sdk=0.27.2
10-
pip install trc-data-reader # for .trc file support, not available on conda
1110
conda install opensim-org::opensim # not a mandatory dependency
1211
conda install -c conda-forge biobuddy=0.2.0 # not a mandatory dependency
1312
```
@@ -63,7 +62,7 @@ animation.rerun()
6362
```
6463

6564
## From source
66-
```conda install -c conda-forge ezc3d rerun-sdk=0.27.2 trimesh numpy biorbd pyomeca tk imageio imageio-ffmpeg```
65+
```conda install -c conda-forge ezc3d rerun-sdk=0.27.2 trimesh numpy biorbd pyomeca tk imageio imageio-ffmpeg trc-data-reader```
6766

6867
if you want to use the OpenSim, you also need to install separately:
6968
```conda install -c opensim-org::opensim```
@@ -72,9 +71,6 @@ if you want to use the BioBuddy, you also need to install separately:
7271
```conda install -c conda-forge biobuddy=0.2.0``` or
7372
```pip install biobuddy==0.2.0```
7473

75-
if you want to use the .trc file support, you also need to install separately:
76-
``` pip install trc-data-reader ```
77-
7874
Then, ensure it is accessible in your Python environment by installing the package:
7975

8076
``` pip install . ``` or ``` python setup.py install ```

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ channels:
55
- opensim-org
66
dependencies:
77
- ezc3d
8+
- trc-data-reader>=0.4.0
89
- rerun-sdk=0.27.2
910
- numpy
1011
- matplotlib

pyorerun/multi_frame_rate_phase_rerun.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import numpy as np
44
import rerun as rr
5+
import rerun.blueprint as rrb
56

67
from .phase_rerun import PhaseRerun
78

@@ -120,6 +121,16 @@ def rerun(
120121
if init:
121122
spawn = not notebook and os.environ.get("PYORERUN_HEADLESS", "0").lower() not in ("1", "true", "yes")
122123
rr.init(f"{name}_{0}", spawn=spawn)
124+
rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Y_UP, static=True)
125+
rr.send_blueprint(
126+
rrb.Blueprint(
127+
rrb.Spatial3DView(
128+
name="",
129+
origin=f"/",
130+
eye_controls=rrb.archetypes.EyeControls3D(eye_up=[0, 1, 0]), # Y-axis as up
131+
)
132+
)
133+
)
123134

124135
for phase_rerun in self.phase_reruns:
125136
frame = 0

pyorerun/multi_phase_rerun.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ def all_windows(self) -> list[str]:
8686
def rerun_by_frame(self, server_name: str = "multi_phase_animation", notebook=False) -> None:
8787
spawn = not notebook and os.environ.get("PYORERUN_HEADLESS", "0").lower() not in ("1", "true", "yes")
8888
rr.init(server_name, spawn=spawn)
89+
rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Y_UP, static=True)
90+
rr.send_blueprint(
91+
rrb.Blueprint(
92+
rrb.Spatial3DView(
93+
name="",
94+
origin=f"/",
95+
eye_controls=rrb.archetypes.EyeControls3D(eye_up=[0, 1, 0]), # Y-axis as up
96+
)
97+
)
98+
)
99+
89100
for i, phase in enumerate(self.rerun_biorbd_phases):
90101
for j, (window, rr_phase) in enumerate(phase.items()):
91102

@@ -100,6 +111,17 @@ def rerun_by_frame(self, server_name: str = "multi_phase_animation", notebook=Fa
100111
def rerun(self, server_name: str = "multi_phase_animation", notebook=False) -> None:
101112
spawn = not notebook and os.environ.get("PYORERUN_HEADLESS", "0").lower() not in ("1", "true", "yes")
102113
rr.init(server_name, spawn=spawn)
114+
rr.log("/", rr.ViewCoordinates.RIGHT_HAND_Y_UP, static=True)
115+
rr.send_blueprint(
116+
rrb.Blueprint(
117+
rrb.Spatial3DView(
118+
name="",
119+
origin=f"/",
120+
eye_controls=rrb.archetypes.EyeControls3D(eye_up=[0, 1, 0]), # Y-axis as up
121+
)
122+
)
123+
)
124+
103125
for i, phase in enumerate(self.rerun_biorbd_phases):
104126
for j, (window, rr_phase) in enumerate(phase.items()):
105127

0 commit comments

Comments
 (0)