dae2egg doesn't show UV mapped texture

Hi,

I try to import an egg file from a model made by Poser. From Poser it’s exported as a collada file (.dae) and I then use dae2egg to convert it into an egg file. The egg model looks quite good in the Panda rendering, however, the texture is not shown, although it is refered to in the egg file. The texture is a UV map, and in the egg files, all polygons refer to that texture. I have added a small part of the egg file, where this is demonstrated. It’s probably something simple that I have to modify manually. Has anyone experienced the same problem before and found a solution ?

{ Y-Up }

{
“dae2egg jongen_loopje.dae jongen_loopje.egg”
}
image-child_casual_texture {
child_casual_texture.png
type { 2d }
wrapu { repeat }
wrapv { repeat }
envtype { modulate }
uv-name { UVSET0 }
}
material-souls {
diffr { 1 }
diffg { 1 }
diffb { 1 }
ambr { 0 }
ambg { 0 }
ambb { 0 }
emitr { 0 }
emitg { 0 }
emitb { 0 }
specr { 0.0313726 }
specg { 0.0313726 }
specb { 0.0313726 }
shininess { 20 }


{
{ image-child_casual_texture }
{ material-souls }
{ 9766 9767 9768 9769 { Figure_2_geometry } }
}
}

Perhaps it’s related to this problem?
[.dae to.egg and UV)

Okay, thank you!

I still can’t get a good egg model with dae2egg. Here’s an example: I tried a standard model of Poser and added an animation. Then I export it to a collada file. And then I use dae2egg to make an egg file. The collada files seems okay (see the screenshot of a collada viewer of the dae file on the left) but the egg file does not seen to be okay (screenshot from pview of the egg file on the right). Apart from that, the animation does not work in the egg file, but that may be related to this problem. I tried this both exporting to collada with and without the animation, but in both cases, pview shows the same result.

I have proceeded a little bit and found out why the model is not rendered properly: I removed a few lines from the egg file:

  1. within the definition, I removed
    uv-name { UVSET0 }
  2. within the definition, I removed
    { 1 }
    Maybe these are not supported in the dae2egg converter.

for example:

<CoordinateSystem> { Y-Up }

<Comment> {
  "dae2egg Boy2.dae Boy2.egg"
}
<Texture> image-child_casual_texture_1 {
  child_casual_texture_1.tif
  <Scalar> type { 2d }
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> envtype { modulate }
  <Scalar> uv-name { UVSET0 }
}
<Texture> image-child_casual_texture {
  child_casual_texture.png
  <Scalar> type { 2d }
  <Scalar> wrapu { repeat }
  <Scalar> wrapv { repeat }
  <Scalar> envtype { modulate }
  <Scalar> uv-name { UVSET0 }
}
...

<Group> Poser_scene_root {
  <Group> Figure_2_node {
    <Dart> { 1 }
    <Group> Figure_2_geometry {
      <VertexPool> Figure_2_geometry {
        <Vertex> 0 {
          0.0283535 0.149664 0.00751206
          <UV> { 0.26784 0.298501 }
          <Normal> { -0.195449 -0.214465 0.956977 }
          // Hip:0.535945 Left_Thigh:0.464055
        }
...

When I add an animation to the model and export it to collada and egg, pview responds with ‘no animation’. Maybe this is also something that I need to edit manually in the egg file. Does someone have experience with that ?

As a further test, I exported the model plus a walking animation from Poser to a Collada file. I then viewed the model PLUS the animation in the Assimp collada viewer and the model looked okay and the animation worked just fine. So, that suggests that the .dae file is okay. Then I converted the .dae file with dae2egg into an egg file, and separated the egg into two files: a model file and an animation file. The model file looks okay in pview. I compared the animation egg file with the egg specification document and could not find any error.

In my panda program I then loaded both the model and the animation:

        self.personAxis=render.attachNewNode('person axis')
        self.Person=Actor.Actor('animations/Boy2',{'walk':'animations/Boy2_walk'})
        self.Person.reparentTo(self.personAxis)
        self.Person.setPosHpr(-22,-1490,0, 180, 0, 0)
        self.Person.setScale(2.31)
        self.Person.loop('walk')

The model then is rendered corrupted, just as in the right picture two posts above. If I remove the self.Person.loop(‘walk’) statement, the model looks okay, as in the left picture two posts above. So, this suggests that the problem is in the animation file. However, if I reduce the animation file (Boy2_walk.egg) to this:

<CoordinateSystem> { Z-Up }

<Comment> {
  "walking animation Boy"
}
<Table> {
  <Bundle> Figure_2_node {

  }
}

then the model is still corrupted. If I remove the statement, the model is okay again.
So, any animation call seems to corrupt the rendering of the model. Does anyone have an idea what could cause this ?