x2egg problem

hello!!
I’m trying to convert from directx file to egg file for importing in this python script:

from math import pi, sin, cos
 
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
 
class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
   
        # Load and transform the panda actor.
        self.pandaActor = Actor("text1",
                                {"walk": "text1_animation"})
        self.pandaActor.setScale(0.005, 0.005, 0.005)
        self.pandaActor.reparentTo(self.render)
        # Loop its animation.
        self.pandaActor.loop("walk")
 
  
app = MyApp()
app.run()

but when i run it, there is this message:

Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:Actor(warning): text1 is not a character!
Traceback (most recent call last):
  File "prova_panda3d.py", line 20, in <module>
    app = MyApp()
  File "prova_panda3d.py", line 17, in __init__
    self.pandaActor.loop("walk")
  File "/usr/share/panda3d/direct/actor/Actor.py", line 1555, in loop
    for control in self.getAnimControls(animName, partName):
  File "/usr/share/panda3d/direct/actor/Actor.py", line 1849, in getAnimControls
    allowAsyncBind = allowAsyncBind)
  File "/usr/share/panda3d/direct/actor/Actor.py", line 2341, in __bindAnimToPart
    bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
KeyError: 'modelRoot'

what is that?
thanks for all! :wink:

It means there weren’t any animation channels in your .x file, so x2egg converted it as a static egg file (which can’t be loaded as an Actor).

You can specify “-a text1” on the x2egg command line to force it to convert it as an animatable egg file instead.

David

Thanks for your answer …
i try it later.
I export a animation from blender 2.59 in directx format and convert it in egg file with x2egg converter. It is correct to build an actor’s animation?

i try it but i revieced this error:

x2egg -a test_animation.x -o text_animation.egg 

You must specify the DirectX file to read on the command line.

Usage:
  x2egg [opts] input.x output.egg
  x2egg [opts] -o output.egg input.x
  x2egg [opts] input.x >output.egg

the test_animation.x is this:

xof 0303txt 0032

