As far as I can tell, you cannot properly use PostEditComponentMove to get an event when the user stops dragging the gizmo handles in the Blueprint Editor on a scene component.
After a lot of debugging and digging, I’ve found that it only gets called on “TRASH_Component” instances that are flagged as RF_PendingKill. In this case, bFinished is true, and it gets called every frame while dragging the gizmo handles.
It does get called on the actual object (flagged RF_ArchetypeObject), but only with bFinished=false and this happens every frame while dragging. There is code that calls it with bFinished=true, but this exists in the intimidatingly named class FComponentElementLevelEditorViewportInteractionCustomization
, which seemingly only affects the level viewport, not the blueprint editor (SCS editor?) So this doesn’t help.
I’ve tried other methods, like PostEditChangeProperty, but this is not called when moving a component by dragging. TransformUpdated only seems to get called on any loaded instances in the level, not on the archetype object in the editor.
Perhaps the problem is my use case. I’m trying to keep track of the transform of a component before an extra transform is applied. This is for a system that composes rotations and translations by using the component hierarchy. The end-user should be able to configure a component’s “root” location, then at runtime supply a single position value per component to drive an extra transformation on top of that, without losing the information that the end-user configured.
My plan was to do this by saving the relative transform every time it’s changed in the blueprint editor in the form of a hidden property called EditorTransform. At runtime, the transform of the component is essentially DrivenTransform * EditorTransform
. I could just overwrite the relative transform of the component and require the user to add more scene components to get the offsets they need, but that’s clunky. Is there something I’m overlooking?