public override Attach Clone() { return(new ChunkAttach(VertexChunks.ContentClone(), PolyChunks.ContentClone()) { Name = Name, MeshBounds = MeshBounds, VertexName = VertexName, PolyName = PolyName, }); }
/// <summary> /// Updates the <see cref="HasWeight"/> property, since calculating it might take longer /// </summary> public void UpdateWeight() { if (PolyChunks == null || !PolyChunks.Any(a => a is PolyChunkStrip)) { hasWeight = VertexChunks != null && VertexChunks.Any(a => a.HasWeight); return; } List <int> ids = new(); if (VertexChunks != null) { foreach (var vc in VertexChunks) { if (vc.HasWeight) { hasWeight = true; return; } ids.AddRange(Enumerable.Range(vc.IndexOffset, vc.Vertices.Length)); } } hasWeight = PolyChunks.OfType <PolyChunkStrip>().SelectMany(a => a.Strips).SelectMany(a => a.Corners).Any(a => !ids.Contains(a.Index)); }