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
Skip warning of missing entity referenced from sort order component #15827
Skip warning of missing entity referenced from sort order component #15827
Conversation
Signed-off-by: michabr <82236305+michabr@users.noreply.github.com>
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.
looks good:)
// to be added back to the parent's sort order array | ||
AZ::JsonEntityIdSerializer::JsonEntityIdMapper** idMapper = | ||
context.GetMetadata().Find<AZ::JsonEntityIdSerializer::JsonEntityIdMapper*>(); |
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.
// So when an entity is added/removed as a prefab override, two separate overrides are | ||
// generated, one referencing the child and one referencing the parent. | ||
// Reverting prefab overrides only affects one entity at a time, so reverting overrides on | ||
// a parent whose child was deleted as an override would cause the deleted child's entityId | ||
// to be added back to the parent's sort order array |
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.
nit: Instead of giving a very specific repro case here, it's better to keep it general since the warning was previously being sent anytime it can't resolve an entity id reference.
Something like "Since sort order component on an entity stores a vector of child entity ids in it, it's possible for the component to be left with stale entity ids when updates on child entities don't update the parent entity's sort order component. To reduce the noise in error log, we are allowing the component to have stale entity ids."
Signed-off-by: michabr <82236305+michabr@users.noreply.github.com>
What does this PR do?
Add an option to skip serialization warning when an entity reference does not match any registered entities. Skip these warnings when serializing the sort order component because undoing prefab overrides may leave stale entity Ids in the sort order array.
Fixes #15652
How was this PR tested?
Tested in Editor using repro steps in ticket.