Add basic support for geom rgba.

Adds primvar:displayColor/primvar:displayOpacity to the geom prim if its rgba attribute differs from the default (0.5, 0.5, 0.5, 1.0).  This sets the color and opacity directly on the prim with no need for an external material, making it consistent with how rgba is used in mujoco.

PiperOrigin-RevId: 751013128
Change-Id: I059943ec5b266e62c3696d9a0ac4f2033db9e07f
This commit is contained in:
Google DeepMind
2025-04-24 08:58:05 -07:00
committed by Copybara-Service
parent 8df3614781
commit d3bc0544d3
3 changed files with 77 additions and 0 deletions
@@ -60,6 +60,13 @@
.Get(&prim_purpose); \
EXPECT_EQ(prim_purpose, purpose); \
}
#define EXPECT_ATTRIBUTE_HAS_VALUE(stage, path) \
EXPECT_TRUE((stage)->GetAttributeAtPath(SdfPath(path)).HasValue());
#define EXPECT_ATTRIBUTE_HAS_NO_VALUE(stage, path) \
EXPECT_FALSE((stage)->GetAttributeAtPath(SdfPath(path)).HasValue());
namespace mujoco {
pxr::SdfLayerRefPtr LoadLayer(