private void HighlightMeshByMaterial(MaterialObject material, Color c) { foreach (var item in MeshGrid.Items) { MeshObject mo = item as MeshObject; if (mo != null && material.RefList.Contains(mo.InstID)) { DataGridUtil.MarkAsHighlighted(MeshGrid, item, c); } } }
public bool NetHandle_FrameData_Material(eNetCmd cmd, UsCmd c) { UsLogging.Printf("eNetCmd.Handle_FrameData_Material received ({0}).", c.Buffer.Length); var materials = new ObservableCollection<MaterialObject>(); int count = c.ReadInt32(); for (int i = 0; i < count; i++) { var m = new MaterialObject(); m.InstID = c.ReadInt32(); m.Name = c.ReadString(); m.ShaderName = c.ReadString(); m.RefCnt = c.ReadInt32(); m.RefList = new List<int>(); for (int k = 0; k < m.RefCnt; k++) { int owner = c.ReadInt32(); m.RefList.Add(owner); } materials.Add(m); } MaterialGrid.Dispatcher.Invoke(new Action(() => { title_material.Text = string.Format("Materials ({0})", materials.Count); MaterialGrid.DataContext = materials; })); return true; }
private void HighlightTextureByMaterial(MaterialObject material, Color c) { foreach (var item in TextureGrid.Items) { TextureObject to = item as TextureObject; if (to != null && to.RefList.Contains(material.InstID)) { DataGridUtil.MarkAsHighlighted(TextureGrid, item, c); } } }