<Dxyz> morph

I’m trying to make a simple script that takes two egg files as input one is used as a base mesh and the other as a target, but I can’t get it to work even with the simplest of models :cry:

This is my base egg:

<CoordinateSystem> { Z-Up }

<Group> character {
  <Dart> { 1 }
  <Group> Tri01 {
    <VertexPool> Tri01.verts {
      <Vertex> 0 {
        1 3 0
        <UV> { 1 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 1 {
        0 1 1
        <UV> { 1 1 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 2 {
        0 3 0
        <UV> { 0 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
    }
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <VertexRef> { 0 1 2 <Ref> { Tri01.verts } }
    }
  }
  <Joint> Bone01 {
    <Transform> {
      <Matrix4> {
        1 0 0 0
        0 -4.37114e-008 1 0
        0 -1 -4.37114e-008 0
        0 -2.78258e-010 0 1
      }
    }
    <VertexRef> {
      0 1 2
      <Ref> { Tri01.verts }
    }
  }
}

And this is my target

<CoordinateSystem> { Z-Up }

<Group> character {
  <Dart> { 1 }
  <Group> Tri01 {
    <VertexPool> Tri01.verts {
      <Vertex> 0 {
        1 3 0
        <UV> { 1 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 1 {
        1 1 1
        <UV> { 1 1 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 2 {
        0 3 0
        <UV> { 0 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
    }
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <VertexRef> { 0 1 2 <Ref> { Tri01.verts } }
    }
  }
  <Joint> Bone01 {
    <Transform> {
      <Matrix4> {
        1 0 0 0
        0 -4.37114e-008 1 0
        0 -1 -4.37114e-008 0
        0 -2.78258e-010 0 1
      }
    }
    <VertexRef> {
      0 1 2
      <Ref> { Tri01.verts }
    }
  }
}

This is the egg output:

<CoordinateSystem> { Z-Up }

<Group> character {
  <Dart> { 1 }
  <Group> Tri01 {
    <VertexPool> Tri01.verts {
      <Vertex> 0 {
        1 3 0
        <UV> { 1 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 1 {
        0 1 1
        <Dxyz> morph01 { 1 0 0 }
        <UV> { 1 1 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
      <Vertex> 2 {
        0 3 0
        <UV> { 0 0 }
        <Normal> { 0 -1 -4.37114e-008 }
        // Bone01:1
      }
    }
    <Polygon> {
      <RGBA> { 1 1 1 1 }
      <VertexRef> { 0 1 2 <Ref> { Tri01.verts } }
    }
  }
  <Joint> Bone01 {
    <Transform> {
      <Matrix4> {
        1 0 0 0
        0 -4.37114e-008 1 0
        0 -1 -4.37114e-008 0
        0 -2.78258e-010 0 1
      }
    }
    <VertexRef> {
      0 1 2
      <Ref> { Tri01.verts }
    }
  }
}

I also got a animation just for testing:

<CoordinateSystem> { Z-Up }

<Table> {
  <Bundle> character {
    <Table> morph {
      <S$Anim> morph01 {
        <Scalar> fps { 10 }
        <V> {  0.5000 1.0000 }
      }
    }
  }
} 

The thing that changes is the position of vertex #1 (from 0 1 1 to 1 1 1). I was thinking all I have to do is to subtract the target position of the base position: (1, 1, 1)-(0, 1, 1)=(1, 0, 0) and that’s what I put in Dxyz: morph01 { 1 0 0 }, but when I try to view it in pview then nothing shows up.

Where did I go wrong?

Looks like the animation was the problem not the morph…

Adding a skeleton table seams to do the trick.
My anim looks like this now

<CoordinateSystem> { Z-Up }

<Table> {
  <Bundle> character {
    <Table> morph {
      <S$Anim> morph01 {
        <Scalar> fps { 10 }
        <V> { 0 0.5000 1.0000 }
      }
    }    
    <Table> "<skeleton>" {
      <Table> Bone01 {
       <Xfm$Anim> xform {} 
      }
    }
  }
}

So now I have a different question: Do I need to put all the bones in the skeleton table for models with more then one bone? And what’s the minimum setup for a ‘blank’ animation? <Xfm$Anim> xform {} doesn’t raise errors but I came to that by taking a valid animation and cutting bits out until pview was happy - somehow a entry like that seams awkward.