Note: This is disabled by default, but can be enabled by setting the "TypedElements.EnableFoliageInstanceElements" CVar to "1" (alongside setting "TypedElements.EnableSMInstanceElements" to "1").
Notable changes:
- AInstancedFoliageActor now implements ISMInstanceManager, and provides an implementation that works for ISMC foliage instances.
- ISMActor foliage is not yet supported, but also not currently used.
- ISMInstanceManager now has functions for NotifySMInstanceMovementX and NotifySMInstanceSelectionChanged, which are called from the SMInstance typed element implementation.
- USMInstanceElementDetailsProxyObject now calls the NotifySMInstanceMovementX functions for transform edits.
- FFoliageStaticMesh::Reapply now re-uses existing instances where possible, to avoid invalidating mapped FSMInstanceElementId values.
- FFoliageInfo now keeps track of all moving instances, rather than if any instances are currently moving.
- Various FFoliageInfo/FFoliageImpl functions now take their indices via TArrayView rather than TArray.
- UEngineElementsLibrary now has public functions for ReplaceEditorXElementHandles, which exposes the previously private re-instancing logic used by UEngineElementsLibrary::OnObjectsReplaced.
- This allows static mesh instance elements to be re-instanced if needed (eg, if moving them to an ISMC in a different world partition).
#rb Brooke.Hubert
#preflight 60b835ef6073fb00015e3cd1
[CL 16552742 by Jamie Dale in ue5-main branch]
#rb Per.Larsson
#rnx
* VirtualizationManager
- Add method ::IsEnabled which allows the caller to poll if content virtualization is enabled or not.
- Add method ::GetPayloadActivityInfo to return profiling data
- Added a new Profiling namespace containing all of the profiling code.
-- The idea is to try and keep all profiling data contained in the virtualization manager and not require the backends to be aware of it.
- The actual pull/push operations have been moved to new private methods ::TryPushDataToBackend and ::PullDataFromBackend, by limiting the scolpe of where the actual operation occur makes it easier to add the profiling code.
- We use the cooking stats system for recording our profiling data. Currently this adds no real value and we could've implemented our own but longer term this code might get hooked into FCookStatsManager:: CookStatsCallbacks to add it to our telemetry systems and this will be easier to do if it is already in the cooking stats formats.
* SVirtualizationStaticIndicator
- The widget is based on SDDCStatusIndicator for the DDC and is placed just before it in the UI.
- The widget will only be shown if the content virtualization system is enabled, so functions as an easy way to check that (maybe in the future it can be on all the time in which case we'd need the widget to reflect when the systems are disabled)
- Currently shows a green down arrow when a payload has been pulled and a green up arrow when a payload has been pushed.
- The tool tip shown on mouse over will show the total data sizes pulled and pushed from the backends.
#preflight 60b87c34ae46a100017d5334
[CL 16544645 by paul chipchase in ue5-main branch]
The editor viewport would previously skip the GizmoManipulationStopped call if nothing had actually moved, but this causes an imbalance in the APIs which call NotifyMovementStarted and NotifyMovementEnded.
GizmoManipulationStopped is now always called, but with an extra argument saying if anything actually moved.
#rb Brooke.Hubert
#preflight 60aeb2de1db8a70001cbe077
[CL 16537833 by Jamie Dale in ue5-main branch]
The button bar of the sub-object instance editor would always be visible, even if there was no valid actor context to operate on. This changes it to only appear for actor contexts (ie, we can't add components to static mesh instance elements).
#fyi Brooke.Hubert, Ben.Hoffman
[CL 16526044 by Jamie Dale in ue5-main branch]
The static mesh instance (SMInstance) element type used to directly edit the data on the ISM component, which can cause issues if the ISM component is owned by an actor that has additional bookkeeping data.
To solve this there is now an extra level of indirection that the actor owning a component can use to customize the default per-instance editing behavior, or even to disable per-instance editing entirely:
- FSMInstanceManager is a handle that replaces direct use of FSMInstanceId within the SMInstance element implementation, and promotes performing actions via the instance manager interface rather than on the ISM component directly.
- ISMInstanceManager is an interface that actors owning an ISM component can implement in order to customize the default SMInstance editing behavior. The ISM component also implements this interface for the cases where it manages itself.
- ISMInstanceManagerProvider is an interface that actors owning an ISM component can implement to either redirect the request to get the instance manager instance, or to disable per-instance editing entirely by returning a null instance manager instance.
The instance manager instance used is resolved from the ISM component using the following logic:
- If the owner actor implements the ISMInstanceManagerProvider interface, then that API is used to provide the instance manager. No further fallback happens, and a null instance manager instance will disable per-instance editing.
- If the owner actor implements the ISMInstanceManager interface, then the owner actor is used as the instance manager.
- Otherwise the ISM component is used as the instance manager.
ALightWeightInstanceStaticMeshManager provides an example of using ISMInstanceManager to keep extra bookkeeping data up-to-date, and AISMPartitionActor provides an example of using ISMInstanceManagerProvider to disable per-instance editing.
AISMPartitionActor will be updated to correctly support SMInstance editing in a future change, by forwarding the request on to the client that owns the respective instance.
#rb Brooke.Hubert, Fred.Kimberley
#preflight 60a56a7c7370d300015f23fb
[CL 16422692 by Jamie Dale in ue5-main branch]
The sub-object instance editor would warn that the given context wasn't an actor, so this limits it back to only actor contexts (like how the SCS editor used to work)
#fyi Brooke.Hubert, Ben.Hoffman
[CL 16413105 by Jamie Dale in ue5-main branch]