Unverified Commit 619337ed authored by Mayank Mittal's avatar Mayank Mittal Committed by GitHub

Fixes visualization markers to hide them from camera renderings (#103)

# Description

Previously, the visualization markers would get rendered in the camera
images. However, this is often undesirable since the markers are only
used for debug visualizations. This behavior turns these off by default.

## Type of change

- New feature (non-breaking change which adds functionality)
- This change requires a documentation update

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./orbit.sh --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
parent 2ddb90f0
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.8.4"
version = "0.8.5"
# Description
title = "ORBIT framework for Robot Learning"
......
Changelog
---------
0.8.5 (2023-08-03)
~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed the :class:`omni.isaac.orbit.markers.Visualizationmarkers` class so that the markers are not visible in camera rendering mode.
Changed
^^^^^^^
* Simplified the creation of the point instancer in the :class:`omni.isaac.orbit.markers.Visualizationmarkers` class. It now creates a new
prim at the next available prim path if a prim already exists at the given path.
0.8.4 (2023-08-02)
~~~~~~~~~~~~~~~~~~
......
......@@ -22,9 +22,11 @@ from dataclasses import MISSING
from typing import Any, Dict, List, Optional, Union
import omni.isaac.core.utils.prims as prim_utils
import omni.isaac.core.utils.stage as stage_utils
import omni.kit.commands
from omni.isaac.core.materials import PreviewSurface
from omni.isaac.core.prims import GeometryPrim
from pxr import Gf, UsdGeom, Vt
from pxr import Gf, Sdf, UsdGeom, Vt
from omni.isaac.orbit.utils.assets import check_file_path
from omni.isaac.orbit.utils.configclass import configclass
......@@ -162,21 +164,13 @@ class VisualizationMarkers:
cfg (VisualizationMarkersCfg): The configuration for the markers.
Raises:
ValueError: When a prim already exists at the :obj:`prim_path` and it is not a :class:`UsdGeom.PointInstancer`.
ValueError: When no markers are provided in the :obj:`cfg`.
"""
# resolve default markers in the UI elements
# -- prim path
if prim_utils.is_prim_path_valid(prim_path):
# retrieve prim if it exists
prim = prim_utils.get_prim_at_path(prim_path)
if not prim.IsA(UsdGeom.PointInstancer):
raise ValueError(f"The prim at path {prim_path} cannot be parsed as a `UsdGeom.PointInstancer` object.")
self._instancer_manager = UsdGeom.PointInstancer(prim)
else:
# create a new prim
prim = prim_utils.define_prim(prim_path, "PointInstancer")
self._instancer_manager = UsdGeom.PointInstancer(prim)
# get next free path for the prim
prim_path = stage_utils.get_next_free_path(prim_path)
# create a new prim
prim = prim_utils.define_prim(prim_path, "PointInstancer")
self._instancer_manager = UsdGeom.PointInstancer(prim)
# store inputs
self.prim_path = prim_path
self.cfg = cfg
......@@ -409,6 +403,14 @@ class VisualizationMarkers:
scale=cfg.scale,
attributes=cfg.attributes,
)
# make marker invisible to secondary rays
omni.kit.commands.execute(
"ChangePropertyCommand",
prop_path=Sdf.Path(f"{marker_prim_path}.primvars:invisibleToSecondaryRays"),
value=True,
prev=None,
type_to_create_if_not_exist=Sdf.ValueTypeNames.Bool,
)
# set visibility
prim_utils.set_prim_visibility(prim, visible=cfg.visible)
# create color attribute
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment