Exemplo n.º 1
0
        private async void ExportPose(TargetService.ActorTableActor actor)
        {
            ActorViewModel?actorVm = actor.GetViewModel();

            if (actorVm == null)
            {
                return;
            }

            SkeletonVisual3d skeletonVm = await PoseService.GetVisual(actorVm);

            await PoseFile.Save(actorVm, skeletonVm);
        }
Exemplo n.º 2
0
        private async void OnDataContextChanged(object?sender, DependencyPropertyChangedEventArgs e)
        {
            this.Actor = this.DataContext as ActorViewModel;

            if (this.Actor == null || this.Actor.ModelObject == null)
            {
                this.Skeleton = null;
                return;
            }

            if (!this.IsVisible)
            {
                return;
            }

            try
            {
                this.Skeleton = await PoseService.GetVisual(this.Actor);

                this.ThreeDView.DataContext = this.Skeleton;
                this.GuiView.DataContext    = this.Skeleton;
                this.MatrixView.DataContext = this.Skeleton;

                if (this.Skeleton.File != null)
                {
                    if (!this.Skeleton.File.AllowPoseGui)
                    {
                        this.ViewSelector.SelectedIndex = 1;
                    }

                    if (!this.Skeleton.File.AllowPoseMatrix)
                    {
                        this.ViewSelector.SelectedIndex = 2;
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "Failed to bind skeleton to view");
            }
        }