Incorrect typing metadata for USD Define() APIs (typing says None, but actually return the Type being Defined)

Please provide all relevant details below before submitting your post. This will help the community provide more accurate and timely assistance. After submitting, you can check the appropriate boxes. Remember, you can always edit your post later to include additional information if needed.

Isaac Sim Version

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

Isaac Lab Version (if applicable)

1.2
1.1
1.0
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

The python type information for the USD Define API’s is incorrect.
Based on the typing metadata, the Define() method, the return type is None, meaning it does not return anything

However, these Define API’s actually do return objects of the type that was used. E.g. UsdLux.DomeLight.Define returns UsdLux.DomeLight.

Because of the typing error UsdLux.DomeLight must be explicitly added and results in false positive errors in VSCode which degrade the developer experience.

Steps to Reproduce

  1. Use any USD Define(…) API such as UsdShade.Shader.Define or UsdLux.DomeLight.Define
  2. Observe type information is incorrect in VSCode

Error Messages

N/A

Screenshots or Videos

Various examples

Additional Information

What I’ve Tried

N/A

Related Issues

N/A

Additional Context

N/A

1 Like

Thank you for bringing this important issue to our attention regarding the incorrect typing metadata for USD Define APIs. We appreciate your detailed description of the problem and the steps to reproduce it. In addition to Running Python Code from External Editors, do you install any other extensions?

I have other Python related extensions installed such as language server, formatting etc, but No, not other Isaac Sim specific extensions