public BoneExportViewModel(RigResource.RigResource.Bone bone, BoneManager manager)
 {
     mIsChecked = bone.Name.Contains("slot");
     Bone = bone;
     mChildren = manager.GetChildren(bone).Select(x => new BoneExportViewModel(x, manager));
     //            if (bone.Name.Contains("ROOT"))
     //            {
     //                Thread t = null;
     //                t = new Thread(
     //                    delegate
     //                        {
     //                            while (t.IsAlive)
     //                            {
     //                                Thread.Sleep(new Random().Next(10000));
     //                                IsChecked = !IsChecked;
     //                            }
     //                        });
     //                t.Start();
     //            }
 }
Exemplo n.º 2
0
 public BoneViewModel(RigEditorViewModel rig, IHaveBones parent, RigResource.RigResource.Bone bone, BoneManager manager)
 {
     if (rig == null) throw new ArgumentNullException("rig");
     if (bone == null) throw new ArgumentNullException("bone");
     if (manager == null) throw new ArgumentNullException("manager");
     mRig = rig;
     mChildren = new ObservableCollection<BoneViewModel>();
     mParent = parent;
     mBone = bone;
     mManager = manager;
     foreach (RigResource.RigResource.Bone b in manager.GetChildren(mBone))
     {
         mChildren.Add(new BoneViewModel(mRig, this, b, mManager));
     }
     mRotation = new EulerAngle(new Quaternion(bone.Orientation.A, bone.Orientation.B, bone.Orientation.C, bone.Orientation.D));
     manager.BoneAdded += OnBoneAdded;
     manager.BoneRemoved += OnBoneRemoved;
     manager.BoneParentChanged += OnBoneParentChanged;
     mSetOppositeCommand = new UserCommand<BoneViewModel>(x => true, ExecuteSetOpposite);
 }