pyOptiShared.Material.MaterialLibrary
- class pyOptiShared.Material.MaterialLibrary
Bases:
object
Material library class holds a list of materials
Methods
LoadFromFolder
(material_lib_dir)Adds all the materials in the specified folder to the list of materials.
addMaterial
(material)Adds the specified material to the list of materials.
Returns a copy of the material dictionary
getMaterialFromName
(matname)Returns the material object with the specified name
getMaterialFromNum
(matnum)Returns the material object with the specified number
- LoadFromFolder(material_lib_dir: str)
Adds all the materials in the specified folder to the list of materials. The material files should have the .txt extension.
- Parameters:
material_lib_dir (str) – Directory where the material files are stored
- addMaterial(material: Material)
Adds the specified material to the list of materials. The material number and the material name must be unique to be added into the list
- Parameters:
material (Material) – Material object
- getMaterialFromName(matname: str) → Material
Returns the material object with the specified name
- Parameters:
matname (str) – Material name.
- Raises:
ValueError – If material with matname is not found.
- Returns:
The material object with name matname
- Return type: