public ModelSceneNodeViewModel(Rmv2ModelNode node) { _modelNode = node; FileName = node.Model.FileName; SelectedVersion = "7"; // Find all attachmentpoints var attachmentPoints = node.Model.MeshList.SelectMany(x => x.SelectMany(y => y.AttachmentPoints)); attachmentPoints = attachmentPoints.DistinctBy(x => x.BoneIndex); attachmentPoints = attachmentPoints.OrderBy(x => x.BoneIndex); AttachmentPoints = new ObservableCollection <RmvAttachmentPoint>(attachmentPoints); }
Rmv2ModelNode LoadRigidMesh(PackFile file, ref ISceneNode parent, AnimationPlayer player, ref string skeletonName) { var rmvModel = new RmvRigidModel(file.DataSource.ReadData(), file.Name); var model = new Rmv2ModelNode(rmvModel, _resourceLibary, Path.GetFileName(rmvModel.FileName), player, GeometryGraphicsContextFactory.CreateInstance(_device)); if (parent == null) { parent = model; } else { parent.AddObject(model); } if (!string.IsNullOrWhiteSpace(rmvModel.Header.SkeletonName)) { skeletonName = rmvModel.Header.SkeletonName; } return(model); }
public ModelEditorService(Rmv2ModelNode model) { _model = model; }