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-794 : Support maya lighting modes for USD and dome lights #167

Merged
merged 7 commits into from
Sep 10, 2024

Conversation

lanierd-adsk
Copy link
Collaborator

All kinds of lights actually

@lanierd-adsk lanierd-adsk self-assigned this Sep 6, 2024
@lanierd-adsk
Copy link
Collaborator Author

FYI : @debloip-adsk @lilike-adsk

Copy link
Collaborator

@ppt-adsk ppt-adsk left a comment

Choose a reason for hiding this comment

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

Looks good, like the light management scene index, but a bit uncomfortable with the Arnold dome light special case. Can we make this more generic somehow?

@@ -32,7 +32,8 @@ def setUp(self):
# Open simple Maya scene
testFile = mayaUtils.openTestScene(
"testUsdTextureToggle",
"testUsdTextureToggle.ma")
"testUsdTextureToggle.ma", useTestSettings=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm unsure about this change. Is it to avoid

resetDefaultLightIntensity()

? If so, perhaps it would be better to keep useTestSettings as True, then set the default light intensity.

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 the intensity of lights doesn't match, I would rather keep it like that as it works fine.


void _DisableLight(HdSceneIndexPrim& prim)
{
//We don't set the intensity to 0 as for domelights this makes disappear the geometry
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this intensity behavior the same for all dome lights, or specific to the Arnold one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's for all dome lights as this is happening in Storm, when the dome light intensity is 0 it is removed, not only ignored.

Comment on lines 131 to 132
const Ufe::GlobalSelection::Ptr& globalUfeSelection = Ufe::GlobalSelection::get();
const Ufe::Selection& ufeSelection = *globalUfeSelection;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor and optional (depends on personal preference really): since you don't use globalUfeSelection again, may as well just do

Suggested change
const Ufe::GlobalSelection::Ptr& globalUfeSelection = Ufe::GlobalSelection::get();
const Ufe::Selection& ufeSelection = *globalUfeSelection;
const Ufe::Selection& ufeSelection = *Ufe::GlobalSelection::get();

case LightingMode::kSelectedLightsOnly: {
const Ufe::GlobalSelection::Ptr& globalUfeSelection = Ufe::GlobalSelection::get();
const Ufe::Selection& ufeSelection = *globalUfeSelection;
if (0 == ufeSelection.size()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor:

Suggested change
if (0 == ufeSelection.size()) {
if (ufeSelection.empty()) {

*
* @return true if the object is a sky dome light, false otherwise
*/
bool IsDagPathAnArnoldSkyDomeLight(const MDagPath& dagPath);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes me uncomfortable. Why are we treating Arnold lights in a special way, with a special conditional? Is there no way that our adapter infrastructure can handle this? What if another renderer has a different way of handling dome lights?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is specific to maya hydra, not specific to a renderer.

lib/mayaHydra/hydraExtensions/mayaUtils.cpp Outdated Show resolved Hide resolved
@lilike-adsk
Copy link
Collaborator

Good work, it would be better to manage the maya built-in lights by the new SceneIndex, lets track it in another ticket.

@lilike-adsk lilike-adsk merged commit 378f0f0 into dev Sep 10, 2024
10 checks passed
@lilike-adsk lilike-adsk deleted the lanierd/HYDRA-794 branch September 10, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants