How do i import my custom schema on my extension?

I builded a simple schema incloud(dll,lib,pyd),but i have no idea how to config it on extension.toml and extension.py. The documentation does not clearly describe these steps

That is a great question. Let me do some research and get back to you. Thank you for your patience.

And i think usd-plugin-samples this git example need to mention about repo.toml is complie entrypoints, and setwindowsenv.bat not work forme so i menully add it to PATH, those thing i think should be highlighting

Here try this
GitHub - NVIDIA-Omniverse/usd-plugin-samples at kit106_updates

Ok, i kind understand this type of build pattern, but one thing i don’t understand that is you only need to config those thing and don’t need build ( i mean use some tools to build) ?
is that mean, when kit is starting, extension will compliling then call Tf to registy plugin into kit?
Sorry about this qustion but i am looking pixar usd doc and usd-plugin-samples for 2day it made me into chaos

Ok, i just miss this lineNow build your extension and app using the kit-app-template instructions (usually .\repo.bat build or ./repo.sh build)., So whatever plugin you need to build, just using repo.bat -build, i get it

Well, the example is showing about codeless schema, but i don’t think it can apply to IsA typed Schema,

Yes exactly. Do not refer to anything USD from Pixar. We are our own separate dev build. Please use the repo tools that we supply with our Kit App Template.

I used the kit106 branch of usd-plugin-samples, and successfully generated omniExampleSchema.dll and other files by running build.bat without modifying any files. However, when I try to register it within the extension, the console keeps showing errors. I’ve checked the paths and naming multiple times but still can’t find the source of the problem.

[31.716s] [ext: My.Schema.info-1.0.0] startup
2025-01-29 13:57:57 [31,635ms] [Warning] [omni.usd] Coding Error: in _DefineCppType at line 969 of C:\g\122538378\USD\pxr\base\tf\type.cpp -- TfType 'OmniExampleOmniMeshLod' already has a defined C++ type; cannot redefine

2025-01-29 13:58:17 [51,679ms] [Error] [omni.ext._impl.custom_importer] Failed to import python module omniExampleSchema. Error: No module named 'omniExampleSchema'. Traceback:    
Traceback (most recent call last):
  File "c:\users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/kernel/py\omni\ext\_impl\custom_importer.py", line 76, in import_module
    return importlib.import_module(name)
  File "c:\users\jiucao\documents\github\kit-app-template\_build\windows-x86_64\release\kit\python\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'omniExampleSchema'

2025-01-29 13:58:17 [51,680ms] [Error] [carb.scripting-python.plugin] Exception: Extension python module: 'omniExampleSchema' in 'c:\users\jiucao\documents\github\kit-app-template\_build\windows-x86_64\release\exts\My.Schema.info' failed to load.

At:
  c:\users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/kernel/py\omni\ext\_impl\_internal.py(213): startup
  c:\users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/kernel/py\omni\ext\_impl\_internal.py(328): startup_extension
  PythonExtension.cpp::startup()(2): <module>
  d:/omniverse/data/kit/my usd composer/0.1/exts/3/omni.kit.window.extensions-1.4.25+d02c707b/omni/kit/window/extensions/ext_commands.py(33): do
  c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/extscache/omni.kit.commands-1.4.9+d02c707b.wx64.r.cp310/omni/kit/undo/undo.py(81): execute        
  c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/extscache/omni.kit.commands-1.4.9+d02c707b.wx64.r.cp310/omni/kit/commands/command.py(463): execute
  d:/omniverse/data/kit/my usd composer/0.1/exts/3/omni.kit.window.extensions-1.4.25+d02c707b/omni/kit/window/extensions/common.py(509): toggle_self
  c:\users\jiucao\documents\github\kit-app-template\_build\windows-x86_64\release\kit\python\lib\asyncio\events.py(80): _run
  c:\users\jiucao\documents\github\kit-app-template\_build\windows-x86_64\release\kit\python\lib\asyncio\base_events.py(1909): _run_once
  c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/extscore/omni.kit.async_engine/omni/kit/async_engine/async_engine.py(197): run_once
  c:/users/jiucao/documents/github/kit-app-template/_build/windows-x86_64/release/kit/extscore/omni.kit.async_engine/omni/kit/async_engine/async_engine.py(263): <lambda>

