Skip to content

EMSUSD-3188 - Move UsdShaderNodeDefHandler to UsdUfe.#4530

Open
frohnej-adsk wants to merge 2 commits intodevfrom
frohnej/EMSUSD-3188/moveNodeDefHandlerToUsdUfe
Open

EMSUSD-3188 - Move UsdShaderNodeDefHandler to UsdUfe.#4530
frohnej-adsk wants to merge 2 commits intodevfrom
frohnej/EMSUSD-3188/moveNodeDefHandlerToUsdUfe

Conversation

@frohnej-adsk
Copy link
Collaborator

No description provided.

@frohnej-adsk frohnej-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Mar 16, 2026
@frohnej-adsk frohnej-adsk self-assigned this Mar 16, 2026
Comment on lines -209 to -211
UsdShaderNodeDef.cpp
UsdShaderNodeDefHandler.cpp
UsdUndoCreateFromNodeDefCommand.cpp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to usdUfe.

}
}

SdrShaderNodePtrVec UsdMayaUtil::GetSurfaceShaderNodeDefs()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines -400 to -403
if (UsdUndoAddNewMaterialCommand::CompatiblePrim(parentItem)) {
return UsdUndoAddNewMaterialCommand::create(
parentItem, _shaderNodeDef->GetIdentifier());
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ufe-usd Related to UFE-USD plugin in Maya-Usd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant