I want to convert my models with animations to a .X file (the Direct X Format).
http://space.tin.it/clubnet/arbenom/Export.htm has a python script that was supposed to do the job but I can't get it to work.
I'm using Blender 2.27. The webpage says that 2.2 and higher is supported. I downloaded Python 2.3 into C:\Python23.
After I open up the .blend file that is included in the exporter download, I tried to run it with Alt+P. The Blender console says that line
import Blender210
is no good. I comment it out with a # and attempted to run it again. The console now says that line
import string
is no good. I then put all the python scripts and the .blend file into C:\python23\lib, which is where string.py is.
It still doesn't work. If I comment out more stuff, It still complains about not being able to import the DirectXExport modules. Please help me.
Thanks for your help. I'm able to get it to work almost completely. Now I have a new problem.
I'm using Blender version 2.23 with Python 2.3
I'm trying to export animations to .X files using the Direct X export suite at
http://space.tin.it/clubnet/arbenom/Export.htm
Seems as if only version 2.23 works. I am able to export meshes and simple animations with it. It is working properly. However, when I attempt to export animations using armatures, I get this error in the console.
File "AnimX.py", line 42, in write Materials
mesh = Blender210.getMesh(object.data)
TypeError: argument1: expected string, None found
After looking in AnimX.py (it's a file included with the Direct X export suite) the function of interest is
def writeMaterials(self,name,object):
object = Blender210.getObject(name)
mesh = Blender210.getMesh(object.data)
for index in range(len(object.materials)):
namecol = object.materials[index]
mat = Blender210.getMaterial(namecol)
self.file.write("Material")
Apparently Blender210.getObject() takes a string for a parameter but Blender210.getObject(name).data is not a string. Could someone please help me debug this? I really need this animation exporter. I don't know the data types of the objects and stuff so I'm unable to attempt to fix this on my own. If anyone can point me to documation that descripes the blender objects, that would help too.
Again, higher versions of Blender will not work with this script because of the Blender210 module usage.
I don't think any of the documentation includes what the blender210 module does. I guess you could open the module's .py file if you had the old versions' source code to see. I was trying to update the quake model importer for blender that used the blender210 module as was able to do the same things by using the blender and nmesh modules instead of mesh and blender210. If your up for a weekend of python training and looking through the blender documentation you could probably rewrite the offensive function. Go to the documentation section in blender.org and look at the python docs 2.25