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
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ See Pixar's official github page for instructions on how to build USD: https://g

| | ![](images/pxr.png) |
|:------------: |:---------------: |
| CommitID/Tags | release: [v20.02](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.02) or [v20.05](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.05) or [v20.08](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.08) or [v20.11](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.11) or [v21.02](https://github.com/PixarAnimationStudios/USD/releases/tag/v21.02) or [v21.05](https://github.com/PixarAnimationStudios/USD/releases/tag/v21.05)<br> dev: [090ef0d](https://github.com/PixarAnimationStudios/USD/commit/090ef0d849ced875b3b99a15e454b69148ccd8e1) |
| CommitID/Tags | release: [v20.02](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.02) or [v20.05](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.05) or [v20.08](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.08) or [v20.11](https://github.com/PixarAnimationStudios/USD/releases/tag/v20.11) or [v21.02](https://github.com/PixarAnimationStudios/USD/releases/tag/v21.02) or [v21.05](https://github.com/PixarAnimationStudios/USD/releases/tag/v21.05)<br> dev: [d9580db](https://github.com/PixarAnimationStudios/USD/commit/d9580dbec274cc9e6028646582153ca9844527ed) |

For additional information on building Pixar USD, see the ***Additional Build Instruction*** section below.

Expand Down
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