AssertionError: has_mat() ?

I got a very strange error in a game we were working on, and I was curious what it meant.

The error was:

AssertionError: has_mat() at line 435 of c:\temp\mkpr\panda3d-1.0.5\built\include\transformState.I

Any ideas?

from NodePath:

I guess it returned false which threw the assertion error

You get this assertion failure when you try to access some operation on TransformState that assumes it has a valid 4x4 matrix, but in fact it doesn’t (i.e., it is an invalid transform).

There are lots of ways to get an invalid transform. The most common is to introduce a scale to 0 in the scene graph. A scale to 0 is not itself invalid, but its inverse is invalid (that would be akin to dividing by 0), so it means any relative operation on a node with a 0 scale will produce an invalid transform as a result.


1 Like

thanks david. You’re right, I had an object that I was going to scale up from 0, and it was in the scene.