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

HYDRA-833 - Maya MaterialX material bindings on Maya geometry #72

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

vlasovi
Copy link
Collaborator

@vlasovi vlasovi commented Feb 14, 2024

  • Support MaterialX on Maya native prims
  • Autotest

@vlasovi vlasovi requested a review from lilike-adsk February 14, 2024 16:50
@vlasovi
Copy link
Collaborator Author

vlasovi commented Feb 14, 2024

@vlasovi vlasovi self-assigned this Feb 14, 2024
mayaUtils.openTestScene("testMaterialX", "RedMtlxSphere.ma")
self.setBasicCam(2)
self.setHdStormRenderer()
self.verifySnapshot("RedMtlxSphere.png")
Copy link
Collaborator

Choose a reason for hiding this comment

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

are we missing to pass IMAGEDIFF_FAIL_THRESHOLD and IMAGEDIFF_FAIL_PERCENT here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, they are passed from inside verifySnapshot method

Copy link
Collaborator

Choose a reason for hiding this comment

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

right, sorry, I missed that. :)

VtValue GetMaterialResource() override
{
TF_DEBUG(MAYAHYDRALIB_ADAPTER_MATERIALS)
.Msg("MayaHydraShadingEngineAdapter::GetMaterialResource(): %s\n", GetID().GetText());

HdMaterialNetworkMap materialXNetworkMap;
if (PopulateMaterialXNetworkMap(materialXNetworkMap)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any reason not to do the translation inside MayaHydraMaterialNetworkConverter? I feel it's better to move the code into MayaHydraMaterialNetworkConverter as MatX is also one kind of Material.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The interface of MayaHydraMaterialNetworkConverter seems to be developped specifically for UsdPreviewSurface network. I think we would have hard times adapting and rewriting it for the needs of MaterialX. For example method HdMaterialNode* GetMaterial would need to change its output type as well as all other public methods have no meaning for MaterialX (like GetPreviewShaderParams). I don't see any reason for readapting MayaHydraMaterialNetworkConverter for MaterialX

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok, sounds like having a base materialConverter and diferent sub materialConverters would make the architecture looks better, as the actual conversion is the responsibility of materialConverter, not materialAdapter.

I'm fine with the current code, just trying to make it easier to maintain, we could also refactor it later when we need more materialConverters in the future.

@lilike-adsk lilike-adsk self-requested a review February 14, 2024 18:45
@vlasovi vlasovi added the ready-for-merge Development process is finished, PR is ready for merge label Feb 15, 2024
@lilike-adsk lilike-adsk merged commit 09b18f9 into dev Feb 15, 2024
10 checks passed
@lilike-adsk lilike-adsk deleted the vlasovi/HYDRA-833 branch February 15, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants