-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Track View: Major fix for GHI# 11500 #18538
Track View: Major fix for GHI# 11500 #18538
Conversation
moving node destruction down below node ptr usage Signed-off-by: Aleks Starykh <[email protected]>
also seems to fix serialization of the EditorSequenceAgentComponent Signed-off-by: Aleks Starykh <[email protected]>
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.
Good job, its crazy to think that this got broken for so long. When I did fixes in the ScriptCanvas logger and wasn't able to figure out the code, using breakpoints in Lumberyard helped a ton to understand what broke it/what would be the proper fix, might be worth doing that here as well
Gems/Maestro/Code/Source/Components/EditorSequenceComponent.cpp
Outdated
Show resolved
Hide resolved
Gems/Maestro/Code/Source/Components/EditorSequenceComponent.cpp
Outdated
Show resolved
Hide resolved
Move the TODO comment to the CUiAnimSequence::RemoveNode(). Signed-off-by: Aleks Starykh <[email protected]>
…dability Also revert to safer (minimal) fix for the bug generating ambiguous warning and disrupting a (level) prefab loading. The reverted change thoroughly commented with "TODO (AnimSequence linking)" rags Signed-off-by: Aleks Starykh <[email protected]>
A bit too much TODO code for my taste but given that without that the trackview is almost completely broken it make sense to bring the feature back, thanks for looking at it ! |
Gems/Maestro/Code/Source/Components/EditorSequenceComponent.cpp
Outdated
Show resolved
Hide resolved
…omments and code prototypes Signed-off-by: Aleks Starykh <[email protected]>
Gems/Maestro/Code/Source/Components/EditorSequenceAgentComponent.cpp
Outdated
Show resolved
Hide resolved
…he dirty list of undo / redo pipeline Signed-off-by: Aleks Starykh <[email protected]>
@lsemp3d : You have previously approved it, but I've re-requested your review after code changes. |
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.
I guess the alternative would have been to call RemoveDirtyEntity but not having it enter the undo stack and be captured in the first place really is preferable. The same API might be useful later for creating temporary visualization entities that must not be saved or persisted.
The problem is that calling |
Excellent work on this PR |
What does this PR do?
Closes #11500
Closes #17372
"Can't get component (type: EditorSequenceComponent, addr: ?) entity ID as it is not attached to an entity yet!"
in theComponent::GetEntityId()
generated in theEditorSequenceComponent::RemoveEntityToAnimate(()
while destroying an instance when sanitizing a prefab DOM;--
"The dirty entity has no owning instance."
in thePrefabPublicHandler::GenerateUndoNodesForEntityChangeAndUpdateCache()
generated while destroying an instance when sanitizing a prefab DOM;EditorSequenceComponent
: was called before the destructor of the linkedEditorSequenceAgentComponent
; note that order of entities / components destruction is randomized, - I believe this depends on randomly generated Entity Ids and Component Ids and hence their positions in hash-tables, - for example I have two seemingly same level prefabs, differing only in entity aliases and components, which are randomly generated, and one of these was misbehaving;EditorSequenceComponent::RemoveEntityToAnimate()
was called second time from undo chain and thus was calling theEditorSequenceAgentComponent::DisconnectSequence()
second time .CAnimAzEntityNode
containing theremovedEntityId
after calling theRemoveEntityToAnimate()
from the EditorSequenceComponent destructor, and thus disconnecting this sequence component with thatremovedEntityId
entity and destroying theEditorSequenceAgentComponent
, yet this could introduce misbehaviour in the governing code which neglects calling AddEntityToAnimate() / RemoveEntityToAnimate()EditorSequenceAgentComponent
destruction in theEditorSequenceAgentComponent::DisconnectSequence()
, as it this component is constructed not through the normal pipeline (designed for direct user actions evaluation). In order to temporary suppress undo / redo for this specific operation the commit 191e5cf :EditorSequenceAgentComponent
destruction in theEditorSequenceAgentComponent::DisconnectSequence()
.--
CAnimSequence::RemoveNode()
moving node destruction down below thenode
pointer usage.CAnimSequence::RemoveNode(IAnimNode* node)
code first destructed the object erasing avector
element with theintrusive_ptr<IAnimNode>
, and then attempted to use the now invalidnode
pointer;CUiAnimSequence::RemoveNode()
, changing and testing of which is out of scope for the current WIP.--
How was this PR tested?
Repro steps of the issue #11500 with the
Camera2
and theSeq
entities repeated (numerously) under Windows:a
TestLevel
with aCamera2
and aSeq
entities containing (correctly linkedEditorSequenceAgentComponent
andEditorSequenceComponent
respectively), - are now correctly saved an loaded.Detached sequence entities were never noted in this scenario.
What is not done yet?
TransformComponent
of a sequence entity, such prefab is still loaded wrongly;I believe fixing this would be helpful, as in most practical cases the AssetBuilder will rebuild a buggy
prefab
into a correctspawnable
- see PR Track View: Optional fix for GHI #11500: fix prefabs previously stored with invalid entity parents. #18548.Camera2
and aSeq
entities in a level:Seq
entity, because the cached in-memory DOM template is used, and this one is somehow asynchronously spoiled (theSeq
entity forgets the correct container entity alias in the "Parent Entity" statement).