Strange error while visualizing gui

When my program is running, since i added DirectGUI widgets, in the python console this error continues to appear :linmath(warning): Tried to invert singular LMatrix4..

Due to the lenght of my code i would find it hard to post here, but does anyone know what this error refers to?

I’m on windows 10.
The error is continuously shown (as if it was in a while loop) and completely fills the console, but only if you are on the window: if you hide to look at Visual Studio Code the error is no longer displayed. Based on the flow of the program this error is not causing any incovenience in run times, but it gets the console cluttered which is not ideal if you want to see other stuff.

A fairly common cause of that error, I think, is applying a scale of zero to a node (even if that zero is only in one component of the scale).

For example, the following should produce the error that you’ve observed:

from direct.showbase.ShowBase import ShowBase

from panda3d.core import CardMaker

class Game(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)

        cardMaker = CardMaker("mew")

        model1 = render.attachNewNode(cardMaker.generate())
        model1.setPos(0, 2, 0)
        model1.setScale(1, 0, 1)
        # NB! Note that the y-component of the scale is being
        #        set to zero above!


app = Game()
app.run()

(One tricky way in which this can occur is in animating a node’s scale: if the maths results in a scale of zero at some point, you may see the error pop up.)

2 Likes

ok, i was using 0 a scale value for some nodes, thanks!

1 Like