Material: Material Preferences

Updates the material preferences including selecting a default material

Preferences adds some options for what gets displayed in the Materials editor.
The option to use the legacy editor is removed in favour of the new
editor.

A new preference page has been added that allows the user to select a
default material. This will then be assigned to any newly created object. In
support of this, a new widget PrefsMaterialTreeWidget has been added as an
extension of the MaterialTreeWidget to automatically save and restore the
selected material.
This commit is contained in:
David Carter
2024-05-12 16:07:30 -04:00
committed by Chris Hennes
parent 6c4f76a8a5
commit 4dcd810ac5
21 changed files with 586 additions and 57 deletions

View File

@@ -0,0 +1,12 @@
; Acrylic
; Automatically generated by the Rocket Workbench
; information about the content of such cards can be found on the wiki:
; https://www.freecadweb.org/wiki/Material
[General]
Name = TestAcrylicLegacy
Description = Acrylic
KindOfMaterial = Solid
[Mechanical]
Density = 1190.0 kg/m^3

View File

@@ -0,0 +1,17 @@
---
# File created by ConvertFCMat.py
General:
UUID: "3c6d0407-66b3-48ea-a2e8-ee843edf0311"
Author: "David Carter"
License: "GPL-2.0-or-later"
Name: "TestAluminumAppearance"
Description: "Defines the Aluminum appearance properties"
AppearanceModels:
BasicRendering:
UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e'
AmbientColor: "(0.3000, 0.3000, 0.3000, 1.0)"
DiffuseColor: "(0.3000, 0.3000, 0.3000, 1.0)"
EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)"
Shininess: "0.0900"
SpecularColor: "(0.3000, 0.3000, 0.3000, 1.0)"
Transparency: "0.0"

View File

@@ -0,0 +1,33 @@
---
# File created by ConvertFCMat.py
General:
UUID: "5f546608-fcbb-40db-98d7-d8e104eb33ce"
Author: "M. Münch"
License: "LGPL-2.0-or-later"
Name: "TestAluminumMixed"
Inherits:
Aluminum:
UUID: "3c6d0407-66b3-48ea-a2e8-ee843edf0311"
Models:
Father:
UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67'
Father: "Metal"
MaterialStandard:
UUID: '1e2c0088-904a-4537-925f-64064c07d700'
KindOfMaterial: "Aluminium"
MaterialNumber: "3.3535.26"
StandardCode: "DIN 1725"
LinearElastic:
UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536'
Density: "2700 kg/m^3"
PoissonRatio: "0.3"
ShearModulus: "27000 MPa"
UltimateStrain: "5"
UltimateTensileStrength: "250 MPa"
YieldStrength: "180 MPa"
YoungsModulus: "70000 MPa"
Thermal:
UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7'
SpecificHeat: "900 J/kg/K"
ThermalConductivity: "150 W/m/K"
ThermalExpansionCoefficient: "23 µm/m/K"

View File

@@ -0,0 +1,30 @@
---
# File created by ConvertFCMat.py
General:
UUID: "a8e60089-550d-4370-8e7e-1734db12a3a9"
Author: "M. Münch"
License: "LGPL-2.0-or-later"
Name: "TestAluminumPhysical"
Models:
Father:
UUID: '9cdda8b6-b606-4778-8f13-3934d8668e67'
Father: "Metal"
MaterialStandard:
UUID: '1e2c0088-904a-4537-925f-64064c07d700'
KindOfMaterial: "Aluminium"
MaterialNumber: "3.3535.26"
StandardCode: "DIN 1725"
LinearElastic:
UUID: '7b561d1d-fb9b-44f6-9da9-56a4f74d7536'
Density: "2700 kg/m^3"
PoissonRatio: "0.3"
ShearModulus: "27000 MPa"
UltimateStrain: "5"
UltimateTensileStrength: "250 MPa"
YieldStrength: "180 MPa"
YoungsModulus: "70000 MPa"
Thermal:
UUID: '9959d007-a970-4ea7-bae4-3eb1b8b883c7'
SpecificHeat: "900 J/kg/K"
ThermalConductivity: "150 W/m/K"
ThermalExpansionCoefficient: "23 µm/m/K"

View File

@@ -0,0 +1,17 @@
---
# File created by ConvertFCMat.py
General:
UUID: "fff3d5c8-98c3-4ee2-8fe5-7e17403c48fcc"
Author: "David Carter"
License: "GPL-2.0-or-later"
Name: "TestBrassAppearance"
Description: "Defines the Brass appearance properties"
AppearanceModels:
BasicRendering:
UUID: 'f006c7e4-35b7-43d5-bbf9-c5d572309e6e'
AmbientColor: "(0.3294, 0.2235, 0.0275, 1.0)"
DiffuseColor: "(0.7804, 0.5686, 0.1137, 1.0)"
EmissiveColor: "(0.0000, 0.0000, 0.0000, 1.0)"
Shininess: "0.2179"
SpecularColor: "(0.9922, 0.9412, 0.8078, 1.0)"
Transparency: "0.0"