[solved] Morph and double-sided polygons (bug?)

I’m working on the egg exporter for blender 2.5. Now I try to export morph (shape keys) animation. The problem is this: If some polygons has a { 1 } attribute and the model has a shapekeys, then I get an error in pview and the animation is not working properly.

Assertion failed: inserted at line 170 of panda/src/gobj/sliderTable.cxx
Assertion failed: table == (SliderTable *)NULL || table->is_registered() at line 443 of panda/src/gobj/geomVertexData.cxx

Example of model:

<CoordinateSystem> { Z-up } 
<Material> Material {
  <Scalar> diffr { 0.039274 }
  <Scalar> diffg { 0.640000 }
  <Scalar> diffb { 0.000000 }
  <Scalar> specr { 0.500000 }
  <Scalar> specg { 0.500000 }
  <Scalar> specb { 0.500000 }
  <Scalar> shininess { 12.500000 }
  <Scalar> emitr { 0.000000 }
  <Scalar> emitg { 0.000000 }
  <Scalar> emitb { 0.000000 }
}

  <Group> Plane {
    <Dart> { 1 }
    <Transform> {
      <Matrix4> {
        0.000000 0.000000 -1.000000 0.000000
        0.000000 1.000000 0.000000 0.000000
        1.000000 0.000000 0.000000 0.000000
        -0.000000 0.000000 -0.014547 1.000000
      }
    }
    
    <VertexPool> Plane {
      <Vertex> 0 {
        7.549789415861596e-08 0.9999999403953552 -1.0145463943481445
        <UV> UVTex { 0.000000 0.000000 }
      }
      <Vertex> 1 {
        -7.549787284233389e-08 1.0000003576278687 0.9854531288146973
        <Dxyz> "Key 1" { -0.000000 1.459098 1.340793 }
        <UV> UVTex { 1.000000 0.000000 }
      }
      <Vertex> 2 {
        -7.549790836947068e-08 -0.9999998211860657 0.9854536056518555
        <UV> UVTex { 1.000000 1.000000 }
      }
      <Vertex> 3 {
        7.549789415861596e-08 -0.9999999403953552 -1.0145463943481445
        <UV> UVTex { 0.000000 1.000000 }
      }
      <Vertex> 4 {
        -7.549787284233389e-08 1.0000003576278687 0.9854531288146973
        <Dxyz> "Key 1" { -0.000000 1.459098 1.340793 }
        <UV> UVTex { 0.000000 0.000000 }
      }
      <Vertex> 5 {
        7.549789415861596e-08 0.9999999403953552 -1.0145463943481445
        <UV> UVTex { 1.000000 0.000000 }
      }
      <Vertex> 6 {
        7.549792968575275e-08 3.0 -1.0145468711853027
        <UV> UVTex { 1.000000 1.000000 }
      }
      <Vertex> 7 {
        -7.549784442062446e-08 3.000000476837158 0.9854527115821838
        <UV> UVTex { 0.000000 1.000000 }
      }
    }
    
    
    <Polygon> {
      <MRef> { Material }
      <Normal> {0.000000 -0.000000 1.000000}
      <BFace> { 1 }
      <VertexRef> { 0 1 2 3 <Ref> { Plane }}
    }
    <Polygon> {
      <MRef> { Material }
      <Normal> {0.000000 0.000000 1.000000}
      <VertexRef> { 4 5 6 7 <Ref> { Plane }}
    }
    
    
  }
<Table> {
  <Bundle> Plane {
    <Table> morph {
      <S$Anim> "Key 1" {
        <Scalar> fps { 10 }
        <V> { 0.2000 0.4000 0.6000 0.8000 1.0000 0.8000 0.6000 0.4000 0.2000 0.0000 }
      }
    }
  }
}

Can anyone tell me whats wrong - my EGG file, or it’s a bug?

That sounds like a Panda bug, but I’m not able to reproduce it. The file loads just fine for me. Which version of Panda are you using?

Try setting the following config setting:

egg-emulate-bface 1

Be sure to empty the Panda cache (or at least touch the egg file) after changing config settings to force the cache to be rebuilt.

David

Used Panda 1.7.2-1~maverick3 from repository.

It’s works fine with egg-emulate-bface 1. Thanks :slight_smile:

What is bface?

{ boolean-value }

This defines whether the polygon will be rendered double-sided
(i.e. its back face will be visible).  By default, this option is
disabled, and polygons are one-sided; specifying a nonzero value
disables backface culling for this particular polygon and allows
it to be viewed from either side.