Exemple #1
0
/* static */
UsdRiMaterialAPI
UsdRiMaterialAPI::Get(const UsdStagePtr &stage, const SdfPath &path)
{
    if (!stage) {
        TF_CODING_ERROR("Invalid stage");
        return UsdRiMaterialAPI();
    }
    return UsdRiMaterialAPI(stage->GetPrimAtPath(path));
}
Exemple #2
0
/*static*/
SdfPath
UsdImaging_MaterialNetworkStrategy::GetBinding(UsdShadeMaterial const& material)
{
    TF_DEBUG(USDIMAGING_SHADERS).Msg("\t Look: %s\n", 
        material.GetPath().GetText());

    // ---------------------------------------------------------------------- //
    // Shading networks - riLook:bxdf
    // ---------------------------------------------------------------------- //
    if (UsdRelationship matRel = 
        UsdRiMaterialAPI(material).GetBxdfOutput().GetRel()) {

        TF_DEBUG(USDIMAGING_SHADERS).Msg("\t LookRel: %s\n", 
                    matRel.GetPath().GetText());
        return material.GetPath();
    }

    return SdfPath::EmptyPath();
}