Class VolumeProfileUtils
Utility functions for handling VolumeProfiles in the editor.
Inherited Members
Namespace: UnityEditor.Rendering
Assembly: Unity.RenderPipelines.Core.Editor.dll
Syntax
public static class VolumeProfileUtils
Methods
AddVolumeProfileContextMenuItems(ref GenericMenu, VolumeProfile, List<VolumeComponentEditor>, bool, string, Action<VolumeProfile>, Action, bool)
Adds context menu dropdown items for a Volume Profile.
Declaration
public static void AddVolumeProfileContextMenuItems(ref GenericMenu menu, VolumeProfile volumeProfile, List<VolumeComponentEditor> componentEditors, bool overrideStateOnReset, string defaultVolumeProfilePath, Action<VolumeProfile> onNewVolumeProfileCreated, Action onComponentEditorsExpandedCollapsed = null, bool canCreateNewProfile = true)
Parameters
| Type | Name | Description |
|---|---|---|
| GenericMenu | menu | Dropdown menu to add items to |
| VolumeProfile | volumeProfile | VolumeProfile associated with the context menu |
| List<VolumeComponentEditor> | componentEditors | List of VolumeComponentEditors associated with the profile |
| bool | overrideStateOnReset | Default override state for components when they are reset |
| string | defaultVolumeProfilePath | Default path for the new volume profile< |
| Action<VolumeProfile> | onNewVolumeProfileCreated | Callback when new volume profile has been created |
| Action | onComponentEditorsExpandedCollapsed | Callback when all editors are collapsed or expanded |
| bool | canCreateNewProfile | Whether it is allowed to create a new profile |
EnsureAllOverridesForDefaultProfile(VolumeProfile, VolumeProfile)
Ensure the provided VolumeProfile contains every VolumeComponent, they are active and overrideState for every VolumeParameter is true. Obsolete and hidden components are excluded.
Declaration
public static void EnsureAllOverridesForDefaultProfile(VolumeProfile profile, VolumeProfile defaultValueSource = null)
Parameters
| Type | Name | Description |
|---|---|---|
| VolumeProfile | profile | VolumeProfile to use. |
| VolumeProfile | defaultValueSource | An optional VolumeProfile asset containing default values to use for any components that are added to profile. |
OnVolumeProfileContextClick(Vector2, VolumeProfile, List<VolumeComponentEditor>, bool, string, Action<VolumeProfile>, Action)
Draws the context menu dropdown for a Volume Profile.
Declaration
public static void OnVolumeProfileContextClick(Vector2 position, VolumeProfile volumeProfile, List<VolumeComponentEditor> componentEditors, bool overrideStateOnReset, string defaultVolumeProfilePath, Action<VolumeProfile> onNewVolumeProfileCreated, Action onComponentEditorsExpandedCollapsed = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | position | Context menu position |
| VolumeProfile | volumeProfile | VolumeProfile associated with the context menu |
| List<VolumeComponentEditor> | componentEditors | List of VolumeComponentEditors associated with the profile |
| bool | overrideStateOnReset | Default override state for components when they are reset |
| string | defaultVolumeProfilePath | Default path for the new volume profile |
| Action<VolumeProfile> | onNewVolumeProfileCreated | Callback when new volume profile has been created |
| Action | onComponentEditorsExpandedCollapsed | Callback when all editors are collapsed or expanded |
UpdateGlobalDefaultVolumeProfileWithConfirmation<TRenderPipeline>(VolumeProfile, VolumeProfile)
Ensure the given profile contains overrides for every component compatible with the assigned render
pipeline, then, if TRenderPipeline is the active pipeline, push the profile to
the live VolumeManager. The profile asset is updated regardless of whether the pipeline
is active so the change is picked up on next pipeline initialization.
If components will be added to the profile, a confirmation dialog is displayed; cancelling leaves the
asset untouched.
Declaration
public static bool UpdateGlobalDefaultVolumeProfileWithConfirmation<TRenderPipeline>(VolumeProfile globalDefaultVolumeProfile, VolumeProfile defaultValueSource = null) where TRenderPipeline : RenderPipeline
Parameters
| Type | Name | Description |
|---|---|---|
| VolumeProfile | globalDefaultVolumeProfile | VolumeProfile asset assigned in pipeline global settings. |
| VolumeProfile | defaultValueSource | An optional VolumeProfile asset containing default values to use for any components that are added to globalDefaultVolumeProfile. |
Returns
| Type | Description |
|---|---|
| bool | Whether the operation was confirmed |
Type Parameters
| Name | Description |
|---|---|
| TRenderPipeline | The type of RenderPipeline that this VolumeProfile is used for. The live VolumeManager is only updated when this matches the active pipeline. |
UpdateGlobalDefaultVolumeProfile<TRenderPipeline>(VolumeProfile, VolumeProfile)
Ensure the given profile contains overrides for every component compatible with the currently active render pipeline, then push the profile to the live VolumeManager.
Declaration
public static void UpdateGlobalDefaultVolumeProfile<TRenderPipeline>(VolumeProfile globalDefaultVolumeProfile, VolumeProfile defaultValueSource = null) where TRenderPipeline : RenderPipeline
Parameters
| Type | Name | Description |
|---|---|---|
| VolumeProfile | globalDefaultVolumeProfile | VolumeProfile asset assigned in pipeline global settings. |
| VolumeProfile | defaultValueSource | An optional VolumeProfile asset containing default values to use for any components that are added to globalDefaultVolumeProfile. |
Type Parameters
| Name | Description |
|---|---|
| TRenderPipeline | The type of RenderPipeline that this VolumeProfile is used for. The live VolumeManager is only updated when this matches the active pipeline. |