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-128594 - Imported displayOpacity are not interpreted correctly #3071

Merged
merged 4 commits into from
May 15, 2023

Conversation

samuelliu-adsk
Copy link
Collaborator

No description provided.

// data
if (colorSetRep == MFnMesh::kRGB) {
exportDisplayOpacity = true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be a pre-pass to detect this? The code as written seems to depends on the order of the color set?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. If we can export DisplayOpacity separately actually depends on the type of DisplayColor. If the display color is in RGBA format (which means it contains alpha, aka opacity, already), then we can't export the DisplayOpacity. However if the color is in RGB format (no alpha data), we can safely export the opacity, and this should be the only scenario we export DisplayOpacity

Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk May 10, 2023

Choose a reason for hiding this comment

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

Yes, but as I understand the code, the flag exportDisplayOpacity is set to true within the same loop where it is checked. So the behaviour depends on the order the color set names are encountered in this loop, which seems to me to be arbitrary?

In short, if the flags gets sets after DisplayOpacityColorSetName has already been processed, then it won't use the opacity even though the flag is now true.

That is why I suggested that the flag be set in a separate loop that would run before, so that it is certain to be set to the correct value when the opacity color set is encountered.

I may be wrong, if so I'd like to know where my reasoning is incorrect.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I see. Let me look into that

pierrebai-adsk
pierrebai-adsk previously approved these changes May 10, 2023
seando-adsk
seando-adsk previously approved these changes May 12, 2023
@seando-adsk seando-adsk added the import-export Related to Import and/or Export label May 12, 2023
@samuelliu-adsk samuelliu-adsk added the ready-for-merge Development process is finished, PR is ready for merge label May 12, 2023
@seando-adsk seando-adsk merged commit f1ab078 into dev May 15, 2023
@seando-adsk seando-adsk deleted the samuelliu-adsk/MAYA-128594/display-opacity-export branch May 15, 2023 18:46
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