Frame Root {
  FrameTransformMatrix {
     1.000000, 0.000000, 0.000000, 0.000000,
     0.000000, 0.000000, 1.000000, 0.000000,
     0.000000, 1.000000,-0.000000, 0.000000,
     0.000000, 0.000000, 0.000000, 1.000000;;
  }
  Frame Cube {
    FrameTransformMatrix {
       0.000000, 0.016064,-0.999871, 0.000000,
       1.000000,-0.000000, 0.000000, 0.000000,
      -0.000000,-0.999871,-0.016064, 0.000000,
       0.000000, 2.718969, 2.793919, 1.000000;;
    }
    Mesh { //Cube_001 Mesh
      24;
      -1.000000; 1.000000;-1.000000;,
      -1.000000;-1.000000;-1.000000;,
       1.000000;-1.000000;-1.000000;,
       1.000000; 1.000000;-1.000000;,
       0.999999;-1.000001; 1.000000;,
      -1.000000;-1.000000; 1.000000;,
      -1.000000; 1.000000; 1.000000;,
       1.000000; 0.999999; 1.000000;,
       1.000000;-1.000000;-1.000000;,
       0.999999;-1.000001; 1.000000;,
       1.000000; 0.999999; 1.000000;,
       1.000000; 1.000000;-1.000000;,
      -1.000000;-1.000000;-1.000000;,
      -1.000000;-1.000000; 1.000000;,
       0.999999;-1.000001; 1.000000;,
       1.000000;-1.000000;-1.000000;,
      -1.000000; 1.000000;-1.000000;,
      -1.000000; 1.000000; 1.000000;,
      -1.000000;-1.000000; 1.000000;,
      -1.000000;-1.000000;-1.000000;,
      -1.000000; 1.000000; 1.000000;,
      -1.000000; 1.000000;-1.000000;,
       1.000000; 1.000000;-1.000000;,
       1.000000; 0.999999; 1.000000;;
      6;
      4;0;1;2;3;,
      4;4;5;6;7;,
      4;8;9;10;11;,
      4;12;13;14;15;,
      4;16;17;18;19;,
      4;20;21;22;23;;
      MeshNormals { //Cube_001 Normals
        24;
         0.000000; 0.000000;-1.000000;,
         0.000000; 0.000000;-1.000000;,
         0.000000; 0.000000;-1.000000;,
         0.000000; 0.000000;-1.000000;,
         0.000000;-0.000000; 1.000000;,
         0.000000;-0.000000; 1.000000;,
         0.000000;-0.000000; 1.000000;,
         0.000000;-0.000000; 1.000000;,
         1.000000;-0.000000; 0.000000;,
         1.000000;-0.000000; 0.000000;,
         1.000000;-0.000000; 0.000000;,
         1.000000;-0.000000; 0.000000;,
        -0.000000;-1.000000;-0.000000;,
        -0.000000;-1.000000;-0.000000;,
        -0.000000;-1.000000;-0.000000;,
        -0.000000;-1.000000;-0.000000;,
        -1.000000; 0.000000;-0.000000;,
        -1.000000; 0.000000;-0.000000;,
        -1.000000; 0.000000;-0.000000;,
        -1.000000; 0.000000;-0.000000;,
         0.000000; 1.000000; 0.000000;,
         0.000000; 1.000000; 0.000000;,
         0.000000; 1.000000; 0.000000;,
         0.000000; 1.000000; 0.000000;;
        6;
        4;0;1;2;3;,
        4;4;5;6;7;,
        4;8;9;10;11;,
        4;12;13;14;15;,
        4;16;17;18;19;,
        4;20;21;22;23;;
      } //End of Cube_001 Normals
      MeshMaterialList { //Cube_001 Material List
        1;
        6;
        0,
        0,
        0,
        0,
        0,
        0;;
        Material Material {
           0.640000; 0.640000; 0.640000; 1.000000;;
           96.078431;
           0.500000; 0.500000; 0.500000;;
           0.000000; 0.000000; 0.000000;;
        }
      } //End of Cube_001 Material List
    } //End of Cube_001 Mesh
  } //End of Cube
} //End of Root Frame
AnimationSet {
  Animation {
    {Cube}
    AnimationKey { //Position
      2;
      100;
      0;3;     0.000000, 0.000000, 0.000000;;,
      1;3;     0.000000, 0.000000, 0.002562;;,
      2;3;     0.000000, 0.000000, 0.010279;;,
      3;3;     0.000000, 0.000000, 0.023189;;,
      4;3;     0.000000, 0.000000, 0.041319;;,
      5;3;     0.000000, 0.000000, 0.064680;;,
      6;3;     0.000000, 0.000000, 0.093267;;,
      7;3;     0.000000, 0.000000, 0.127058;;,
      8;3;     0.000000, 0.000000, 0.166007;;,
      9;3;     0.000000, 0.000000, 0.210050;;,
      10;3;    0.000000, 0.000000, 0.259095;;,
      11;3;    0.000000, 0.000000, 0.313027;;,
      12;3;    0.000000, 0.000000, 0.371699;;,
      13;3;    0.000000, 0.000000, 0.434937;;,
      14;3;    0.000000, 0.000000, 0.502537;;,
      15;3;    0.000000, 0.000000, 0.574259;;,
      16;3;    0.000000, 0.000000, 0.649836;;,
      17;3;    0.000000, 0.000000, 0.728967;;,
      18;3;    0.000000, 0.000000, 0.811318;;,
      19;3;    0.000000, 0.000000, 0.896528;;,
      20;3;    0.000000, 0.000000, 0.984207;;,
      21;3;    0.000000, 0.000000, 1.073942;;,
      22;3;    0.000000, 0.000000, 1.165297;;,
      23;3;    0.000000, 0.000000, 1.257820;;,
      24;3;    0.000000, 0.000000, 1.351046;;,
      25;3;    0.000000, 0.000000, 1.444502;;,
      26;3;    0.000000, 0.000000, 1.537713;;,
      27;3;    0.000000, 0.000000, 1.630206;;,
      28;3;    0.000000, 0.000000, 1.721519;;,
      29;3;    0.000000, 0.000000, 1.811198;;,
      30;3;    0.000000, 0.000000, 1.898810;;,
      31;3;    0.000000, 0.000000, 1.983942;;,
      32;3;    0.000000, 0.000000, 2.066206;;,
      33;3;    0.000000, 0.000000, 2.145243;;,
      34;3;    0.000000, 0.000000, 2.220721;;,
      35;3;    0.000000, 0.000000, 2.292341;;,
      36;3;    0.000000, 0.000000, 2.359836;;,
      37;3;    0.000000, 0.000000, 2.422970;;,
      38;3;    0.000000, 0.000000, 2.481539;;,
      39;3;    0.000000, 0.000000, 2.535371;;,
      40;3;    0.000000, 0.000000, 2.584322;;,
      41;3;    0.000000, 0.000000, 2.628277;;,
      42;3;    0.000000, 0.000000, 2.667146;;,
      43;3;    0.000000, 0.000000, 2.700864;;,
      44;3;    0.000000, 0.000000, 2.729388;;,
      45;3;    0.000000, 0.000000, 2.752697;;,
      46;3;    0.000000, 0.000000, 2.770785;;,
      47;3;    0.000000, 0.000000, 2.783665;;,
      48;3;    0.000000, 0.000000, 2.791363;;,
      49;3;    0.000000, 0.000000, 2.793919;;,
      50;3;    0.000000, 0.002388, 2.793919;;,
      51;3;    0.000000, 0.009582, 2.793919;;,
      52;3;    0.000000, 0.021618, 2.793919;;,
      53;3;    0.000000, 0.038520, 2.793919;;,
      54;3;    0.000000, 0.060301, 2.793919;;,
      55;3;    0.000000, 0.086958, 2.793919;;,
      56;3;    0.000000, 0.118473, 2.793919;;,
      57;3;    0.000000, 0.154809, 2.793919;;,
      58;3;    0.000000, 0.195910, 2.793919;;,
      59;3;    0.000000, 0.241699, 2.793919;;,
      60;3;    0.000000, 0.292074, 2.793919;;,
      61;3;    0.000000, 0.346909, 2.793919;;,
      62;3;    0.000000, 0.406053, 2.793919;;,
      63;3;    0.000000, 0.469325, 2.793919;;,
      64;3;    0.000000, 0.536518, 2.793919;;,
      65;3;    0.000000, 0.607396, 2.793919;;,
      66;3;    0.000000, 0.681693, 2.793919;;,
      67;3;    0.000000, 0.759116, 2.793919;;,
      68;3;    0.000000, 0.839343, 2.793919;;,
      69;3;    0.000000, 0.922030, 2.793919;;,
      70;3;    0.000000, 1.006806, 2.793919;;,
      71;3;    0.000000, 1.093281, 2.793919;;,
      72;3;    0.000000, 1.181047, 2.793919;;,
      73;3;    0.000000, 1.269684, 2.793919;;,
      74;3;    0.000000, 1.358763, 2.793919;;,
      75;3;    0.000000, 1.447847, 2.793919;;,
      76;3;    0.000000, 1.536503, 2.793919;;,
      77;3;    0.000000, 1.624301, 2.793919;;,
      78;3;    0.000000, 1.710817, 2.793919;;,
      79;3;    0.000000, 1.795646, 2.793919;;,
      80;3;    0.000000, 1.878395, 2.793919;;,
      81;3;    0.000000, 1.958693, 2.793919;;,
      82;3;    0.000000, 2.036194, 2.793919;;,
      83;3;    0.000000, 2.110574, 2.793919;;,
      84;3;    0.000000, 2.181539, 2.793919;;,
      85;3;    0.000000, 2.248821, 2.793919;;,
      86;3;    0.000000, 2.312184, 2.793919;;,
      87;3;    0.000000, 2.371418, 2.793919;;,
      88;3;    0.000000, 2.426342, 2.793919;;,
      89;3;    0.000000, 2.476802, 2.793919;;,
      90;3;    0.000000, 2.522672, 2.793919;;,
      91;3;    0.000000, 2.563849, 2.793919;;,
      92;3;    0.000000, 2.600254, 2.793919;;,
      93;3;    0.000000, 2.631831, 2.793919;;,
      94;3;    0.000000, 2.658541, 2.793919;;,
      95;3;    0.000000, 2.680367, 2.793919;;,
      96;3;    0.000000, 2.697305, 2.793919;;,
      97;3;    0.000000, 2.709366, 2.793919;;,
      98;3;    0.000000, 2.716576, 2.793919;;,
      99;3;    0.000000, 2.718969, 2.793919;;;
    }
    AnimationKey { //Rotation
      0;
      100;
      0;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      1;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      2;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      3;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      4;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      5;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      6;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      7;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      8;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      9;4;    -0.701404, 0.000000, 0.712763, 0.000000;;,
      10;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      11;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      12;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      13;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      14;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      15;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      16;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      17;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      18;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      19;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      20;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      21;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      22;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      23;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      24;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      25;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      26;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      27;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      28;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      29;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      30;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      31;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      32;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      33;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      34;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      35;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      36;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      37;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      38;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      39;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      40;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      41;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      42;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      43;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      44;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      45;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      46;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      47;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      48;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      49;4;   -0.701404, 0.000000, 0.712763, 0.000000;;,
      50;4;   -0.701404, 0.000492, 0.712763,-0.000484;;,
      51;4;   -0.701402, 0.001973, 0.712761,-0.001942;;,
      52;4;   -0.701391, 0.004452, 0.712750,-0.004381;;,
      53;4;   -0.701361, 0.007933, 0.712719,-0.007807;;,
      54;4;   -0.701298, 0.012419, 0.712655,-0.012221;;,
      55;4;   -0.701183, 0.017909, 0.712538,-0.017624;;,
      56;4;   -0.700993, 0.024398, 0.712346,-0.024009;;,
      57;4;   -0.700703, 0.031877, 0.712050,-0.031369;;,
      58;4;   -0.700281, 0.040333, 0.711621,-0.039690;;,
      59;4;   -0.699694, 0.049747, 0.711025,-0.048954;;,
      60;4;   -0.698907, 0.060094, 0.710226,-0.059136;;,
      61;4;   -0.697882, 0.071342, 0.709184,-0.070205;;,
      62;4;   -0.696580, 0.083455, 0.707861,-0.082125;;,
      63;4;   -0.694962, 0.096386, 0.706216,-0.094850;;,
      64;4;   -0.692989, 0.110083, 0.704211,-0.108328;;,
      65;4;   -0.690624, 0.124486, 0.701808,-0.122502;;,
      66;4;   -0.687834, 0.139527, 0.698974,-0.137303;;,
      67;4;   -0.684590, 0.155132, 0.695676,-0.152660;;,
      68;4;   -0.680866, 0.171221, 0.691893,-0.168492;;,
      69;4;   -0.676645, 0.187705, 0.687603,-0.184714;;,
      70;4;   -0.671917, 0.204494, 0.682799,-0.201235;;,
      71;4;   -0.666679, 0.221492, 0.677475,-0.217963;;,
      72;4;   -0.660937, 0.238602, 0.671640,-0.234800;;,
      73;4;   -0.654707, 0.255725, 0.665309,-0.251650;;,
      74;4;   -0.648013, 0.272763, 0.658508,-0.268416;;,
      75;4;   -0.640891, 0.289620, 0.651270,-0.285004;;,
      76;4;   -0.633381, 0.306204, 0.643639,-0.301324;;,
      77;4;   -0.625536, 0.322429, 0.635666,-0.317290;;,
      78;4;   -0.617412, 0.338212, 0.627411,-0.332822;;,
      79;4;   -0.609073, 0.353481, 0.618937,-0.347848;;,
      80;4;   -0.600587, 0.368171, 0.610313,-0.362303;;,
      81;4;   -0.592025, 0.382222, 0.601613,-0.376131;;,
      82;4;   -0.583461, 0.395588, 0.592909,-0.389284;;,
      83;4;   -0.574967, 0.408229, 0.584278,-0.401723;;,
      84;4;   -0.566617, 0.420112, 0.575793,-0.413417;;,
      85;4;   -0.558481, 0.431215, 0.567525,-0.424343;;,
      86;4;   -0.550628, 0.441522, 0.559545,-0.434485;;,
      87;4;   -0.543120, 0.451022, 0.551916,-0.443834;;,
      88;4;   -0.536017, 0.459713, 0.544698,-0.452386;;,
      89;4;   -0.529374, 0.467594, 0.537947,-0.460143;;,
      90;4;   -0.523238, 0.474672, 0.531712,-0.467108;;,
      91;4;   -0.517653, 0.480955, 0.526036,-0.473290;;,
      92;4;   -0.512654, 0.486453, 0.520956,-0.478700;;,
      93;4;   -0.508273, 0.491177, 0.516504,-0.483350;;,
      94;4;   -0.504534, 0.495142, 0.512705,-0.487251;;,
      95;4;   -0.501458, 0.498359, 0.509578,-0.490417;;,
      96;4;   -0.499056, 0.500842, 0.507138,-0.492860;;,
      97;4;   -0.497339, 0.502603, 0.505393,-0.494593;;,
      98;4;   -0.496310, 0.503652, 0.504348,-0.495626;;,
      99;4;   -0.495968, 0.504000, 0.504000,-0.495968;;;
    }
    AnimationKey { //Scale
      1;
      100;
      0;3;     1.000000, 1.000000, 1.000000;;,
      1;3;     1.000000, 1.000000, 1.000000;;,
      2;3;     1.000000, 1.000000, 1.000000;;,
      3;3;     1.000000, 1.000000, 1.000000;;,
      4;3;     1.000000, 1.000000, 1.000000;;,
      5;3;     1.000000, 1.000000, 1.000000;;,
      6;3;     1.000000, 1.000000, 1.000000;;,
      7;3;     1.000000, 1.000000, 1.000000;;,
      8;3;     1.000000, 1.000000, 1.000000;;,
      9;3;     1.000000, 1.000000, 1.000000;;,
      10;3;    1.000000, 1.000000, 1.000000;;,
      11;3;    1.000000, 1.000000, 1.000000;;,
      12;3;    1.000000, 1.000000, 1.000000;;,
      13;3;    1.000000, 1.000000, 1.000000;;,
      14;3;    1.000000, 1.000000, 1.000000;;,
      15;3;    1.000000, 1.000000, 1.000000;;,
      16;3;    1.000000, 1.000000, 1.000000;;,
      17;3;    1.000000, 1.000000, 1.000000;;,
      18;3;    1.000000, 1.000000, 1.000000;;,
      19;3;    1.000000, 1.000000, 1.000000;;,
      20;3;    1.000000, 1.000000, 1.000000;;,
      21;3;    1.000000, 1.000000, 1.000000;;,
      22;3;    1.000000, 1.000000, 1.000000;;,
      23;3;    1.000000, 1.000000, 1.000000;;,
      24;3;    1.000000, 1.000000, 1.000000;;,
      25;3;    1.000000, 1.000000, 1.000000;;,
      26;3;    1.000000, 1.000000, 1.000000;;,
      27;3;    1.000000, 1.000000, 1.000000;;,
      28;3;    1.000000, 1.000000, 1.000000;;,
      29;3;    1.000000, 1.000000, 1.000000;;,
      30;3;    1.000000, 1.000000, 1.000000;;,
      31;3;    1.000000, 1.000000, 1.000000;;,
      32;3;    1.000000, 1.000000, 1.000000;;,
      33;3;    1.000000, 1.000000, 1.000000;;,
      34;3;    1.000000, 1.000000, 1.000000;;,
      35;3;    1.000000, 1.000000, 1.000000;;,
      36;3;    1.000000, 1.000000, 1.000000;;,
      37;3;    1.000000, 1.000000, 1.000000;;,
      38;3;    1.000000, 1.000000, 1.000000;;,
      39;3;    1.000000, 1.000000, 1.000000;;,
      40;3;    1.000000, 1.000000, 1.000000;;,
      41;3;    1.000000, 1.000000, 1.000000;;,
      42;3;    1.000000, 1.000000, 1.000000;;,
      43;3;    1.000000, 1.000000, 1.000000;;,
      44;3;    1.000000, 1.000000, 1.000000;;,
      45;3;    1.000000, 1.000000, 1.000000;;,
      46;3;    1.000000, 1.000000, 1.000000;;,
      47;3;    1.000000, 1.000000, 1.000000;;,
      48;3;    1.000000, 1.000000, 1.000000;;,
      49;3;    1.000000, 1.000000, 1.000000;;,
      50;3;    1.000000, 1.000000, 1.000000;;,
      51;3;    1.000000, 1.000000, 1.000000;;,
      52;3;    1.000000, 1.000000, 1.000000;;,
      53;3;    1.000000, 1.000000, 1.000000;;,
      54;3;    1.000000, 1.000000, 1.000000;;,
      55;3;    1.000000, 1.000000, 1.000000;;,
      56;3;    1.000000, 1.000000, 1.000000;;,
      57;3;    1.000000, 1.000000, 1.000000;;,
      58;3;    1.000000, 1.000000, 1.000000;;,
      59;3;    1.000000, 1.000000, 1.000000;;,
      60;3;    1.000000, 1.000000, 1.000000;;,
      61;3;    1.000000, 1.000000, 1.000000;;,
      62;3;    1.000000, 1.000000, 1.000000;;,
      63;3;    1.000000, 1.000000, 1.000000;;,
      64;3;    1.000000, 1.000000, 1.000000;;,
      65;3;    1.000000, 1.000000, 1.000000;;,
      66;3;    1.000000, 1.000000, 1.000000;;,
      67;3;    1.000000, 1.000000, 1.000000;;,
      68;3;    1.000000, 1.000000, 1.000000;;,
      69;3;    1.000000, 1.000000, 1.000000;;,
      70;3;    1.000000, 1.000000, 1.000000;;,
      71;3;    1.000000, 1.000000, 1.000000;;,
      72;3;    1.000000, 1.000000, 1.000000;;,
      73;3;    1.000000, 1.000000, 1.000000;;,
      74;3;    1.000000, 1.000000, 1.000000;;,
      75;3;    1.000000, 1.000000, 1.000000;;,
      76;3;    1.000000, 1.000000, 1.000000;;,
      77;3;    1.000000, 1.000000, 1.000000;;,
      78;3;    1.000000, 1.000000, 1.000000;;,
      79;3;    1.000000, 1.000000, 1.000000;;,
      80;3;    1.000000, 1.000000, 1.000000;;,
      81;3;    1.000000, 1.000000, 1.000000;;,
      82;3;    1.000000, 1.000000, 1.000000;;,
      83;3;    1.000000, 1.000000, 1.000000;;,
      84;3;    1.000000, 1.000000, 1.000000;;,
      85;3;    1.000000, 1.000000, 1.000000;;,
      86;3;    1.000000, 1.000000, 1.000000;;,
      87;3;    1.000000, 1.000000, 1.000000;;,
      88;3;    1.000000, 1.000000, 1.000000;;,
      89;3;    1.000000, 1.000000, 1.000000;;,
      90;3;    1.000000, 1.000000, 1.000000;;,
      91;3;    1.000000, 1.000000, 1.000000;;,
      92;3;    1.000000, 1.000000, 1.000000;;,
      93;3;    1.000000, 1.000000, 1.000000;;,
      94;3;    1.000000, 1.000000, 1.000000;;,
      95;3;    1.000000, 1.000000, 1.000000;;,
      96;3;    1.000000, 1.000000, 1.000000;;,
      97;3;    1.000000, 1.000000, 1.000000;;,
      98;3;    1.000000, 1.000000, 1.000000;;,
      99;3;    1.000000, 1.000000, 1.000000;;;
    }
  }
} //End of AnimationSet

