Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/isaaclab/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.39.5"
version = "0.39.6"

# Description
title = "Isaac Lab framework for Robot Learning"
Expand Down
10 changes: 10 additions & 0 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Changelog
---------

0.39.6 (2025-01-30)
~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added method :meth:`omni.isaac.lab.assets.AssetBase.set_visibility` to set the visibility of the asset
in the simulation.


0.39.5 (2025-05-16)
~~~~~~~~~~~~~~~~~~~

Expand Down
32 changes: 32 additions & 0 deletions source/isaaclab/isaaclab/assets/asset_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@

import inspect
import re
import torch
import weakref
from abc import ABC, abstractmethod
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any

import isaacsim.core.utils.prims as prim_utils
import omni.kit.app
import omni.timeline
from isaacsim.core.simulation_manager import SimulationManager
Expand Down Expand Up @@ -162,6 +164,36 @@ def has_debug_vis_implementation(self) -> bool:
Operations.
"""

def set_visibility(self, visible: bool, env_ids: Sequence[int] | None = None):
"""Set the visibility of the prims corresponding to the asset.

This operation affects the visibility of the prims corresponding to the asset in the USD stage.
It is useful for toggling the visibility of the asset in the simulator. For instance, one can
hide the asset when it is not being used to reduce the rendering overhead.

Note:
This operation uses the PXR API to set the visibility of the prims. Thus, the operation
may have an overhead if the number of prims is large.

Args:
visible: Whether to make the prims visible or not.
env_ids: The indices of the object to set visibility. Defaults to None (all instances).
"""
# resolve the environment ids
if env_ids is None:
env_ids = range(len(self._prims))
elif isinstance(env_ids, torch.Tensor):
env_ids = env_ids.detach().cpu().tolist()

# obtain the prims corresponding to the asset
# note: we only want to find the prims once since this is a costly operation
if not hasattr(self, "_prims"):
self._prims = sim_utils.find_matching_prims(self.cfg.prim_path)

# iterate over the environment ids
for env_id in env_ids:
prim_utils.set_prim_visibility(self._prims[env_id], visible)

def set_debug_vis(self, debug_vis: bool) -> bool:
"""Sets whether to visualize the asset data.

Expand Down