Skip to content

Commit

Permalink
sdf2usd: set cylinder refinement parameter (#34) (#38)
Browse files Browse the repository at this point in the history
The refinement parameter is 0 by default when loaded in
Isaac Sim, which makes cylinders look like extruded
polygons. Setting the refinement parameter to 1 makes
them rounder.

Signed-off-by: Steve Peters <[email protected]>
(cherry picked from commit 0b699a6)

Co-authored-by: Steve Peters <[email protected]>
  • Loading branch information
mergify[bot] and scpeters authored Oct 3, 2024
1 parent 71f2ebf commit f22328c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/sdf_parser/Geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ namespace usd
extentBounds.push_back(endPoint);
usdCylinder.CreateExtentAttr().Set(extentBounds);

// Set refinement level for cylinders so that the visual shapes will look
// rounder. It should be ignored for collision shapes.
auto enableRefinementAttr =
usdCylinder.GetPrim().CreateAttribute(
pxr::TfToken("refinementEnableOverride"),
pxr::SdfValueTypeNames->Bool, false);
enableRefinementAttr.Set(true);
auto refinementAttr =
usdCylinder.GetPrim().CreateAttribute(
pxr::TfToken("refinementLevel"),
pxr::SdfValueTypeNames->Int, false);
refinementAttr.Set(1);

return errors;
}

Expand Down

0 comments on commit f22328c

Please sign in to comment.