"Cannot invert matrix" error when bundling to iOS

I’ve gone back to update a project that was last released over a year go. The project builds fine on macOS and everything miraculously seems to still work!

When I’m trying to bundle on iOS, however, I get this to-the-point error:
Screenshot 2023-05-23 at 17.55.26

The error remains when bundling an empty project only containing the naughty files:
Cannot invert matrix.zip (12.4 KB)

Any idea what this could be? Would the .dae files need to be exported again in a different way (please, let it not be so!).

2 Likes

Hmm, sounds strange?
We’ll take a look!

2 Likes

I had the same problem with many models (but mainly .glb) when I was doing the horror game. I can provide the failing models tomorrow.

1 Like

Any update on this one?

1 Like

Not yet I’m afraid.
I’ll take a look at this tomorrow if I get the time.
(It’s in the top in my queue)

1 Like

Brilliant, thanks!

For the model itself (“scared.dae”) I fail to preview it in any of the online viewers, where did you get the model from, and have you verified that it works in another tool?

I can confirm that I get the same issue, and will look into how to make the loading fail a bit more graciously.

1 Like

In case it helps, here is a new minimal project with the actual models used in the game hooked up, with two animations alternating.

Things to note:

  • Everything works when building.
  • The idle.dae animation works when bundling.
  • The ui_celebration.dae has the matrix error when bundling.
  • When trying to preview the ui_celebration.dae in the editor, the matrix error shows.

Trying the first .dae viewer tool I found works fine and gives the same result for both animations:

Cannot invert matrix More models.zip (191.3 KB)

Ok, I guess there is only skeletal information in the .dae files then?
Perhaps that’s something that might go wrong, when there is nothing to actually draw.

Yeah, it’s just animation data in both idle.dae and ui_celebration.dae. Not sure why one of them works and the other doesn’t, they’re exported in the same way?

Yeah, I don’t have a guess either.
One thing I do know is that our Collada importer is old and not very functional.
It is the reason I did a push for us to support the .gltf format instead.
And goigng forward, we consider the Collada pipeline to be deprecated, and we won’t do any major feature upgrades to it. We of course don’t want it to behave like it currently does though, so I’ll continue looking into getting a better error message from it or fix the issue.

6 Likes

The problem is with two bones having invalid matrices.
I’ve added an error message for this now in bob.jar.
And, if we find one like that, we now replace it with the identity matrix.

2023-06-05 10:02:09 SEVERE  Found invalid local matrix in bone 'joint_hand_r_tip', replacing with identity matrix 
'joint_hand_r_tip' local matrix:
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 1.000000
2023-06-05 10:02:09 SEVERE  Found invalid local matrix in bone 'joint_hand_l_tip', replacing with identity matrix 
'joint_hand_l_tip' local matrix:
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 0.000000
  0.000000, 0.000000, 0.000000, 1.000000
7 Likes

Please give us any failing models (preferably gltf/glb, as we consider dae deprecated)

4 Likes

Hello, I am working with @totebo in this project.
Thanks @Mathias_Westerdahl for providing a more detailed error log.
In case it helps anyone in the future, the problem was caused because of two joints with scale set to 0,0,0.
Changing them to 1,1,1 and re-exporting (in Collada, for now) fixed it.

8 Likes