Blender DirectX exporter to Panda3D
- by jakebird451
I have been experimenting with Panda3D lately. I have a character made in Blender with various bones and currently with one animation that I wish to export to a *.x format for Panda3D. My current attempt was to export the model was to first export with bones [Armatures] by checking the "Export Armatures" button in the export menu (file name: char.x). Thanks to the *.x file format, I read the file and it seems to have the same bone structure format as the model (with parenting and matrix positional data). The second export was selecting Animations - Full Animation to provide just the animation (file name: char_idle.x). The models exported just fine. I am not sure about the animation yet, but the file seems to be just fine.
This is my code for loading the model into python & Panda3D: self.model = Actor("char.x",{"char_idle.x"})
When I run the program the command line provides a couple of errors, the main errors of interest are:
:Actor(warning): char.x is not a character!
and
...
File "C:\Panda3D-1.8.0\direct\actor\Actor.py", line 284, in __init__
if (type(anims[anims.keys()[0]])==type({})):
AttributeError: 'set' object has no attribute 'keys'
The first error is the most interesting to me. The model works if I leave the animation dictionary blank. With no animations loaded the character appears in its un-animated T position, however the actor warning still shows up. The character should include the various bones when I exported the model right? I am not that experienced with blender, I'm just a programmer. So if the problem lies in blender please try to keep that in mind when posting a reply. I'll try my best to keep up.
I also tried to print out the bone structure without any animations loaded and it provides a similar error with the line print self.model.listJoints():
File "C:\Panda3D-1.8.0\direct\actor\Actor.py", line 410, in listJoints
Actor.notify.error("no part named: %s" % (partName))
File "C:\Panda3D-1.8.0\direct\directnotify\Notifier.py", line 132, in error
raise exception(errorString)
StandardError: no part named: modelRoot
I really hope it is a simple exporting fix.