Hi,
I have storyboard with multiple double animations (Not all show in code to make it easier on the eye). I'm setting the duration in the double animation & have read you should also set the storyboard duration to same value to not cut short animation. The issue is even if I increase from millisecond to seconds the sim does not change speed. I can do a fine adjustment with the slider but hardly noticeable using storyboad setspeedratio (Which is if I have understood correctly an adustment to the speed ratio (Which is set to 1)).
Plus this is using Helix3d to move stl's around in 3d Space. All movements work as expected bu the timing does not seem to be controlable.
I thought I had solved this before but I think is may of been a PC restriction mimicking the slowing down (I have since changed PC to a much fast one)
Dim Sim_Dur As Duration = New Duration(TimeSpan.FromSeconds(Sim_Line_Time))
element.RegisterName("ModTranslateX", X_Mov)
Dim MoD_X_Tran As DoubleAnimation = New DoubleAnimation()
MoD_X_Tran.Name = "X_T"
MoD_X_Tran.From = Last_Point.X
MoD_X_Tran.To = Next_Point.X
MoD_X_Tran.Duration = Sim_Durb
Storyboard.SetTargetProperty(MoD_X_Tran, New PropertyPath("OffsetX"))
Storyboard.SetTargetName(MoD_X_Tran, "ModTranslateX")
AddHandler Move.Completed, AddressOf Story_Completed
Move.SetSpeedRatio(Speed.Value / 1000)
Animation_Running = True
Move.Begin(element, HandoffBehavior.SnapshotAndReplace, True)
What I have tried:
I have tried setting the duration to double animation or the storyboard or even both.
I have tried inflating the duration but no real changes.
I think I may of found a possible reason (Thanks to Gerry Schmitz indirectly point me to look else where). I think the loop for the storry board moves were (Still working on proving it) was dropping through & jumping from one move to the other & giving the impression it working.
Before:-
Move.Begin(element, HandoffBehavior.SnapshotAndReplace, True)
Do Until Animation_Running = False 'Wait for complete (See Story_Completed Sub) Timer to complete
DoEvents()
Try
If Move.GetCurrentState = ClockState.Active Then
Animation_Running = False
End If
Catch ex As Exception
Animation_Running = False
End Try
Loop
Private Sub Story_Completed(ByVal sender As Object, ByVal e As EventArgs)
Animation_Running = False
End Sub
After:- (Not try Catch needed) (Not the elememt added to the current state which was the error being caught by the Try Catch)
Move.Begin(element, HandoffBehavior.SnapshotAndReplace, True)
Do Until Animation_Running = False 'Wait for complete (See Story_Completed Sub) Timer to complete
DoEvents()
If Move.GetCurrentState(element) = ClockState.Active Then
Animation_Running = True
Else
Animation_Running = False
End If
Loop
Private Sub Story_Completed(ByVal sender As Object, ByVal e As EventArgs)
Animation_Running = False
End Sub