Hi,
I was experimenting with the ExampleCppHelloWorldExtension from kit app template
i tried to access the prim defined in the stage.
#include <omni/fabric/IFabric.h>
#include <usdrt/scenegraph/usd/usd/stage.h>
#include <usdrt/scenegraph/usd/usd/prim.h>
#include <usdrt/scenegraph/usd/sdf/path.h>
#include <omni/usd/UsdContextIncludes.h>
#include <omni/usd/UsdContext.h>
void onUpdate()
{
auto stage_id = omni::usd::UsdContext::getStageId();
usdrt::UsdStageRefPtr stage = usdrt::UsdStage::Attach(omni::fabric::UsdStageId(stage_id));
usdrt::UsdPrim prim = stage->GetPrimAtPath("/World/cube");
if (!prim)
{
printf("Prim is not in Fabric");
}
else
{
printf("Prim found");
}
}
However, i encounter the following error.
../../../_build/linux-x86_64/release/kit/dev/include/omni/usd/UsdContext.h:22:10: fatal error: omni/usd/IUsdMutex.h: No such file or directory
22 | #include <omni/usd/IUsdMutex.h>
I am using the kit-kernel 106.2.0+release.146576.9df8bbcd.gl.linux-x86_64.release.
I would imagine it to be somewhat like python
import omni.usd
stage = omni.usd.get_context().get_stage()
prim = stage.GetPrimAtPath("/World/cube")
- Is the omni.usd api not available yet?
- Do i have to use the pxr method instead?