/// <summary> /// Load new material list /// </summary> /// <param name="path">Path to the new materials list</param> public void LoadMaterials(string path) { try { var m = MaterialList.GetData(path); if (m != null) { materials = m; Materials = new ReadOnlyDictionary <string, Data.Material>(materials.Materials); settings.MaterialsPath = path; OnMaterialsChanged?.Invoke(this, EventArgs.Empty); } } catch { } }
/// <summary> /// Initialise material list with the last used list. /// </summary> void InitialseMaterialsList() { try { materials = MaterialList.GetData(settings.MaterialsPath); } catch { materials = new MaterialList(); } Materials = new ReadOnlyDictionary <string, Data.Material>(materials.Materials); }