MIssing IUsdMutex header

Hello,
I’m writing a custom extension in C++. I trying to access the UsdContext. I included the omni/usd/UsdContextIncludes.h and omni/usd/UsdContext.h.
If I try to compile the extension I got an error for a missing IUsdMutex.h header that is included by the UsdContext.h. I looked in the kit folder but I can’t find it.

Thanks
Alan

Ok thanks for the inquiry. Let me see if I can get someone to help with this.

@mati-nvidia

Hi @iaito.mfsaban. Can you provide a bit more information? Are you using the latest Kit App Template for this work? GitHub - NVIDIA-Omniverse/kit-app-template: Omniverse Kit App Template

Hello @mati-nvidia,
I’m using the kit-extensione-template-cpp as base with kit 106.5. I’m trying to access the usdcontext to register a callback when a stage is open.
I’m using this to get the context:

include <omni/usd/UsdContext.h>

auto usdContext = omni::usd::UsdContext::getContext()

The problem is the usdcontext header includes some headers like the IUsdMutex.h and a couple of more headers that desn’t exists inside kit.
I’ve seen inside the omni.example.cpp.usd example that it uses python Iext and a binding to a cpp class. The python binding is accessing the context and register the callbacks passing the stageid to the cpp class. I think they doing this for the same missing header reason.
Do you know if this is a bug in your packaging system or if it was made on purpose?
Thanks
Alan

Hi @iaiotom. I’m checking in with the team. Is there a reason why you’re not using Kit App Template (KAT) instead. You can create C++ extensions within that project too.

Hi @mati-nvidia, It was simpler using the cpp templates as reference, but the premake and toml config I have it works on the kit app template as well. The problem it is in kit itself. I’ve checked also the kit package from the nvidia website instead of the one download from the template. Even there the headers are missing.
Thanks

If you are working outside of our recommended workflow, and not following the our procedure for building extensions, we cannot guarantee its compatibility with kit, or support it. We have a team of development engineers dedicated to making this process smooth and easy, using the guide we publish. You obviously are an advanced programmer. I would suggest you try to make your extension, the way we recommend and support.

Hello @Richard3D ,
It is not a problem of building workflow. It si a problem on your kit build. There are missing headers, so it is impossible to access the UsdContext ina cpp extension. If you want to try by yourself follot these steps. Download the kit app template. Create a new c++ extension, enable the compilation and try to add these includes.
include <omni/usd/UsdContextIncludes.h>
include <omni/usd/UsdContext.h>
Try to compile, and you’ll get missing headers. UsdContext.h try to include these two headers:
include <omni/usd/IUsdMutex.h>
include <omni/usd-abi/IPathAbi.h>
These headers don’t exist inside the kit include folder. I’ve checked the kit download by the kit app template and also the kit download directly from the Nvidia website.

Also, in the official doc, it mentions to access the usdcontext using that include
Overview — Omniverse Kit

Thanks
Alan