Material: move materal property list into material module and use this for material editor ui and writing of mat files

This commit is contained in:
Bernd Hahnebach
2018-06-10 10:03:48 +02:00
committed by wmayer
parent eeb5c5e09d
commit d02b1fee43
3 changed files with 32 additions and 28 deletions

View File

@@ -95,6 +95,34 @@ def exportFCMat(fileName, matDict):
Config.write(configfile)
def getMaterialAttributeStructure(withSpaces=None):
# material properties
# are there any more resources in FreeCAD source code where known material properties are defined exept the material cards itself?
# we should not have two of these list ...
# withSpaces is used by the material editor ui, without spaces is used to save a material file
if withSpaces:
material_property_groups = (
('Meta', ('Card Name', 'Author And License', 'Source')),
('General', ('Name', 'Father', 'Description', 'Denisty', 'Vendor', 'ProductURL', 'SpecificPrice')),
('Mechanical', ('Youngs Modulus', 'Poisson Ratio', 'Ultimate Tensile Strength', 'Compressive Strength', 'Elasticity', 'Fracture Toughness')),
('Architectural', ('Execution Instructions', 'Fire Resistance Class', 'Standard Code', 'Thermal Conductivity', 'Sound Transmission Class', 'Color', 'Finish', 'Units Per Quantity', 'Environmental Efficiency Class')),
('Rendering', ('Diffuse Color', 'Ambient Color', 'Specular Color', 'Shininess', 'Emissive Color', 'Transparency', 'Vertex Shader', 'Fragment Shader', 'Texture Path', 'Texture Scaling')),
('Vector rendering', ('View Color', 'Father', 'View Linewidth', 'Section Color', 'Section Fill Pattern', 'Section Linewidth')),
('User defined', ())
)
else:
material_property_groups = (
("Meta", ("CardName", "AuthorAndLicense", "Source")),
("General", ("Name", "Father", "Description", "Density", "Vendor", "ProductURL", "SpecificPrice")),
("Mechanical", ("YoungsModulus", "PoissonRatio", "UltimateTensileStrength", "CompressiveStrength", "Elasticity", "FractureToughness")),
("Architectural", ("Model", "ExecutionInstructions", "FireResistanceClass", "StandardCode", "ThermalConductivity", "SoundTransmissionClass", "Color", "Finish", "UnitsPerQuantity", "EnvironmentalEfficiencyClass")),
("Rendering", ("DiffuseColor", "AmbientColor", "SpecularColor", "Shininess", "EmissiveColor", "Transparency", "VertexShader", "FragmentShader", "TexturePath", "TextureScaling")),
("Vector rendering", ("ViewColor", "ViewFillPattern", "SectionFillPattern", "ViewLinewidth", "SectionLinewidth")),
("User defined", ())
)
return material_property_groups
if __name__ == '__main__':
import sys
import getopt