Hello,
I noticed that the StateTreeEditorModule allows to register a specific UStateTreeEditorSchema to a UStateTreeSchema with :
RegisterEditorSchemaClass / UnregisterEditorSchemaClass. Unfortunately, those methods were not exposed for usage so I exposed them with UE_API in order to use them in my project.
This allows me to bind a specific editor schema to my runtime schema and add some specific validate/compile rules to my StateTrees. Unfortunately I noticed crash at boot of the editor if some SateTrees have already been created with my UStateTreeSchema but previously using the default UStateTreeEditorSchema.
In UStateTreeEditingSubsystem::ValidateStateTree, in the FixEditorSchema migration branch was trying to rename the previous editor schema with itself as outer: PreviousEditorSchema->Rename(…, PreviousEditorSchema, …). That can corrupt object path handling and leads to a serialization assert on my side. So I made the following fix :
Previously in \UE\Engine\Plugins\Runtime\StateTree\Source\StateTreeEditorModule\Private\StateTreeEditingSubsystem.cpp L.224 :
PreviousEditorSchema->Rename(*TrashName.ToString(), PreviousEditorSchema, RenameFlags);
I replaced with :
PreviousEditorSchema->Rename(*TrashName.ToString(), GetTransientPackage(), RenameFlags);
I don’t know why those methods were not exposed as RegisterEditorDataClass/ UnregisterEditorDataClass are well exposed and if it’s right crashfix but it fixed the issue on my side.
Thanks !