OpenUSD Plugin for IsaacSim 5.0 (Python 3.11)

Isaac Sim Version

Other (please specify): 5.0

Operating System

All of them

Topic Description

Building a OpenUSD extension for IsaacSim 5.0 does not work because of python 3.11

Detailed Description

I used GitHub - NVIDIA-Omniverse/OpenUSD-plugin-samples at kit106_updates to build a openusd extension for IsaacSim 4.x. Now I want to target 5.0 as well but it seems like python 3.11 is not supported.

Steps to Reproduce

  1. Clone GitHub - NVIDIA-Omniverse/OpenUSD-plugin-samples at kit106_updates

  2. Change python version to 3.11 does not work and I cannot figure out which nv-usd lib I need for 3.11

  3. Using opensd as flavor does result in Requested OpenUSD flavor openusd 22.11 Python 3.11 not currently supported

Is there a timeline when this will be supported? Our extension depends on those USD types and we see the need to upgrade to IsaacSim 5.0 soon

Ok I figured that out kinda.
I stepped back from the open-usd template approach and used the ./repo.sh usd setup with the usd plugin config in the repo.toml.

I used kit-app-template which had the right kit dependecies and went on from there

repo.toml

[repo_usd]
usd_root = "${root}/_build/target-deps/usd"
usd_python_root = "${root}/_build/target-deps/python"
generate_plugin_buildfiles = true
plugin_buildfile_format = "cmake"
generate_root_buildfile = true

[repo_usd.plugin.testSchema]
plugin_dir = "${root}/source/extensions/test"
schema_file = "${root}/source/extensions/test/schema/schema.usda"
install_root = "${root}/source/extensions/test/plugins"
module_dir = "testSchema"
...

executed this

./repo.sh usd

and made sure I’m compiling with v142 toolset. For linux it did not really matter which tooling to use but I needed to make sure I use the C++11 ABI compile flags
e.g.

cd ./_build_plugin
cmake -G "Visual Studio 17 2022" -T v142 ..

Build and compiled everything with cmake tooling

and the extension required an init file

from pxr import Plug
import os

pluginsRoot = os.path.join(os.path.dirname(__file__), "../../plugins")
schemaPath = os.path.join(pluginsRoot, "resources")

Plug.Registry().RegisterPlugins(schemaPath)

the config extension.toml looked like

[core]
reloadable = false
order = -100

[package]
...

[dependencies]
"omni.usd.libs" = {}

[[python.module]]
name = "test.schema"

[[python.module]]
name = "testSchema"
path = "./plugins"

[[native.library]]
"filter:platform"."linux-x86_64"."path" = "plugins/lib/${lib_prefix}testSchema${lib_ext}"
"filter:platform"."windows-x86_64"."path" = "plugins/lib/${lib_prefix}testSchema${lib_ext}"

Gotchas

For some reason I was not able to do something like a nested module for the schema lib.

module_dir = "test/schema/abc"

always put the init file of the plugin at the wrong place and a module test.schema.abx._abc could not be found

Maybe I missed a tutorial anywhere but to figure this out I had to study the _repo/deps/repo_usd/README.md and compile IsaacSim 5.0 to figure out how RobotSchema and its internal schemas were built