Commit Graph

100 Commits

Author SHA1 Message Date
Matt Peters
062f7507c1 Iterative Cooking - Invalidate packages for iterative cook if their classes are not allowed by class filters. This change uses the same system created for incremental cook and applies it to iterative cook.
Change class filtering to always use an allow list and a block list.
Change class filtering to enable allowlist all classes in a scriptpackage.
Move implementation of hybrid iterative's allow-all mode out into a separately parsed parameter.
Fix some Engine and UnrealEd classes that were not allowing EditorDomain to call Serialize on their class default object (which it needs to do to collect CustomVersions).
#rnx
#rb Zousar.Shaker

[CL 26102598 by Matt Peters in ue5-main branch]
2023-06-19 16:02:02 -04:00
helge mathee
90c2c328ea EditorTransaction: Catch objects being invalidated during applying a transaction
#rb halfdan.ingvarsson
#jira UE-186038

[CL 25838653 by helge mathee in ue5-main branch]
2023-06-07 04:11:36 -04:00
bart hawthorne
1057c6613a Do not track the garbage flag state in the object serialization for transactions, instead track in the transaction itself if the transaction deleted/restored an object. This prevents where situations where objects could be restored or deleted incompletely if they are gone for some reason without the user making the active change.
[CL 24454366 by bart hawthorne in ue5-main branch]
2023-02-28 18:22:44 -05:00
jamie dale
c01d9a355f Attempt to catch any reinstanced objects referenced by the transaction buffer
This now subscribes to FCoreUObjectDelegates::OnObjectsReinstanced directly instead of only relying on the ARO fix-up

#preflight 63d40cce5c69f453c1319b95
#rb Francis.Hurteau, Tom.Noonan
#rnx

[CL 23899830 by jamie dale in ue5-main branch]
2023-01-28 19:19:41 -05:00
jamie dale
0f0f702a36 [Backout] - CL23898871
[FYI] Jamie.Dale, Tom.Noonan
Original CL Desc
-----------------------------------------------------------------
Attempt to catch any reinstanced objects referenced by the transaction buffer

This now subscribes to FCoreUObjectDelegates::OnObjectsReinstanced directly instead of only relying on the ARO fix-up

#preflight 63d40cce5c69f453c1319b95
#rb Francis.Hurteau, Tom.Noonan
#rnx

[CL 23899452 by jamie dale in ue5-main branch]
2023-01-28 16:15:50 -05:00
jamie dale
4956e97248 Attempt to catch any reinstanced objects referenced by the transaction buffer
This now subscribes to FCoreUObjectDelegates::OnObjectsReinstanced directly instead of only relying on the ARO fix-up

#preflight 63d40cce5c69f453c1319b95
#rb Francis.Hurteau, Tom.Noonan
#rnx

[CL 23899045 by jamie dale in ue5-main branch]
2023-01-28 13:22:02 -05:00
jamie dale
103d565eba Prevent re-dirtying packages that have been marked clean by an undo/redo operation
#preflight 63d14a9e574ab9cae4b939ce
#rb Francis.Hurteau, Wouter.Burgers, Brooke.Hubert
#rnx

[CL 23863376 by jamie dale in ue5-main branch]
2023-01-25 20:41:35 -05:00
jamie dale
5cfd0d675b Fixing packages not being marked as dirty when undoing post-save
This was because the dirty state of the package was cached in the object transaction for the package, so if you undid back to a state where a package was previously clean, then the package would just get marked as clean again even if the in-memory state no longer matched the file on disk.

To avoid this we now "fence" the dirty state of a package on certain events (like save or delete) so we can tell if the dirty state cached in the transaction is still valid to re-apply, or if the package just needs to be marked dirty.

This also moved the save/restore of the dirty state out of the object transaction for the package and into the transaction itself, as the package object was only transacted when it became dirty, but we need each transaction to know the cached dirty state of any packages related to objects within the current transaction. This allows any undo re-evaluate the dirty state of a package, and not just an undo where the dirty state changed in the past.

#preflight 63937432bb6fefa472ed47c8
#rb Francis.Hurteau

[CL 23475320 by jamie dale in ue5-main branch]
2022-12-11 23:09:42 -05:00
jonathan bard
9e1279187c When 1 or more "undone" transactions are removed from the undo stack because a new transaction is started, we now restore said removed transactions when the newly-inserted transaction is removed because it's considered "transient" (i.e. it contains no record), similar to what happens in case of a cancelled transaction.
#rb jamie.dale, francis.hurteau
#jira UE-169502
#preflight 637d08a1815e4b9b7563bd70

