12,076,586 members (48,412 online)
Rate this:
See more:
Hi, Guys.
I have a small problem, actually 2 day evenings are spent during resolve this problem.
So.
I have method
```private void InitializeAnimations()
{
for (int i = 0; i < MeshList.Count; i++)
{
TransGroupList = new List<Transform3DGroup>();
Console.WriteLine("Rotate item: {0}",i);

foreach (RotationAxiss item in  Enum.GetValues(typeof(RotationAxiss)))
{
var TransGroup = new Transform3DGroup();
Console.WriteLine("Rotate By: {0}   axe", item.ToString());

for (int i2 = 0; i2 < MeshList[i].Count; i2++)
{
if (MeshList[i].Count - 1 == i2)
TransforMeshmAngle(MeshList[i][i2], item, true, TransGroup);

else
TransforMeshmAngle(MeshList[i][i2], item, false, TransGroup);
}
}
}
}```

MeshList is a like List>
Foreach GeometryModel3D I am creating animation.
By using this method:

```private void TransforMeshmAngle(GeometryModel3D input, RotationAxiss rotAxisEnum, bool isLastItem, Transform3DGroup group)
{
// Create and apply a transformation that rotates the object.
RotateTransform3D myRotateTransform3D = new RotateTransform3D();

AxisAngleRotation3D myAxisAngleRotation3d = new AxisAngleRotation3D();
myRotateTransform3D.Rotation = myAxisAngleRotation3d;
input.Transform = myRotateTransform3D;

switch (rotAxisEnum)
{
case RotationAxiss.ByX:
myAxisAngleRotation3d.Axis = new Vector3D(1, 0, 0);
break;
case RotationAxiss.ByY:
myAxisAngleRotation3d.Axis = new Vector3D(0, 1, 0);
break;
case RotationAxiss.ByZ:
myAxisAngleRotation3d.Axis = new Vector3D(0, 0, 1);
break;
default:
break;
}
}
```

All items are added to list like is should.
Everything seems very good
But....

When I try to run animation. Only Last item in " TransGroupList " can be animated.

```foreach (RotateTransform3D item in ListTransGroupList[index][index2].Children)
{
item.Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, InitDoubleAnim(), HandoffBehavior.Compose);
}
```

Also i tried to change sequence of enum RotationAxiss.
And same. only Last item is animated.

I can run different animations, with rule that it is last item in TransGroupList.

So, Can someone tell me where is mistake?

Thanks.
Posted 21-May-13 23:18pm
valza1.4K
valza 22-May-13 4:27am

MeshList is List<.List<.GeometryModel3D.>.>

Top Experts
Last 24hrsThis month
 Richard MacCutchan 420 Sergey Alexandrovich Kryukov 360 Jochen Arndt 350 OriginalGriff 305 F-ES Sitecore 225
 Dave Kreskowiak 2,836 OriginalGriff 2,805 Richard MacCutchan 2,174 CPallini 1,607 CHill60 1,379