what is this error?

The -a option requires a parameter, which is an arbitrary name to assign to the animated character. So instead of just “-a”, use “-a text1” or some other name.

David

o yes!!
:wink:
but now i’m trying load them in my script:

from math import pi, sin, cos
 
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
 
class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
   
        # Load and transform the panda actor.
        self.pandaActor = Actor("cube", {"walk" : "cube_anim"})
        self.pandaActor.reparentTo(self.render)
        self.pandaActor.setPos(10, 10, 10)
        self.pandaActor.setScale(0.005, 0.005, 0.005)
        
        base.camera.setPos(0, 0, 0)
        base.camLens.setFar(500)
        base.camLens.setNear(1)      
        base.camera.lookAt(self.pandaActor)
        
        # Loop its animation.
        self.pandaActor.loop("walk")
 
  
app = MyApp()
app.run()

but nothing appears… why? (there’re warning in the terminal)

I don’t know. Your cube doesn’t appear to be centered on its origin, so lookAt() won’t necessarily look at the center of the cube (lookAt() will look at the origin).

Try simply moving the cube farther away, say (20, 20, 20), to see if you can see it then.

David

with this code i see the cube:

from math import pi, sin, cos
 
from direct.showbase.ShowBase import ShowBase
from direct.task import Task
from direct.actor.Actor import Actor
 