[CL 23248896 by jonathan bard in ue5-main branch]
2022-11-23 09:22:24 -05:00
marco anastasi
5bb33d09a8 Automatic checkout and automatic undo on failed checkout
* Add an undo buffer barrier when the skein async checkout operation begins
* Add a delegate handler for skein checkout operation completion
* Make sure auto checkout is only active in UEFN and/or if skein is enabled
* Add UI control for turning on and off Auto-checkout/Auto-undo in Source control settings


#rb stuart.hill, brooke.hubert, zach.rammell
[FYI] wouter.burgers, manuel.lang

#preflight 637b5227f514e1ded97739a4

[CL 23220340 by marco anastasi in ue5-main branch]
2022-11-21 09:32:40 -05:00
jamie dale
c7b32efd00 Show additional object changes in the undo history
#rb Rex.Hill
#rnx

[CL 23104532 by jamie dale in ue5-main branch]
2022-11-11 15:55:31 -05:00
paul chipchase
5c74ae63c8 Add cpu profile tracing to undo/redo operations for UTransBuffer.
#rb Sebastian.Nordgren
#jira none
#rnx
#preflight 636ce125a550a2a75941f9c1

[CL 23076454 by paul chipchase in ue5-main branch]
2022-11-10 07:34:19 -05:00
jason walter
826598ef28 Allow minimal object snapshots
#jira none
#rb jamie.dale
#fyi jamie.dale
#preflight

#ushell-cherrypick of 22753261 by Jamie.Dale

[CL 22990909 by jason walter in ue5-main branch]
2022-11-04 13:47:11 -04:00
brooke hubert
19b9b7475d Add accessor for last undo barrier in the stack for code to query against.
# Added ability for the undo history window to add or remove undo barriers when not in PIE to facilitate testing the feature
# Fixed an issue where clearing the undo stack would result in the barriers remaining and preventing subsequent undo

#preflight 6362b7890c2e7c8f91aa7ccb
#rb [at]francis.hurteau

[CL 22937867 by brooke hubert in ue5-main branch]
2022-11-02 23:05:53 -04:00
dan oconnor
5ab6fcdb13 Fix crash when transactions reenter themselves - this happens due to FActorTransactionAnnotation/FComponentInstanceDataCache
#rb Jamie.Dale
#preflight 6345a91dfa31324bb1f5832e

[CL 22470588 by dan oconnor in ue5-main branch]
2022-10-11 20:57:22 -04:00
Tim Smith
d51b505a28 Fixed issue where undo/redo would crash after a change to the layout of a structure or class saved in an undo transaction.
#rb jaimie.dale
#jira UE-162686
#preflight 63110ca78c4883d43e2b0645

[CL 21746239 by Tim Smith in ue5-main branch]
2022-09-01 15:52:59 -04:00
jamie dale
903191eb85 Ensure that transaction diffing handles newly created objects consistently
In this context "newly created" means both created via NewObject but also objects that go from a dead->alive state via an undo/redo operation. Previously the latter would have produced a partial (usually empty) diff for the new object state, which put the burden of correctness on higher-level systems that were listening for changes.

Annotation diffing changed the rules about how objects might have been serialized for diffing (eg, managed components only diff some properties), so higher-level systems that are doing their own archetype diffing are now producing poor/incorrect results.

This change puts that burden onto the transaction record to handle correctly, as it is the only thing that accurately knows how to do so.

#rb Rex.Hill, Francis.Hurteau, Jason.Walter

[CL 21724446 by jamie dale in ue5-main branch]
2022-08-31 13:50:49 -04:00
robomerge
2c246d6859 Added support for diffing objects managed by a transaction annotation
ITransactionObjectAnnotation has two new functions; SupportsAdditionalObjectChanges to state whether the annotation type supports object diffing (default false), and ComputeAdditionalObjectChanges to actually compute the diff against another annotation (which must be of the same type).

This allows transaction annotations that entirely manage other objects (such as FActorTransactionAnnotation which manages the SCS and UCS components on an actor) to produce meaningful change information that can be passed to the PostTransacted function of the managed object (tagged with ETransactionObjectChangeCreatedBy::TransactionAnnotation).

Note: It is not safe to cache the result of a ComputeAdditionalObjectChanges outside of the current transaction, as objects managed by a transaction annotation can have volatile names. This means that the transaction annotation itself will have ComputeAdditionalObjectChanges called on it during undo/redo as well as during transaction snapshot/finalization, and means that the transaction annotation must have its own way of pairing old->new objects over time.

#preflight 63062421516bef57ffe8bafe
#rb Rex.Hill, Bart.Hawthorne, Francis.Hurteau, Jason.Walter

