ThomasL wrote:Strange, I have no problems here (Win32 XP, Blender r28413), nor on Ubuntu yesterday. However, one thing I have noticed is that Blender may be confused if I execute one version of the importer in a script window and have another one in the add-ons folder.
Thomas, I haven't been copying anything into the add-ons folder; everything has been done through the text editor.
Today, I tried loading a new model and Blender segfaulted (admittedly, segfaults in 2.5 svn are not an uncommon occurrence, but this was the first time your code has triggered it).
I put in some trace statements, and here are the last few lines of the output:
- Code: Select all
key is matrix
default key, ext matrix, args /Matrix...
matrix
D ob.matrix
exec ob.matrix[0][0] = 1...
Segmentation fault (core dumped)
The crash is coming here in defaultKey:
- Code: Select all
elif rnaType == 'Matrix':
i = 0
n = len(tokens)
for (key, val, sub) in tokens:
if key == 'row':
for j in range(n):
expr = "%s[%d][%d] = %g" % (nvar, i, j, float(val[j]))
print('exec %s...' % (expr))
exec(expr, glbals, lcals)
print('exec done')
i += 1
return
For the record, here is the original output:
- Code: Select all
RNA_string_set: IMPORT_SCENE_OT_makehuman_mhx.filename not found.
RNA_string_set: IMPORT_SCENE_OT_makehuman_mhx.directory not found.
Opening MHX file /home/martin/makehuman/exports/ma-25.mhx
Tokenizing
clearScene 32 <bpy_struct, Scene("Scene")>
Parsing
Loading /home/martin/mh/makehuman/data/textures/texture.tif = texture.tif
No file /home/martin/makehuman/exports/texture.png
No file /home/martin/makehuman/exports/texture.tif
No file /home/martin/mh/makehuman/data/textures/texture.png
Found file /home/martin/mh/makehuman/data/textures/texture.tif
Image <bpy_struct, Image("texture.tif")>
<bpy_struct, Image("texture.tif")>
Loading /home/martin/mh/makehuman/data/textures/texture_ref.tif = texture_ref.tif
No file /home/martin/makehuman/exports/texture_ref.png
No file /home/martin/makehuman/exports/texture_ref.tif
No file /home/martin/mh/makehuman/data/textures/texture_ref.png
Found file /home/martin/mh/makehuman/data/textures/texture_ref.tif
Image <bpy_struct, Image("texture_ref.tif")>
<bpy_struct, Image("texture_ref.tif")>
Loading /home/martin/mh/makehuman/data/textures/texture_opacity.tif = texture_opacity.tif
No file /home/martin/makehuman/exports/texture_opacity.png
No file /home/martin/makehuman/exports/texture_opacity.tif
No file /home/martin/mh/makehuman/data/textures/texture_opacity.png
Found file /home/martin/mh/makehuman/data/textures/texture_opacity.tif
Image <bpy_struct, Image("texture_opacity.tif")>
<bpy_struct, Image("texture_opacity.tif")>
<bpy_struct, ImageTexture("diffuse")>
<bpy_struct, ImageTexture("specularity")>
<bpy_struct, ImageTexture("alpha")>
<bpy_struct, CloudsTexture("normals")>
Ramp Element ['(0.569697,0.0276216,0.0473347,0.449231)', '0.0666667']
Ramp Element ['(1,0.990444,0.961778,1)', '0.525252']
Ramp interpolation ["'LINEAR'"]
Ramp Element ['(0.468774,0.306093,0.187666,0.2)', '0.2']
Ramp Element ['(1,0.925912,0.843177,0.5)', '0.8']
Ramp interpolation ["'LINEAR'"]
<bpy_struct, Material("SSS_skinshader")>
Struct done mat.strand
<bpy_struct, Material("Hair")>
<bpy_struct, Material("Invisio")>
<bpy_struct, Material("ProxySkin")>
<bpy_struct, Material("ProxyWhite")>
<bpy_struct, Material("ProxyRed")>
<bpy_struct, Material("ProxyGum")>
<bpy_struct, Material("ProxyBlue")>
<bpy_struct, Material("ProxyBlack")>
Linked
<bpy_struct, Armature("HumanRig")>
Segmentation fault (core dumped)
My system:
- Code: Select all
~> ~/blender/blender/blender -v
Blender 2.52 (sub 5) Build
build date: 2010-04-27
build time: 09:47:57
build revision: 28445M
build platform: linux2
build type: dynamic
~> uname -a
Linux edward.sunmoonstars 2.6.32.11-99.fc12.i686.PAE #1 SMP Mon Apr 5 16:15:03 EDT 2010 i686 i686 i386 GNU/Linux
No reason to believe that your code is the problem though.
I have looked a bit further at the code. I'm still working on this. But I'm not sur ewhy are you using exec everywhere. Why don't you just assign directly? like
- Code: Select all
ob.matrix[i][j] = float(val[j])