Apply Transform problems in Blender 2.8

Hi There!

In Blender 2.8 when I execute apply transform to a hierarchy of objects (let’s say a Empty that a Cube as child), it leaves the child object in a wrong state.

Let’s say for example that I have a scene with OBEmpty->OBCube relation. Rotate 45 degrees OBEmpty and then execute Apply Transform → Rotation.

I have seen in the code that it reaches here: https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob/refs/heads/master:/source/blender/editors/object/object_transform.c#l470, where ob_child is the OBCube and ob is the OBEmpty.

After that code is executed, the ob_child->obmat is set ok (a rotation matrix) and ob_child->rot is also ok.

However, after applying the rotation, in the interface you can tell how the cube is shown without the rotation, although it says 45 in the rotation. Moreover, if you use python to get matrix_local, it returns an Identity matrix, where I think it should be a rotation matrix of 45 degrees. Also matrix_world is equal to Identity.

This screenshot is just after finishing the Apply Transform action:

Why matrix_local is not the same as ob->obmat that was set before?

Is there any place in the code I should look to fix this?

This was working ok in 2.79 BTW.

Thanks in advance!

Let me add a couple of screenshots to further explain the problem.

The first capture is just about ending ignore_parent_tx call. As you can see ob_child is the cube in the scene, its obmat has the right value.

The second capture is after calling bpy.context.object.matrix_local for the same OBCube object

Why the obmat of the same object now is the Identity?, Shouldn’t it be the same as in the first screenshot?