private void RadioButton_Click(object sender, RoutedEventArgs e) { if (sender is System.Windows.Controls.RadioButton radioButton) { ActiveMovementFileName = radioButton.Content as string; ActiveMovement = liveFeedAnimators.FirstOrDefault(x => x.MovementFileName == ActiveMovementFileName); ClearEditorValues(); UpdateFrameUI(); } }
private void LoadAllFrames(List <VideoAnimationBinding> allBindings) { liveFeedAnimators = new List <AnimatorWithTransforms>(); ActiveMovement = null; int totalFrameCount = 0; foreach (VideoAnimationBinding videoAnimationBinding in allBindings) { AnimatorWithTransforms animatorWithTransforms = new AnimatorWithTransforms(); animatorWithTransforms.MovementFileName = videoAnimationBinding.MovementFileName; animatorWithTransforms.LiveFeedAnimator = GetLiveFeedAnimator(videoAnimationBinding.MovementFileName); if (ActiveMovement == null) { ActiveMovement = animatorWithTransforms; } animatorWithTransforms.ObsTransformEdits = new List <ObsTransformEdit>(); int frameIndex = 0; foreach (ObsTransform liveFeedSequence in animatorWithTransforms.LiveFeedAnimator.LiveFeedSequences) { int frameCount = (int)Math.Round(liveFeedSequence.Duration / secondsPerFrame); for (int i = 0; i < frameCount; i++) { animatorWithTransforms.ObsTransformEdits.Add(liveFeedSequence.CreateLiveFeedEdit(frameIndex)); frameIndex++; } } if (totalFrameCount == 0) { totalFrameCount = frameIndex; } liveFeedAnimators.Add(animatorWithTransforms); } LightingSequence = LoadLightingSequence(allBindings.FirstOrDefault().SceneName, totalFrameCount); }
private void DrawFrameSource(AnimatorWithTransforms animatorWithTransform) { ObsTransformEdit liveFeedEdit; if (frameIndex >= animatorWithTransform.ObsTransformEdits.Count) { liveFeedEdit = animatorWithTransform.ObsTransformEdits.Last(); } else { liveFeedEdit = animatorWithTransform.ObsTransformEdits[frameIndex]; } animatorWithTransform.LiveFeedAnimator.ScreenAnchorLeft = liveFeedEdit.GetX(); animatorWithTransform.LiveFeedAnimator.ScreenAnchorTop = liveFeedEdit.GetY(); double rotation = liveFeedEdit.GetRotation(); double scale = liveFeedEdit.GetScale(); double opacity = liveFeedEdit.GetOpacity(); animatorWithTransform.LiveFeedAnimator.SetCamera(liveFeedEdit.Camera); ObsControl.ObsManager.SizeAndPositionItem(animatorWithTransform.LiveFeedAnimator, scale, opacity, rotation, liveFeedEdit.Flipped); }