The Transform Origin System in Sequencer seems like it is intending to not apply scale from the Transform Origin Actor to bound actors in the sequence. If that is a misunderstanding on my part, and scale is intended, you can stop reading here and let me know. My impression is based on the system only reading translation and rotation from bound actors, manipulating those, and then only writing translation and rotation back. Also, IMovieSceneTransformOrigin’s comments say “Scale is ignored” in multiple places.
However, in MovieSceneTransformOrigin.cpp, FAssignTransformOriginLocation::TransformLocation, you get the Origin’s transform (including scale) and multiply it by a transform composed of the rotation and translation of the actor it’s being applied to. Even though you’re dropping the bound actor’s scale first and not writing it back, multiplying FTransforms with Origin’s scale present affects the translation of the result. A comment in TTransform<T>::Multiply says “TranslateResult = B.Rotate(B.Scale * A.Translation) + B.Translate”.
The way this manifested for us was that it messed up translation on camera actors when the transform origin actor had a scale:
CurrentTranslation = {X=-92.738143920898438 Y=-361.77252197265625 Z=41.540908813476562}
CurrentRotation = {Pitch=6.2291831970214844 Yaw=73.229545593261719 Roll=-16.985168457031250 }
Origin = {Translation={X=0.0000000000000000 Y=0.0000000000000000 Z=500.00000000000000} Rotation={X=-0.0000000000000000 Y=0.0000000000000000 Z=-0.55919290347074690 W=0.82903757255504174} Scale3D={X=1.0000000000000000 Y=12.000000000000000 Z=1.0000000000000000}}
FTransform NewTransform = FTransform(CurrentRotation, CurrentTranslation)*Origin;
NewTransform = {Translation={X=-4059.8960169613861 Y=-1540.2831548259705 Z=541.54090881347656} Rotation={X=0.14976125147107652 Y=-0.046954041903245723 Z=0.053069311930213192 W=0.98617976740451274} Scale3D={X=1.0000000000000000 Y=12.000000000000000 Z=1.0000000000000000}}
When I added this line after the one that makes a copy of the Origin’s transform,
Origin.SetScale3D(FVector::OneVector);
it immediately fixed the camera problems. But there are implications to this, so I’d want someone who’s familiar with the system to confirm this is the intention, rather than the current behavior.
Another option would be to set the scale in the same way in FGatherTransformOrigin::Run after retrieving the transform from the IMovieSceneTransformOrigin and before storing it in TransformOriginsByInstanceID. I haven’t checked every insertion point to that array, but that code is where ours was coming from. Some of the others, like FGatherTransformOriginsFromSubscenes::ForEachAllocation, already drop the scale component.
If the bug is as clear as it seems from this example, I’d guess most users of the system use a dummy actor (like the ALevelSequenceActor itself), or a transform origin actor with no scale. We previously used the former, and I found this while attempting to use some different actors. Let me know if I can provide any more info. Thanks!
One more thing I remembered: when setting an arbitrary transform with the ALevelSequenceActor details customization, the tooltip says “Scale is ignored”, but that goes through the same code path I pointed out above. I’m not sure if there’s a detail customization for FTransform that leaves out the scale component, but that could be a good idea to use there. That shouldn’t be what fixes the bug, but might as well make the interface match if it’s possible.