python script error: ZERO DEVISION ERROR:Can't Invert Matrix help

I have a problem importing a .nif file into Blender. It loads for a few seconds and then displays a python script error. I’ve been using Blender for about 5 years and never seen this error before. At the bottom it says "ZeroDevisionError: CantInvertMatrix. Any help solving this problem will be much appreciated. Thanks
Blender 2.49b
Python ver 2.6.2

Here’s what is displayed in the Console:

if there is a div / 0 then the matrix does not have independant variables may be and is not valid to do an inverse!

but can you copy text from console and show it cause we cannot realy read it in pic


If you click on the picture a couple of times it zooms it in, at least for me. I’ll post the last few lines:

File “C\Python 26\lib\site-packages\pyffi\formats”, line 3729,
in gets_inverse
raise ZerodivisionError<‘cannot invert matrix:
ZeroDivisionError: cannot invert matrix:
[ 0.000 0.000 -0.022 0.000 ]
[ 0.022 -0.000 0.000 0.000 ]
[ -0.000 -0.022 -0.003 0.000 ]
[ -54.466 -0.919 6.531 1.000 ]

i redid your matrix invert and seems to work fine

here are results

Matrix newMat1= <Matrix 4x4 ( 0.0000, 0.0000, -0.0220, 0.0000)
( 0.0220, -0.0000, 0.0000, 0.0000)
( -0.0000, -0.0220, -0.0030, 0.0000)
(-54.4660, -0.9190, 6.5310, 1.0000)

Determinant = 1.0647999260982033e-05

Invert Matrix =

Matrix 4x4

( 0.0000, 45.4545, 0.0000, -0.0000)
( 6.1983, -0.0000, -45.4545, 0.0000)
(-45.4545, -0.0000, 0.0000, -0.0000)
(302.5599, 2475.7273, -41.7727, 1.0000)

did you use the latest SVN API ?

happy bl

I apologize, but I’m not an advanced user on Blender and am afraid I don’t completely understand the information you’re giving me and what I’m suppose to do with it. I’ve been using Blender for a while now but only for basic mesh editing and have never needed information like this until now. I’ve been on the Blender wiki and have briefly read up on Mathutils, SVN and Python API, but am afraid I don’t know how all that works. If you could briefly explain how I can resolve this or direct me toward a tutorial so I can learn it myself that would be great. Also, I use Blender version 2.49b and Python 2.6.2; would there be any incompatibility issues I might run into? Thanks for your help.

you should use the latest SVN which is now 2.68 - 2.69 comes out in a few weeks!
this is the only version being maintained and debug right now

import bpy
import mathutils
import mathutils.geometry
from mathutils.geometry import *
from math import *
newMat1 = mathutils.Matrix(((0.000, 0.000, -0.022, 0.000),
 (0.022, -0.000, 0.000, 0.000),
 (-0.000, -0.022, -0.003, 0.000) ,
 (-54.466, -0.919, 6.531, 1.000)))
print ('Matrix newMat1= ',newMat1)
print ()
print ('  Determinant of A Matrix  ')
print ()
print ()
print ('Determinant = ',deter1)
print ()
print ('  Invert Matrix  ')
print ()
print (' idmat=',idmat1)
print ()
print ('Invert Matrix = ',inverse1)
print ('Invert Matrix = ',idmat1)

now this works in 2.68
don’t know if this can works in older SVN
the commands have change a lot since other older SVN!

happy bl

Thanks, I’m starting to understand it a little better now. I’ll try and get the latest SVN that is compatible with my version of Blender. I appreciate all the help. Thanks