Hi All,
I’ve been experimenting with HdGpGenerativeProcedural and encountered a problem when trying to read textures coordinates from this mesh:
Input usd file:
def Xform "sopimport1" (
kind = "component"
)
{
def Mesh "mesh_0"
{
color3f[] primvars:displayColor = [(1, 0, 0)] (
interpolation = "constant"
)
float3[] extent = [(-5, 0, -5), (5, 0, 5)]
int[] faceVertexCounts = [4]
int[] faceVertexIndices = [0, 1, 3, 2]
normal3f[] normals = [(0, 1, 0), (0, 1, 0), (0, 1, 0), (0, 1, 0)] (
interpolation = "vertex"
)
uniform token orientation = "leftHanded"
point3f[] points = [(-5, 0, -5), (5, 0, -5), (-5, 0, 5), (5, 0, 5)] (
interpolation = "vertex"
)
texCoord2f[] primvars:st = [(0, 0), (1, 0), (1, 1), (0, 1)] (
interpolation = "faceVarying"
)
int[] primvars:st:indices = None
uniform token purpose = "proxy"
uniform token subdivisionScheme = "none"
}
code fragment to read what’s in the HdSceneIndexPrim:
void someFunction(const HdSceneIndexPrim& indexPrim) {
for (const auto& name: indexPrim.dataSource->GetNames()) {
fmt::print("[genproc] data source name:'{}'\n", name.GetString());
}
auto primvars = HdPrimvarsSchema::GetFromParent(indexPrim.dataSource);
const HdSampledDataSource::Time t {0.0f};
for(const auto& primvarName : primvars.GetPrimvarNames()) {
fmt::print("[genproc] primvar name:'{}'\n", primvarName.GetString());
}
}
Console Output:
[genproc] data source name:'mesh'
[genproc] data source name:'primvars'
[genproc] data source name:'extComputationPrimvars'
[genproc] data source name:'materialBindings'
[genproc] data source name:'displayStyle'
[genproc] data source name:'coordSysBinding'
[genproc] data source name:'purpose'
[genproc] data source name:'visibility'
[genproc] data source name:'categories'
[genproc] data source name:'xform'
[genproc] data source name:'extent'
[genproc] data source name:'instancedBy'
[genproc] data source name:'sceneDelegate'
[genproc] primvar name:'displayColor'
[genproc] primvar name:'points'
[genproc] primvar name:'normals
Also I should mention I’m triggering the code path by executing usdview which calls my HdGpGenerativeProcedural.
I would have expected to be able to read the st / uv coordinates using HdPrimvarsSchema. What am I missing?
Cheers
Don