-
Notifications
You must be signed in to change notification settings - Fork 855
RP Workflows - Adding the capability to revert a single override of a Volume Component #6129
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
Conversation
… volume component property
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP SRP Core Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
var o = parameter.GetObjectRef<MinFloatParameter>(); | ||
float v = EditorGUILayout.FloatField(title, value.floatValue); | ||
value.floatValue = Mathf.Max(v, o.min); | ||
EditorGUILayout.PropertyField(value, title); |
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.
Float fields do not implement the context menu, just property fields.
/// </example> | ||
[Serializable] | ||
#if UNITY_EDITOR | ||
public class VolumeComponent : ScriptableObject, IApplyRevertPropertyContextMenuItemProvider |
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.
Yeah, I think is nasty, but the interface is defined on editor, only for MonoBehaviours, I've not seen any other place where is being used, if you know a better way of doing this
Hey, could you check if this works with prefab instances & variants? I have some concerns because I checked how the the interface is used and it's invoked with this condition:
It's good to reuse existing code but if this interface doesn't work in all cases, you might need to modify trunk after all... |
@arttu-peltonen I've checked the Prefab, and the instances, it works as expected. |
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.
In that case, it should be fine. Tagging @RSlysz to be aware.
@JMargevics I think all parameters can be reset now :) |
All those fields work perfectly now ✔👍 Reposting my other issue for visibility: Lil1Bcv2oL.mp4Quality levels and underlying parameters should be connected when we revert them. |
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 perfect now 👍✔
Purpose of this PR
JIRA: https://jira.unity3d.com/browse/XPIPELINE-343
Adding a context menu "Revert Property Override" for Property Fields of Volume Components
Testing status
Check that the restore of the values works fine.
Check that the override is NOT restored, this should only be applied when Resetting the full Volume Component.
Comments to reviewers
I've used the system from
IApplyRevertPropertyContextMenuItemProvider
, unfortunatelly we could not replace the name of the context menu as this is generated from the "Revert + GetSourceTerm() + override". As this system is already working, and well tested, I think counterproductive to implement a new system just to remove the override, in this scenario makes sense and we won't need to touch trunk code for this PR.