[CL 21572764 by robomerge in ue5-main branch]
2022-08-25 17:10:33 -04:00
jamie dale
16302d0ff5 Allow transaction object diff generation to skip properties via a callback
#preflight 6304eb4fc00af5e294287064
[FYI] Francis.Hurteau
#rnx

[CL 21525585 by jamie dale in ue5-main branch]
2022-08-23 19:33:06 -04:00
jamie dale
3af108a196 Keep a combined list of all properties that have been requested to snapshot during a given object record
This means that snapshotting A and then B will correctly produce a diff for A and B, rather than flipping between having data for A and having data for B

#jira
#preflight skip
#rb Elliot.Colp
#rnx

[CL 21467821 by jamie dale in ue5-main branch]
2022-08-19 19:22:44 -04:00
jamie dale
4b00c93b7c Updated TransactionCommon types to no longer be USTRUCT
This was done as we were potentially going to serialize them as part of transaction annotations, but that is no longer the case, plus the diff snapshots are now 100% non-portable.

#preflight 62f658b1bd746abb99bbd818
[FYI] Francis.Hurteau
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21355836 via CL 21358393 via CL 21358464 via CL 21358472
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21359941 by jamie dale in ue5-main branch]
2022-08-12 14:41:47 -04:00
jamie dale
c81b89af72 Fixed false positives in transaction diffing caused by name/object index re-ordering
Serialized name/object data would write the index of the name/object entry in the table, however there was no guarantee that this table order was reliable between diff snapshots (eg, adding a new name part way through an object would invalidate all subsequent references, even if they were still using the same name).

This change updates the diff writer to no longer attempt to strip out the name/object data into shared tables (which was/is an optimization for serialized objects kept within the transaction buffer), and instead write the global name index and raw object pointer instead.

Note: This change means that a diffable object snapshot is no longer portable to other instances of the editor.

#preflight 62f595561e61d1ba0e56d6ab
#rb Francis.Hurteau
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21353310 via CL 21354022 via CL 21354024 via CL 21354027
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21354819 by jamie dale in ue5-main branch]
2022-08-12 10:25:51 -04:00
jamie dale
adcdc1f0de Fixed transactions being incorrectly discarded due to the diffable object having no changes
We can no longer use the DeltaChange for this as Ar.IsTransacting() may have added extra data in the transacted object that is important for undo/redo, but not for delta change detection. This can result in an empty delta for a change that still needs to be kept for undo/redo (eg, changes to transient object data).

#jira UE-160728
#preflight 62f5152223003b62a3679f50
#rb Francis.Hurteau
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21341769 via CL 21341790 via CL 21342129 via CL 21342203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21343942 by jamie dale in ue5-main branch]
2022-08-11 16:18:48 -04:00
jamie dale
192a1f6750 Adding additional includes in preparation for removing a global include
#preflight skip
#rb none
#rnx

#ROBOMERGE-OWNER: jamie.dale
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21284217 via CL 21286253 via CL 21286261 via CL 21286270
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21291539 by jamie dale in ue5-main branch]
2022-08-09 12:57:07 -04:00
jamie dale
5706d71a33 Split the data used for the general transaction object away from the data used to diff a transacted object
This allows us more control over what goes into the diff object (eg, skipping all the internal state that Ar.IsTransacting adds), as well as allowing us to always use non-tagged property serialization (as we never need to load the diff object data back into a BP that has changed layout).

The downside of this approach is that each transacted object now needs to be serialized twice during the start and end of a transaction; once to get the object state for the transaction buffer, and once to get the object state to diff. The second set of diff data is discarded once the transaction has finalized, and any transaction snapshots still only need to serialize once (as snapshots only perform a diff).

API changes:
    * Split the object info out of FTransactionSerializedObject and into FTransactionSerializedObjectInfo so that it can be re-used. This data is only really needed for a diff, but the transaction buffer also need to persist a copy for notifications.
    * Split the diff only data out of FTransactionSerializedObject and into FTransactionDiffableObject.
    * Split the diff serialization logic out of FSerializedObjectDataWriter and into FDiffableObjectDataWriter.
    * Updated various diff APIs to work on FTransactionDiffableObject.
    * Updated FObjectRecord to store FTransactionDiffableObject instances for the initial and snapshot diffable object state.

#preflight 62d5db9199514be7eb7cf04c
#rb Francis.Hurteau
#rnx

#ROBOMERGE-OWNER: jamie.dale
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 21183943 via CL 21183948 via CL 21186529 via CL 21186547 via CL 21186567
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21194110 by jamie dale in ue5-main branch]
2022-07-20 18:56:55 -04:00