EMSUSD-3188 - Move UsdShaderNodeDefHandler to UsdUfe.#4530
EMSUSD-3188 - Move UsdShaderNodeDefHandler to UsdUfe.#4530frohnej-adsk wants to merge 2 commits intodevfrom
Conversation
| UsdShaderNodeDef.cpp | ||
| UsdShaderNodeDefHandler.cpp | ||
| UsdUndoCreateFromNodeDefCommand.cpp |
There was a problem hiding this comment.
Moved to usdUfe.
| } | ||
| } | ||
|
|
||
| SdrShaderNodePtrVec UsdMayaUtil::GetSurfaceShaderNodeDefs() |
There was a problem hiding this comment.
Moved to usdUfe/ufe/Utils.cpp as it's required by UsdShaderNodeDef.
UsdShaderNodeDef::definitions() either returns all node definitions or a filtered list containing only surface shaders. It uses this function to filter the surface shaders.
| if (UsdUndoAddNewMaterialCommand::CompatiblePrim(parentItem)) { | ||
| return UsdUndoAddNewMaterialCommand::create( | ||
| parentItem, _shaderNodeDef->GetIdentifier()); | ||
| } |
There was a problem hiding this comment.
This was a hack introduced in #3008 allowing LookdevX to create new materials more easily. This can now be done using LookdevXUsd::UsdLookdevHandler::createLookdevContainerCmdImpl(), so the hack is not used or needed anymore.
| self.assertIsNotNone(connections) | ||
| self.assertEqual(len(connections.allConnections()), 0) | ||
|
|
||
| # Construct a surface shader node at the mtl scope |
There was a problem hiding this comment.
This was testing the hack introduced in #3008. Since the hack is not needed anymore, these ShaderNodeDef tests can be removed.
However, this covered MayaUsd::ufe::UsdUndoAddNewMaterialCommand which is also used in other places and accessible through the MayaUsdAPI.
The surfaceshader case is already covered by testContextOps.py. I moved the non-surfaceshader case there to keep it covered as well.
No description provided.