niacdoial / blemd

BMD importer for blender (BDL format also partially supported)
GNU General Public License v3.0
32 stars 13 forks source link

"WARNING bpy.ops.import_mesh.bmd.matv2 found different ind tex block" Error Followed by a Crash #21

Closed GANONdork123 closed 5 years ago

GANONdork123 commented 6 years ago

When attempting to import this (and other) BMD's I get this error

model.bmd

image

The model appears to import properly but Blender will crash whenever I attempt to go into Edit mode with the mesh selected.

niacdoial commented 6 years ago

Hello! I'll try to look into this when I'll have he time.

What I can already tell, though, is that the (very unclear) warnings tell that BleMD doesn't know how to use indirect texturing (yet?).

However, because that data isn't used afterwards, I don't know where this crash comes from. And since it happens when BleMD technically finished its job, it is going to be hard to debug.

So... yeah. I'll keep you updated.

Le 11 septembre 2018 10:35:30 GMT+02:00, GANONdork123 notifications@github.com a écrit :

When attempting to import this (and other) BMD's I get this error

model.bmd

image

The model appears to import properly but Blender will crash whenever I attempt to go into Edit mode with the mesh selected.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/niacdoial/blemd/issues/21

niacdoial commented 6 years ago

Hello! Sorry, I underestimated how busy I would be those last two weeks. I uploaded an imperfect fix, which uses a 'black box' from the blender API: it prevents the crash, but it also looses some data on a bigger amount of meshes. This is why the fix isn't active by default, but is enabled by the "validate mesh" checkbox. I will keep working on it. I hope it is enough for now.

GANONdork123 commented 6 years ago

image Seems this fix has lead to wrongly assigned materials on certain BMDs. It does fix the crash though. Here's the one in the screenshot: https://drive.google.com/file/d/1FYGYPz4iEMu8nX_MqUbpoaC-G7ZCscd6/view?usp=sharing This is what it should look like: image

niacdoial commented 6 years ago

Yeah it messes up the material indices.

I am trying to find the blender C code associated with the mesh.validate() function that prevents crashing but causes this mess, so I can reverse-engineer it.

PS: sorry for the somewhat late response

niacdoial commented 6 years ago

I uploaded a permanent fix to this blender-crashing problem. I kept the validate option just in case, though, but labeled it as a last resort. I will reverse-engineer the validation function gradually, seeing it is 1500 lines long (all subfunctions included)

GANONdork123 commented 5 years ago

Oops reopened by accident. Seems all issues have been fixed related to this.