Commit Graph

534 Commits

Author SHA1 Message Date
Chris Hennes
fd20bdd6d8 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
Chris Hennes
e706122bbb Update translations 2025-08-30 2025-09-01 17:44:54 +02:00
Chris Hennes
b1b97e44f1 Update translations 2025-08-28 16:14:49 +02:00
Chris Hennes
3b3516de71 Material: Add missing include for PCH 2025-08-25 18:50:27 +02:00
tetektoza
0ce6a509e7 BIM: Load QIcon for Material Editor from bytes
Loading QIcon directly from bytes is not supported in Qt6 it seems, so
this patch changes it to load it to pixmap first and then to QIcon
directly.

Plus add some alternative options to avoid tracebacks for compatibility,
as it seems that in Qt5 it either failed gracefully, or was able to load
directly from string/bytes.
2025-08-24 23:08:44 -05:00
Chris Hennes
d77a070bc8 Merge pull request #23104 from thyssentishman/main
Split Material Exceptions.h into source and header
2025-08-24 22:38:39 -05:00
Johannes Thyssen Tishman
9831b60b9c Split Material Exceptions.h into source and header 2025-08-21 12:20:14 +02:00
Chris Hennes
3e1cc8302a Update translations 2025-08-18 17:55:24 +02:00
Johannes Thyssen Tishman
39f4bdf455 Revert "Materials: Check if m_uuid is empty before adding to recents"
This reverts commit dc03238349.
2025-08-14 16:02:02 +02:00
Max Wilfinger
b267203e67 Material: Update UI strings for consistency
Closes: #22130
2025-08-04 20:14:59 +02:00
Benjamin Nauck
927d302401 Merge pull request #22319 from davesrocketshop/importer_fixes 2025-07-04 06:10:37 +02:00
David Carter
44fab7eeab Materials: Add import for unimplemented fields
Adds import/export support for unimplemented material fields.

