Deprecation of pxr/usd/ndr

The pxr/usd/ndr library will be removed on release 25.08 in favor of pxr/usd/sdr. The 25.05 release will deprecate Ndr code and publish all target Sdr code. A comment will be posted to this thread when the dev branch is updated to contain all target Sdr code with deprecated Ndr code still present.

History & Intent

  • Ndr - “Node Definition Registry”
  • Sdr - “Shader Definition Registry”, subclasses Ndr

Ndr was conceived in 2018; its implementation targeted shaders as the primary use case and featured an abstract node definition registry as a generalizable foundation for this work.

Since then, within both Pixar-internal and external code bases, additional registry cases that considered using Ndr found a good fit directly in Sdr instead. UsdLux is a prime example. More canonical use cases include codesites in usdShade itself, usdMtlx, hdSt, filters, projections, light paint shaders, and other plugins. Sdr and the concept of “Shader” as contained in Sdr has evolved to represent any concept to be executed by a non-USD subsystem.

Most use cases of Sdr today require both a mix of Ndr and Sdr symbols and a deep understanding of how the different Ndr and Sdr pipeline components work together. After comparing Sdr usage with the relative lack of usage of different Ndr specializations, we decided to consolidate the two systems into Sdr. This will clarify overall usage, and help streamline adoption for time-tested applications.

Migration

Here are all the necessary changes to move your code over.

Files
Files in pxr/usd/ndr/* will have direct analogues in pxr/usd/sdr/* with filenames exactly preserved, with a few exceptions.

Deprecated files Target files
ndr/node.h sdr/shaderNode.h
ndr/property.h sdr/shaderProperty.h
ndr/nodeDiscoveryResult.h sdr/shaderNodeDiscoveryResult.h
ndr/* sdr/*

You may also need to add #include "pxr/usd/sdr/shaderProperty.h where needed.

Symbols
This category includes macros, functions, and types. Where meaningful, naming conventions are transformed from “Node” and “Property” to “Shader Node” and “Shader Property”, but we opted not to transform, for example, existing Sdr types like “SdrPropertyTypes->Int” to “SdrShaderPropertyTypes->Int”.

Deprecated symbols Target symbols
NDR_REGISTER_DISCOVERY_PLUGIN SDR_REGISTER_DISCOVERY_PLUGIN
NDR_REGISTER_PARSER_PLUGIN SDR_REGISTER_PARSER_PLUGIN
NdrFsHelpersDiscoverNodes SdrFsHelpersDiscoverShaderNodes
NdrDiscoveryPlugin::DiscoverNodes SdrDiscoveryPlugin::DiscoverShaderNodes
NdrParserPlugin::Parse SdrParserPlugin::ParseShaderNode
NdrParserPlugin::GetInvalidNode SdrParserPlugin:GetInvalidShaderNode
NdrNode::GetVersion SdrShaderNode::GetShaderVersion
NdrNode::GetInput SdrShaderNode::GetShaderInput
NdrNode::GetOutput SdrShaderNode::GetShaderOutput
NdrNode::GetInputNames SdrShaderNode::GetShaderInputNames
NdrNode::GetOutputNames SdrShaderNode::GetShaderOutputNames
NdrRegistry::GetNodeFromAsset SdrRegistry::GetShaderNodeFromAsset
NdrRegistry::GetNodeFromSourceCode SdrRegistry::GetShaderNodeFromSourceCode
NdrRegistry::GetNodeIdentifiers SdrRegistry::GetShaderNodeIdentifiers
NdrRegistry::GetNodeNames SdrRegistry::GetShaderNodeNodes
NdrRegistry::GetNodeByIdentifier SdrRegistry::GetShaderNodeByIdentifier
NdrRegistry::GetNodeByIdentifierAndType SdrRegistry::GetShaderNodeByIdentifierAndType
NdrRegistry::GetNodeByName SdrRegistry::GetShaderNodeByName
NdrRegistry::GetNodeByNameAndType SdrRegistry::GetShaderNodeByNameAndType
NdrRegistry::GetNodesByIdentifier SdrRegistry::GetShaderNodesByIdentifier
NdrRegistry::GetNodesByName SdrRegistry::GetShaderNodesByName
NdrRegistry::GetNodesByFamily SdrRegistry::GetShaderNodesByFamily
NdrRegistry::GetAllNodeSourceTypes SdrRegistry::GetAllShaderNodeSourceTypes
NdrSdfTypeIndicator::GetNdrType SdrSdfTypeIndicator::GetSdrType
NdrProperty* SdrShaderProperty*
NdrNode* SdrShaderNode*
Ndr* Sdr*

In the above tables, * indicates arbitrary substrings. For example, the above Ndr* -> Sdr* row indicates NdrVersion should be replaced with SdrVersion, NdrRegistry with SdrRegistry, and so on for other types and functions.

Environment variables
Any use of “NDR” environment variables should be updated to use the renamed “SDR” equivalents. See the source code for usage and documentation of these variables.

Deprecated env var Target env var
PXR_NDR_FS_PLUGIN_SEARCH_PATHS PXR_SDR_FS_PLUGIN_SEARCH_PATHS
PXR_NDR_FS_PLUGIN_ALLOWED_EXTS PXR_SDR_FS_PLUGIN_ALLOWED_EXTS
PXR_NDR_FS_PLUGIN_FOLLOW_SYMLINKS PXR_SDR_FS_PLUGIN_FOLLOW_SYMLINKS
PXR_NDR_SKIP_DISCOVERY_PLUGIN_DISCOVERY PXR_SDR_SKIP_DISCOVERY_PLUGIN_DISCOVERY
PXR_NDR_SKIP_PARSER_PLUGIN_DISCOVERY PXR_SDR_SKIP_PARSER_PLUGIN_DISCOVERY
PXR_NDR_DISABLE_PLUGINS PXR_SDR_DISABLE_PLUGINS

Thank you for your effort and understanding in working with our efforts to consolidate the code base and semantics. Let us know if you have any questions.