How to programmatically perform UI action Create > Material > Preview Surface Texture?

Isaac Sim Version

4.5.0
4.2.0
4.1.0
4.0.0
4.5.0
2023.1.1
2023.1.0-hotfix.1
Other (please specify):

Operating System

Ubuntu 22.04
Ubuntu 20.04
Windows 11
Windows 10
Other (please specify):

GPU Information

  • Model: RTX 4090
  • Driver Version: 560.94

Topic Description

Detailed Description

In Isaac Sim UI I can right click a prim and select Create > Material > Preview Surface Texture

which results in a new PreviewSurfaceTexture_01 which has the following properties: Displacement and Surface

When I attempt to perform the equivalent action in code using

omni.kit.commands.execute(
        "CreatePreviewSurfaceTextureMaterialPrim",
        mtl_path=material_prim_path,
        select_new_prim=True,
)

This results in creation of a similar PreviewSurfaceTexture prim; however, it ONLY has Displacement and is missing Surface property! (Given the command has “Surface” in the name, but not displacement you would expect if this error was to happen you would get the opposite; Surface without Displacement) 😋

This means even when I have textures assigned to the diffuseColorTex property they do not render!

The only difference I can see is the “Surface” property of the material. Both materials are applied to the same Mech cube. The one created through the UI works and other created programmatically does not.

I would like to be able to programmatically create a Preview Surface texture which has both Displacement and Surface properties.

Questions

Is there an alternate command to CreatePreviewSurfaceTextureMaterialPrim?
Is there an alternate to commands, like using the omni.isaac.core.materials such as special parameters to PreviewSurface?

Steps to Reproduce

  1. See above

Error Messages

N/A

Screenshots or Videos

N/A

Additional Information

What I’ve Tried

N/A

Related Issues

Adding 2D image as texture to a height-field - Omniverse / Isaac Sim - NVIDIA Developer Forums

Additional Context

N/A