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

MAYA-105389 - Displacement import #851

Merged
merged 2 commits into from
Oct 24, 2020

Conversation

JGamache-autodesk
Copy link
Collaborator

No description provided.

/// that should be considered for connections.
MAYAUSD_CORE_PUBLIC
virtual MPlug
GetMayaPlugForUsdAttrName(const TfToken& usdAttrName, const MObject& mayaObject) const;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Allows connection to a secondary object instead of the main one stored in the ReadContext.

@@ -433,48 +433,81 @@ class UseRegistryShadingModeImporter {
return MObject();
}

MPlug surfaceOutputPlug, volumeOutputPlug, displacementOutputPlug;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We now read all known inputs of the material, which is symmetric with what the exporter writes.

&status,
&_displacementShader);
// this displacement shader will get connected as we explore
// the displacement input of the UsdShadeMaterial.
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 material reader, which is responsible for backconverting from UsdPreviewSurface will now hold on to a displacementShader when there is an authored displacement input on the material.

Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

A few minor comments and suggestions, but otherwise this looks good to me.

I'm still a bit concerned about how much assumption of UsdPreviewSurface is getting baked into some of this translation, though I recognize that that will likely be the vast majority of use cases at least initially. I would bet though at some point we'll need a dedicated shader reader specifically for displacementShader Maya nodes for networks in USD where there's no UsdPreviewSurface involved?

lib/mayaUsd/fileio/shaderReader.h Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/shaderReader.h Outdated Show resolved Hide resolved
lib/mayaUsd/fileio/shading/shadingModeUseRegistry.cpp Outdated Show resolved Hide resolved
lib/usd/translators/shading/usdMaterialReader.h Outdated Show resolved Hide resolved
@JGamache-autodesk
Copy link
Collaborator Author

I tried to limit UsdPreviewSurface knowledge to usdMaterialReader.cpp, where it belongs. The support at the shaderReader level is more for any importer that has to deal with a 1-to-N situation, where a single UsdShade node expands to more than one Maya dependency node, and where connections to auxiliary nodes are expected. UsdPreviewSurface was just conveniently available as a demo node for this feature.

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Oct 23, 2020
@kxl-adsk kxl-adsk merged commit 1926448 into dev Oct 24, 2020
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-105389/displacement_import branch October 24, 2020 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export 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.

4 participants