Happy New Year!
I've been re-reading this thread trying to remember where exactly we left things. I was able to build your code (with some very very small modifications and a custom build script), and get things loading in Houdini 20.
I added debug output in the constructors of the API Adapter and SI Plugin, as well as hacked a Scene Index tree dump into
GetPrim
where the entire hierarchy
should be in-place.
void __dumpSceneIndexTree(HdSceneIndexBaseConstRefPtr sceneIndex, int depth = 0)
{
std::cout << std::string(depth*2, ' ') << sceneIndex->GetDisplayName() << std::endl;
if (auto filteringIndex = TfDynamic_cast<HdFilteringSceneIndexBaseConstRefPtr>(sceneIndex))
for (auto &&inputIndex : filteringIndex->GetInputScenes())
dumpSceneIndexTree(inputIndex, depth + 1);
}
HdSceneIndexPrim HairProcHairProceduralSceneIndex::GetPrim(const SdfPath& primPath) const {
static bool __init = false;
if (!__init) { __dumpSceneIndexTree(TfCreateRefPtr(this)); __init = true; }
...
With all that done, and using
USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1
, when I switch to Solaris, I get:
HairProcHairProceduralSceneIndex CTOR
HairProcHairProceduralSceneIndex
HdMergingSceneIndex
HdNoticeBatchingSceneIndex
HdLegacyPrimSceneIndex
UsdImagingDrawModeSceneIndex
HdFlatteningSceneIndex
UsdImagingRenderSettingsFlatteningSceneIndex
UsdImagingSelectionSceneIndex
UsdImagingNiPrototypePropagatingSceneIndex
UsdImagingPiPrototypePropagatingSceneIndex
UsdImagingStageSceneIndex
This is good because it demonstrates your custom Scene Index is running, and we have the
UsdImagingStageSceneIndex
showing up.
Switching to Karma, I get:
HairProcHairProceduralSceneIndex CTOR
Sublayering in a test USD file:
#usda 1.0
(
framesPerSecond = 24
metersPerUnit = 1
timeCodesPerSecond = 24
)
def Sphere "sphere1" (
apiSchemas = ["HairProceduralAPI"]
)
{
float3[] extent = [(-1, -1, -1), (1, 1, 1)]
double radius = 1.0
}
I don't get any new output.
Then choosing "Restart Render" in the viewport, I get:
HairProcHairProceduralSceneIndex CTOR
HairProcHairProceduralAPIAdapter CTOR
GetImagingSubprimData called on /sphere1
GetImagingSubprimData called on /sphere1
GetImagingSubprimData called on /sphere1
GetImagingSubprimData called on /sphere1
Which shows the API Adapter constructed and working.
So the good news is that it
can work. The bad news is I don't yet know why for you it
doesn't work. But maybe you can follow what I did step-by-step and, if it suddenly works for you, identify the difference between this and your previous test/setup.