RP Workflows - Adding the capability to revert a single override of a Volume Component#6129
Conversation
… volume component property
| 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.
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.
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. |
arttu-peltonen
left a comment
There was a problem hiding this comment.
In that case, it should be fine. Tagging @RSlysz to be aware.
|
@JMargevics I think all parameters can be reset 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.