This is a continuation of Jester and Ardell works. Since Blender 2.5 has a completely different API it was not possible to keep using the old import/export scripts. Hence I did the adaptation.
Developped and Tested with Blender 2.55 for Windows XP/32 bits.
I think the problem is that you don't have any material assigned, I can add a test to prevent the thing to crash but if you assign a material that should work too. I'll have a look when I have some time. If you can send me a test file at [My pseudo] at yah00 dot c0m that would help.
This is what is popping up in the console if it helps at all:
Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\Blender\2.58\scripts\addons\nwn2_mdb\NWN2Exporter.py", line 204, in execute
packet.setBlenderData(obj)
File "C:\Program Files\Blender Foundation\Blender\2.58\scripts\addons\nwn2_mdb\nwn2mdb.py", line 574, in setBlenderData
self.setMaterial(self.meshData)
File "C:\Program Files\Blender Foundation\Blender\2.58\scripts\addons\nwn2_mdb\nwn2mdb.py", line 485, in setMaterial
self.material.setMaterial(object.materials[0])
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0
hey OlBlach, im using blender 2.58 and im just experimenting with a weapon mdb just to make sure the export is working. I keep getting a export error. i made sure that the weapon was in object mode and i even renamed everything except the dds files. really want to get some cool custom stuff in game. thanks :)
Look under the tutorial section there are several custom contents guide. Look for how to make a custom placeable for example before you can move to the heads and body which are a bit more complicated.
im getting a bug with the exporter...importing is just fine, but it exports as a microsoft access database file and it doesnt show up in game. please let me know if i just put something in the wrong place and im just an idiot, thanks!
Posted by CPiciullo at 2011-08-03 13:30:56 Voted 9.00 on 08/03/11
Thanks Olblach! I figured it out (new to Blender, if you couldn't tell) but forgot to update the status.
OK thanks I'll have a look. My email is [My pseudo] at yah00 dot c0m
Posted by jester_v01 at 2011-04-19 15:48:37 Voted 10.00 on 04/19/11
Getting a bug with the importer. I think it's because vertex_groups no longer has an assign method. Try the following in NWN2Importer.py instead:
if packet.type == b'SKIN':
for ix in range(int(vert.boneCount)):
if [g for g in meshObj.vertex_groups if g.name == BONE_DICT[vert.boneIndices[ix]]]:
if vert.boneWeights[ix] > 0:
g.add([mesh.vertices[counter].index], vert.boneWeights[ix], 'REPLACE')
else:
if vert.boneWeights[ix] > 0:
g = meshObj.vertex_groups.new(BONE_DICT[vert.boneIndices[ix]])
g.add([mesh.vertices[counter].index], vert.boneWeights[ix], 'REPLACE')
Is there an easier way to communicate - I'd be glad to help debug.
Posted by jester_v01 at 2011-04-19 15:48:35 Voted 10.00 on 04/19/11
Getting a bug with the importer. I think it's because vertex_groups no longer has an assign method. Try the following in NWN2Importer.py instead:
if packet.type == b'SKIN':
for ix in range(int(vert.boneCount)):
if [g for g in meshObj.vertex_groups if g.name == BONE_DICT[vert.boneIndices[ix]]]:
if vert.boneWeights[ix] > 0:
g.add([mesh.vertices[counter].index], vert.boneWeights[ix], 'REPLACE')
else:
if vert.boneWeights[ix] > 0:
g = meshObj.vertex_groups.new(BONE_DICT[vert.boneIndices[ix]])
g.add([mesh.vertices[counter].index], vert.boneWeights[ix], 'REPLACE')
Is there an easier way to communicate - I'd be glad to help debug.
Posted by jester_v01 at 2011-04-19 13:53:32 Voted 10.00 on 04/19/11
Oh thank God.. I was getting all bogged down in packages and modules and Python crap I've forgotten because I haven't written any Python for about year. Very glad you've done this. Thank you!
Posted by jester_v01 at 2011-03-12 12:54:29 Voted 10.00 on 04/19/11
Blender 2.57 is out soon (next few weeks hopefully) and is meant to be stable - so there should be no more Python API 'updates'. When this happens I'll update the IO scripts - unless Olblachs all ready to go(?). There are couple more bugs that need fixing as well as those already discussed.
Yes, they have renamed add_fileselect into fileselect_add :S
They have also removed the float parameter from remove_doubles.
It's fixed but i need to repackage and send it.
Posted by jester_v01 at 2011-01-24 12:54:55 Voted 10.00 on 04/19/11
Hi there... Was mucking about recently with Blender 2.56a. Scripts seem to be bust. When running the import script it says the WindowManager object has not attribute 'add_fileselect' on line 536 of NWN2Importer.py. Probably an API change in 2.56
There is still the object not deleted bug...
So, save your project as .blend, export and if you want to make corrections then reopen and export or you will double the size of the mdb each time.
I'm going to look into it.
10 - A Masterpiece, Genuinely Groundbreaking 9 - Outstanding, a Must Have 8 - Excellent, Recommended to Anyone 7 - Very Good, Deserves a Look 6 - Good, Qualified Recommendation 5 - Fair, Solid yet Unremarkable 4 - Some Merit, Requires Improvements 3 - Poor Execution, Potential Unrealized 2 - Very Little Appeal 1 - Not Recommended to Anyone