2025-01-29 13:58:17 [51,682ms] [Error] [omni.ext.plugin] [ext: My.Schema.info-1.0.0] Failed to startup python extension.
[56.276s] [ext: My.Schema.info-1.0.0] shutdown

here is sample:
My.Schema.info.zip (54.5 KB)

@Jiucao I am trying to get you an answer. To be honest, we are not sure what it is you are trying to do. We don’t understand 1) why you need to generate your own schema. We already have all that in place 2) What extension are you making and why do you need to include a custom schema?

What would help is for you to expand on exactly what it is you are trying to do. Are you making a custom app? Are you needing a custom extension? What does the app or the extension do? Why do you need to make a custom schema? What are “usd-plugin-samples”? Can you send me a link to where you are finding those? Never heard of them. If they are samples, what are you trying to modify them to do?

First, we need to register some schemas to provide our customers with specific APIs. These particular extensions and schemas need to be containerized and distributed to our customers.

here is USD-Plugin-Samples

It should be noted that the file structure of main and 106branch is different after the build.

There a same issue but closed:The specified module could not be found (omniExampleSchema.dll) · Issue #16 · NVIDIA-Omniverse/usd-plugin-samples · GitHub

It sounds like you are an advanced user building a commercial Enterprise product. If so, I think it would be best if you refer to our Enterprise portal for advanced help. Are you Enterprise? If you are developing apps to be distributed, you need to be Enterprise, and if you file your tickets in the Enterprise Portal, you will get specific technical help on this advanced topic.

We only need to deliver the source code to our customers. The build is not our responsibility to distribute to NGC. This is unrelated to enterprise licensing. As far as I understand, the repositories under the KIT106 branch should be able to register and import schemas normally. However, I noticed that another user on Discord is also asking the same question. Since there are no further details provided in the repository, we cannot verify which step is causing the issue. The only thing we can confirm is that the plugin registered by init.py can be found through Tf.Plug, but the schema cannot be imported or used.

I will submit an issue to that repository later to see if the developers in charge of maintenance can identify the problem.

I would suggest moving the relevant schema sample from usd-plugin-samples into your existing project, confirming the setup is working, then modifying it to create the schemas you wish to register for your extension. But if you are distributing code, then you will need to an Enterprise customer yes. Otherwise, you will be in Violation of our EULA.

To provide additional details to @Richard3D’s advice, we posted some notes on the usd-plugin-samples repository.

I am copying these notes here for the benefit of the community, in case anyone else may face similar issues or wishes to learn more about the process of registering custom OpenUSD schemas through Omniverse extensions:

Following the instructions provided to integrate OpenUSD schemas in Kit 106, I can confirm the documentation provides up to date information about loading custom schemas bundled with Kit extensions.

Perhaps I could suggest opting for the following approach:

  1. Cloning the kit-app-template project from from GitHub - NVIDIA-Omniverse/kit-app-template: Omniverse Kit App Template
  2. Following the instructions in the kit-app-template project to create an empty sample extension, and app in which that extension can be hosted.
  3. After confirming this sample extension can be loaded in Kit, proceed to integrate the vanilla omni.example.schema included in this repository, without modifications at first (see build instructions here, along with a sample extension.toml and __init__.py).

Then, after confirming the examples schemas are successfully loaded in Kit, I may be useful to:

  1. Modify the sample schemas (e.g. by adding a new float property).
  2. Rebuild the sample schemas.
  3. Relaunch Kit with the Extension responsible for loading the libraries to confirm the sample schemas exhibit the new float properties.

This would help diagnose potential issues such as:

  • Whether relative paths may not resolve as expected.
  • Typos inadvertently included in schema names.
  • Dot characters (.) appearing in Python module names.
  • Naming conventions being modified by the build process (i.e. camel case, with no repeating uppercase, etc.).
  • etc.

After successfully confirming the properties newly-added to the sample schemas are present in Kit, it may then be worth considering adding your custom schemas one by one, rebuilding and validating their presence in Kit after each addition.

As the ultimate step, you may then wish to rename the schema sample into a naming convention appropriate for your organization, to facilitate distributing your schema (and validating once more that renaming does not interfere with path resolution or naming convention).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.