Noticing some weird results from my matrix math, hope there’s someone who can enlighten me.
here’s a quick rundown of what I observed:
-
create an actor in the world, let’s set its rotation as [-14.928097, 36.161085, 31.678081]
-
use the API and get the transform matrix, here I’m using the following code
actor = unreal.EditorLevelLibrary.get_selected_level_actors()[0]
xform = actor.get_actor_transform()
matrix = xform.to_matrix()
-
now use an external transformation matrix library, I’ve tried Maya’s openmaya api, transformations and transform3d to decompose the transform matrix and extract the rotation as euler angles
-
the result is [14.928097, -36.161085, 31.678081]
as you can see, x and y is flipped,
note: I’m using ‘sxyz’ as rotation order, which based on my search is the one to go, I also tried all 24 combinations and non of which returns the same as input, so I guess that rules out the rotation order issue.
if I use unreal API again, unreal.MathLibrary.matrix_get_rotator(matrix)
, the rotation matches the input.