-
Notifications
You must be signed in to change notification settings - Fork 202
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
Conversation
/// that should be considered for connections. | ||
MAYAUSD_CORE_PUBLIC | ||
virtual MPlug | ||
GetMayaPlugForUsdAttrName(const TfToken& usdAttrName, const MObject& mayaObject) const; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
test/lib/usd/translators/UsdImportDisplacementTest/SimpleDisplacement.usda
Show resolved
Hide resolved
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. |
No description provided.