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
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?