-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds option for default plane color to terrain importer #1791
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kyle Morgenstein <[email protected]>
Signed-off-by: Kyle Morgenstein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternate proposal: Maybe we can allow the passing of visual_material
parameter instead to the ground plane? This provides more flexbility to change this plane to other texture materials.
To just change the color of the grid, perhaps we can use the diffuse_color
of the default PbrMaterial.
This should avoid the need of yet another parameter and cover broader usecases
I had thought of that but wasn't sure if the ground plane supported setting material types, I just saw the option for color. I can make it pick up the diffuse_color field of the visual material to avoid adding another option though. I'll revise and request review once updated. |
That would be amazing! Thanks a lot :) |
Is there any desire to allow changing properties beyond the diffuse color? in spawn_ground_plane() the color is updated here: # Change the color of the plane
# Warning: This is specific to the default grid plane asset.
if cfg.color is not None:
prop_path = f"{prim_path}/Looks/theGrid/Shader.inputs:diffuse_tint"
# change the color
omni.kit.commands.execute(
"ChangePropertyCommand",
prop_path=Sdf.Path(prop_path),
value=Gf.Vec3f(*cfg.color),
prev=None,
type_to_create_if_not_exist=Sdf.ValueTypeNames.Color3f,
) If so, is there documentation anywhere over the corresponding property paths in |
Ok changes are pushed, the color for a plane can now be configured as follows: terrain = TerrainImporterCfg(
prim_path="/World/ground",
terrain_type="plane",
terrain_generator=None,
collision_group=-1,
physics_material=sim_utils.RigidBodyMaterialCfg(
friction_combine_mode="multiply",
restitution_combine_mode="multiply",
static_friction=1.0,
dynamic_friction=1.0,
),
visual_material=sim_utils.PreviewSurfaceCfg(diffuse_color=(1.0, 0.0, 0.0)), # red
debug_vis=False,
) This allows changing the color of the ground plane but does not permit changing the material. If desired I could work on a PR expanding this to include e.g. setting Mdl file textures to the ground plane, but it would require some additional work in the ground plane spawner (and I would need some documentation on the corresponding property paths). |
Description
The default plane configuration supports setting the plane color, but this option is not currently exposed via the terrain importer. This PR adds a ``color'' field to the terrain importer that is only used for configuring a plane.
Type of change
Screenshots
Configuration:
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there