Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
1  
Importers/exports for model formats are notoriously picky. Try making a simple model (box) with a single animated bone. Ensure you're selection the export option to output the Armature and animations. Check the verbose box and look at the output to try and get a better idea of where the error is coming from. –  Byte56 Sep 22 '12 at 20:39
    
@Byte56 Thanks for your response. I made a simple box containing only one armature and the same issues persist. However you mentioned the "verbose" output. Did you mean the output for panda or blender? –  jakebird451 Sep 22 '12 at 23:06
    
Blender. It simply has additional outputs in the command line. But it sounds more like the issue is with import instead of export. –  Byte56 Sep 22 '12 at 23:16

1 Answer 1

The first error means you are passing a set (ie. {1, 2, 3}) to the Actor constructor whereas it expects a dictionary (ie. {'a': 1, 'b': 2, 'c': 3}).

The second error about missing modelRoot means that the model you are trying to load is not rigged; Panda3D does not recognise it as a character. That, or you are trying to load the animation data as an actor in itself.

I would suggest that you try a dedicated exporter like YABEE (Blender 2.5+) or Chicken (< 2.5).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.