class MyApp(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
   
        cube = Actor("cube.x", {"walk": "cube_anim.x"})
        cube.reparentTo(self.render)
        cube.setPos(-8, 42, 0)
        #cube.loop("walk")  <-- it's commented
        
 
  
app = MyApp()
app.run()

when i running this script i see this erron in the terminal:

Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:Actor(warning): cube.x is not a character!

but when i toggle the comment there’is this error while i run the program:

Known pipe types:
  glxGraphicsPipe
(all display modules loaded.)
:Actor(warning): cube.x is not a character!
Traceback (most recent call last):
  File "prova_panda3d.py", line 18, in <module>
    app = MyApp()
  File "prova_panda3d.py", line 14, in __init__
    cube.loop("walk")
  File "/usr/share/panda3d/direct/actor/Actor.py", line 1555, in loop
    for control in self.getAnimControls(animName, partName):
  File "/usr/share/panda3d/direct/actor/Actor.py", line 1849, in getAnimControls
    allowAsyncBind = allowAsyncBind)
  File "/usr/share/panda3d/direct/actor/Actor.py", line 2341, in __bindAnimToPart
    bundle = self.__commonBundleHandles[subpartDef.truePartName].getBundle()
KeyError: 'modelRoot'

how can i export the animation?
[/code]

When I use x2egg on the x file you pasted above, and then pview the resulting egg file, I see some (somewhat jerky) animation.

Does that work for you too? If it does, then you can simply load the egg file in your Actor call (not the .x file).

David

Excuse me but i don’t understand how i create egg file. I use blender Modeler. How do i export my mesh in x format? How do i export my animation? How i create my egg file?
thank for your patience

I don’t have any direct experience with Blender, so I can’t be very much help to you. But maybe someone else reading this thread can help you through the steps?

Which version of Blender are you using? If you are using Blender 2.4 or earlier, you can use Chicken, as described in the manual. If you are using Blender 2.5 or later, you might be able to use ninth’s converter, as described in this thread.

Or you can convert the Blender file to x format, as described in the manual, and use x2egg, as described in the manual. You seem to have done this more-or-less successfully, but there seems to be some confusion. Can you clarify what your questions are on this process?

David