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

Inspector : fallbackValue improvements #5968

Conversation

murraystevenson
Copy link
Contributor

This addresses some of the todos discussed recently in #5964. It made sense to tackle them now as further simplifying the Light Editor's MuteColumn and SetMembershipColumn makes the upcoming InspectorColumn refactor a little more straightforward, plus we gain some user-facing improvements out of these changes.

The AttributeInspector now supports global attributes as fallback values when no inherited attribute is found, with a further fallback to defaultValue metadata registered to attribute:{attributeName} in order to display default values for non-existent attributes. This metadata follows the option:{optionName} convention already established in the OptionInspector for options and their default values.

Inspector::fallbackValue now has an output string &description parameter which can be used to describe to the user the source of the fallback value, accessible via Inspector::Result::fallbackDescription().

These improvements allow us to simplify MuteColumn and SetMembershipColumn down to configuring icons and overriding CellData::value so only the icon is displayed. We're fairly close now to removing them entirely...

@murraystevenson murraystevenson self-assigned this Jul 23, 2024
Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Thanks Murray! This is all coming together quite nicely - looking forward to the further refactoring you've got going on too. I've made a few comments inline, but they're all pretty trivial...

include/GafferSceneUI/Private/Inspector.h Outdated Show resolved Hide resolved
include/GafferSceneUI/Private/Inspector.h Outdated Show resolved Hide resolved
include/GafferSceneUI/Private/Inspector.h Outdated Show resolved Hide resolved
src/GafferSceneUI/AttributeInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/AttributeInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/AttributeInspector.cpp Outdated Show resolved Hide resolved
include/GafferSceneUI/Private/Inspector.h Outdated Show resolved Hide resolved
src/GafferSceneUI/SetMembershipInspector.cpp Outdated Show resolved Hide resolved
startup/GafferScene/standardAttributes.py Outdated Show resolved Hide resolved
@@ -4,7 +4,9 @@
Improvements
------------

- LightEditor : Values of inherited attributes are now displayed in the Light Editor. These are presented as dimmed "fallback" values.
- LightEditor :
- Values of inherited attributes are now displayed in the Light Editor. These are presented as dimmed "fallback" values. Values are inherited from an ancestor of the inspected location or from attributes created in the scene globals.
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth mentioning the tooltip here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! I've mentioned the tooltip in 8c5812a.

@murraystevenson
Copy link
Contributor Author

Thanks for the feedback! Everything should be addressed inline.

Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Thanks Murray! Fixups all look good, but I've made a couple of additional comments now. Feel free to squash everything ready for merging as you address them though...

src/GafferSceneUI/SetMembershipInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/SetMembershipInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/SetMembershipInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/AttributeInspector.cpp Outdated Show resolved Hide resolved
src/GafferSceneUI/AttributeInspector.cpp Show resolved Hide resolved
When no inherited attribute exists, fall back to the equivalent attribute in the scene globals, with "defaultValue" metadata used to provide the default value of non-existent attributes - equivalent to how we handle default values of non-existent options in the OptionInspector.
This is not a complete registration of the attributes creatable by OpenGLAttributes, but the subset of attributes registered by default in the Light Editor.
As fallback values could originate from various sources, we provide an output `&description` parameter to `fallbackValue()` to provide a user-facing description of the source of the fallback.
We can now remove the inheritance lookup from MuteColumn and SetMembership column as the inspectors now provide this information via the fallbackDescription.
This is not a complete registration of the attributes creatable by StandardAttributes, but the subset of attributes registered by default in the Light Editor.
With `defaultValue` metadata registered for the `light:mute` attribute, InspectorColumn can now consistently include the toggle info in the tooltip so we no longer require this additional handling.
@johnhaddon johnhaddon merged commit ef19096 into GafferHQ:1.4_maintenance Jul 25, 2024
5 checks passed
@johnhaddon
Copy link
Member

Thanks Murray!

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.

2 participants