Skip to content

Commit

Permalink
Fixed necessity to have pyorerun and bioviz installed to run animate
Browse files Browse the repository at this point in the history
  • Loading branch information
pariterre committed Jul 22, 2024
1 parent ade0f8f commit 9c2e5ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions bioptim/models/biorbd/biorbd_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,10 +740,11 @@ def animate(
n_frames: int = 0,
**kwargs,
):
from .viewer_bioviz import animate_with_bioviz_for_loop
from .viewer_pyorerun import animate_with_pyorerun

if viewer == "bioviz":
from .viewer_bioviz import animate_with_bioviz_for_loop

return animate_with_bioviz_for_loop(ocp, solution, show_now, show_tracked_markers, n_frames, **kwargs)
if viewer == "pyorerun":
from .viewer_pyorerun import animate_with_pyorerun

return animate_with_pyorerun(ocp, solution, show_now, show_tracked_markers, **kwargs)
2 changes: 1 addition & 1 deletion bioptim/models/biorbd/viewer_bioviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def animate_with_bioviz(
except ModuleNotFoundError:
raise RuntimeError("bioviz must be install to animate the model")

check_version(bioviz, "2.0.0", "2.4.0")
check_version(bioviz, "2.4.0", "2.5.0")

if "q_roots" in solution and "q_joints" in solution:
states = np.vstack((solution["q_roots"], solution["q_joints"]))
Expand Down

0 comments on commit 9c2e5ff

Please sign in to comment.