Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new usdShade/material vector based API for USD versions beyond 21.05 #1394

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/mayaUsd/fileio/shading/shadingModeUseRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ class UseRegistryShadingModeImporter
// renderContext is not found. Therefore we need to test first that the
// render context output we are looking for really exists:
if (shadeMaterial.GetSurfaceOutput(renderContext)) {
#if PXR_VERSION > 2105
UsdShadeShader surfaceShader = shadeMaterial.ComputeSurfaceSource({ renderContext });
#else
UsdShadeShader surfaceShader = shadeMaterial.ComputeSurfaceSource(renderContext);
#endif
if (surfaceShader) {
const TfToken surfaceShaderPlugName = _context->GetSurfaceShaderPlugName();
if (!surfaceShaderPlugName.IsEmpty()) {
Expand All @@ -419,7 +423,11 @@ class UseRegistryShadingModeImporter
}

if (shadeMaterial.GetVolumeOutput(renderContext)) {
#if PXR_VERSION > 2105
UsdShadeShader volumeShader = shadeMaterial.ComputeVolumeSource({ renderContext });
#else
UsdShadeShader volumeShader = shadeMaterial.ComputeVolumeSource(renderContext);
#endif
if (volumeShader) {
const TfToken volumeShaderPlugName = _context->GetVolumeShaderPlugName();
if (!volumeShaderPlugName.IsEmpty()) {
Expand All @@ -429,8 +437,13 @@ class UseRegistryShadingModeImporter
}

if (shadeMaterial.GetDisplacementOutput(renderContext)) {
#if PXR_VERSION > 2105
UsdShadeShader displacementShader
= shadeMaterial.ComputeDisplacementSource({ renderContext });
#else
UsdShadeShader displacementShader
= shadeMaterial.ComputeDisplacementSource(renderContext);
#endif
if (displacementShader) {
const TfToken displacementShaderPlugName
= _context->GetDisplacementShaderPlugName();
Expand Down