public BoneViewModel(Model model, Bone bone) { this.model = model; this.bone = bone; var children = from child in model.Bones where bone.BoneID == child.ParentBoneID select new BoneViewModel(model, child); var layers = from layer in bone.Layers select new MotionLayerViewModel(layer); this.Children = ObjectViewModel.Concat(children, layers); }
public ModelViewModel(Model model) { this.model = model; var bones = from bone in model.Bones where bone.ParentBoneID < 0 select new BoneViewModel(model, bone); var morphs = from morph in model.Morphs select new MorphViewModel(morph); var materials = from material in model.Materials select new MaterialViewModel(material); var propertyFrames = from propertyFrame in model.PropertyFrames select new PropertyFrameViewModel(propertyFrame); this.Children = ObjectViewModel.Concat(bones, morphs, materials, propertyFrames); }