-
Notifications
You must be signed in to change notification settings - Fork 4
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-1291 : Fix default maya material is not picked up correctly #201
Conversation
@@ -33,11 +33,7 @@ | |||
#include <pxr/usdImaging/usdImaging/tokens.h> | |||
|
|||
#include <maya/MAnimControl.h> | |||
#include <maya/MDGContext.h> |
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.
I did a bit of headers cleaning in this PR.
// create a fallback material | ||
bool defaultMaterialCreatedSuccessfully = false; | ||
|
||
MObject defaultMaterialShadingGroupObj = getDefaultMaterialShadingGroupNode(); |
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.
I recall there's already an Maya API (MMaterial::defaultMaterial()) to get the default Material, no need to query again. Just use MObject defaultMaterialShadingGroupObj = MMaterial::defaultMaterial().shadingEngine();
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.
here's the API doc:
https://help.autodesk.com/view/MAYAUL/2024/ENU/?guid=MAYA_API_REF_cpp_ref_class_m_material_html
static MMaterial defaultMaterial()
Get the default material.
There will always be a default material in the scene and therefore the result of this function should always succeed. The default material will correspond to the initialShadingGroup node that is in the scene.
#include <maya/MSelectionList.h> | ||
#include <maya/MObjectArray.h> | ||
#include <maya/MFnAttribute.h> |
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.
All that has been removed is not used any more
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.
nice cleanup
No description provided.