This includes reference source and URLs, and tag fields. Tag support
remains unimplemented in the editor, but is supported by a number
of materials in the FCMat files. They can be accessed in both C++
and Python.
2025-07-03 14:32:27 -04:00
David Carter
902012f12f Materials: Add support for embedded images
Adds support for file types other than PNG to embedded images in
materials. Adds checks to prevent crashing when an unsupported image
type is used.
2025-07-02 11:01:59 -05:00
Syres916
6eecd08f7c [Gui] C++ preparation for deprecation of QCheckBox…
…stateChanged -> checkStateChanged
2025-06-13 10:40:48 +02:00
wmayer
017f2c8842 Helper function to get preferred delete key depending on platform 2025-06-09 18:10:52 +02:00
João Matos
967ebfd29c Material: Fix unused parameters warnings. (#21584)
Just another round of compiler warnings fixes for material code.
2025-06-09 10:53:43 -05:00
David Carter
657da35e6b Materials: Set array quantity format (#21647)
* Materials: Set array quantity format

When setting quantity formats, the default format is not actually the
default. Instead fixed format is, which causes issues for very small
and very large values. This was fixed for C++ but arrays created in
Python were not setting the format correctly.

* Apply suggestions from code review

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-06-04 16:27:37 +00:00
David Carter
db1b5a8773 Materials: Pass by reference instead of pointers
Refactoring topass by reference instead of using existing pointers.
2025-06-02 11:32:08 -05:00
Yorik van Havre
94144ecd99 Translations: Merged crowdin translations 2025-06-02 11:48:26 +02:00
Yorik van Havre
bba4a7b990 Translations: updated ts files 2025-06-02 11:07:28 +02:00
David Carter
15ed1a07a9 Materials: Correct model spelling errors 2025-05-25 00:14:08 +02:00
David Carter
8ef8f64e9b Materials: External interface refinements (#21524) 2025-05-24 08:25:44 +02:00
Kacper Donat
f30fba7adb Materials: Fix MaterialManager being copied on getInstance() 2025-05-19 18:12:01 +02:00
Kacper Donat
fc93511d88 Materials: Fix ModelManager being copied on getInstance() 2025-05-19 18:12:01 +02:00
Joao Matos
280cdd273c Fix warnings in ModelManagercode. 2025-05-15 01:02:55 +02:00
Chris Hennes
5aa21132b8 Materials: Clean up unused variables
Updated error messages no longer refer to the exception object, resulting in compiler warnings.
2025-05-15 00:29:19 +02:00
Chris Hennes
f5806841b6 Merge pull request #19907 from benj5378/getAttribute
Base: make getAttribute template
2025-05-12 10:39:55 -05:00
Benjamin Bræstrup Sayoc
492b8312b3 Base: make getAttribute template 2025-05-09 15:54:57 +02:00
bofdahof
998f4e4d45 Console: rename PascalCase named methods to camelCase 2025-05-06 17:50:21 +02:00
David Carter
8abb9f0128 Materials: Default units (#20909)
Improves handling and assignment of default units

When creating a material without specifying units, no units are
currently assigned. This commit will assign the default units when none are
given, or throw an error when incompatible units are given. In the
latter case, the units are set to the property defaults.

This commit also incidentally fixed an issue when saving the material that
resulted in accessing an uninitialized pointer.
2025-05-05 11:31:25 -05:00
Chris Hennes
9b1467cef3 Merge pull request #20540 from 3x380V/cleanup-schemas-management
Simplify UnitsSchemas management
2025-05-05 10:43:27 -05:00
Chris Hennes
e4b301a048 Merge pull request #20449 from hyarion/refactor/cpp20-contains
Avoid using `count` and `std::find` where `contains` and `isEmpty` express intent better
2025-05-05 10:31:33 -05:00
David Carter
2117d5aef1 Material: Database manager fixes (#21132)
* Remove duplicate code from previous merge

* Caatch potential unknoiwn exceptions
2025-05-05 10:22:50 +02:00
David Carter
24df826865 Merge pull request #21046 from davesrocketshop/issue_13922_2
Update module dependencies to ensure that automated testing code is considered as well as direct dependencies. Update some automated tests to eliminate unwanted dependencies.
2025-05-04 17:02:50 -05:00
Benjamin Nauck
e69c372056 Material: use contains() and isEmpty() instead of count() where possible
# Conflicts:
#	src/Mod/Material/App/ModelLibrary.cpp
2025-05-03 22:22:10 +02:00
David Carter
ffb7ab779b Materials: External Module Support
The final PR for the external module feature that allows materials to
be stored in an external datastore, webservice, etc.

This includes the final material manager classes, and the UI support in
the form of commands and preference pages.
2025-04-29 19:06:16 -05:00
David Carter
a6ffcf63b6 Materials: Model Manager External Interface (#20825)
* Materials: Model Manager External Interface

Implement the ModelManagerExternal class for the external Materials
interface.

This is part of the ongoing merges of code to support external material
interfaces. In this PR the ModelManagerExternal class is implemented,
along with changes to supporting classes required for this class.

* Apply reviewer feedback
2025-04-28 10:29:04 -05:00
Luz Paz
4619ab1bff Misc: Fix various typos
Found via codespell
2025-04-27 19:32:19 -05:00
Ladislav Michl
ef6f60510a Test: fix MaterialTestCases failing on unicode character output 2025-04-27 00:45:54 +02:00
Kacper Donat
f2cd99c50a Material: Replace dynamic_cast with qobject_cast 2025-04-26 14:23:25 +02:00
Jacob Oursland
5b81cd741a python: apply const method annotations to impls. 2025-04-16 20:32:04 -07:00
David Carter
5bbb07e24d Materials: Use data classes in interface specification 2025-04-10 06:13:38 -04:00
David Carter
81b7b0c457 Material: Interface with an external module
The ExternalManager class calls python functions in an external module
to create, read, update, and delete material definitions. The API
provided by the modules must conform to that defined in the
MaterialManagerExternal.py file.

All communications with the external module is routed through this
class.
2025-03-31 22:46:12 -04:00
Luz Paz
f809e34ea0 Fix typos
Found via `codespell -q 3 -L aci,addmin,ake,aline,alle,alledges,alocation,als,ang,anid,anormal,aply,apoints,ba,beginn,behaviour,bloaded,bottome,brushin,bu,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,documentin,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,findn,fle,freez,graphin,hist,iff,incrementin,indexin,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,itsel,kilometre,leadin,localy,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,renderin,rin,ro,rougly,sectionin,seperator,serie,shs,sinc,siz,som,strack,substraction,te,technic,thist,thru,tread,tru,ue,uint,unter,uptodate,vas,vertexes,vew,wallthickness,whitespaces -S "./.git,*.po,*.ts,*.pdf,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./src/Base/StackWalker.cpp,./build/doc/SourceDoc,./tools/build/WindowsInstaller/lang,./src/Mod/TechDraw/Templates/locale"`
2025-03-31 23:00:32 +02:00
Tiago Almeida
9153926cbf fix #20005: material editor issue
-Changed info.baseName() to
info.fileName().remove(QStringLiteral(".FCMat"), Qt::CaseInsensitive)
in MaterialLibrary.cpp to ensure that only the extension ".FCmat"
is removed from the file name bacause the previous version was removing
 everything in front of the first dot
2025-03-31 11:16:12 -05:00
Andrea
85179089b1 [mod] clean
code clean
2025-03-31 11:01:39 -05:00
Benjamin Nauck
42e219a9fd Material: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
tritao
8ae48c3c8a Material: Remove XML binding files. 2025-03-26 13:01:41 +01:00
Joao Matos
e9fda68693 Material: Convert XML bindings to Python. 2025-03-26 12:18:02 +01:00
David Carter
507c3ba352 Linter fixes 2025-03-18 20:33:10 -05:00