Skip to content

Commit 359cdc9

Browse files
authored
Fixes importing MotionViewer from external scripts (#2195)
# Description The `MotionViewer` class is not imported in `__init__.py`, preventing external scripts from using this class. This PR fixes this issue such that the MotionViewer class can be imported by external scripts. The example usage would look like: ```python from isaaclab.app import AppLauncher # launch omniverse app app_launcher = AppLauncher(headless=True) simulation_app = app_launcher.app """Rest everything follows.""" from isaaclab_tasks.direct.humanoid_amp.motions import MotionViewer ``` Fixes #2196 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent 742d8b4 commit 359cdc9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

source/isaaclab_tasks/isaaclab_tasks/direct/humanoid_amp/motions/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
"""
99

1010
from .motion_loader import MotionLoader
11+
from .motion_viewer import MotionViewer

source/isaaclab_tasks/isaaclab_tasks/direct/humanoid_amp/motions/motion_viewer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
import torch
1111

1212
import mpl_toolkits.mplot3d # noqa: F401
13-
from motion_loader import MotionLoader
13+
14+
try:
15+
from .motion_loader import MotionLoader
16+
except ImportError:
17+
from motion_loader import MotionLoader
1418

1519

1620
class MotionViewer:

0 commit comments

Comments
 (0)