PD: Don't warn about Midplane on document load

This commit is contained in:
Chris Hennes
2025-12-10 13:30:05 -06:00
committed by Kacper Donat
parent 1c8df498f3
commit 3208b6de5f

View File

@@ -131,13 +131,16 @@ bool FeatureExtrude::hasTaperedAngle() const
void FeatureExtrude::onChanged(const App::Property* prop)
{
if (prop == &Midplane) {
if (!isRestoring() && prop == &Midplane) {
// Deprecation notice: Midplane property is deprecated and has been replaced by SideType in
// FreeCAD 1.1 when FeatureExtrude was refactored.
App::DocumentObject* obj = Profile.getValue();
auto baseName = obj ? obj->getNameInDocument() : "";
Base::Console().warning(
"The 'Midplane' property is deprecated and has been replaced by the 'SideType' "
"property in FeatureExtrude. Please update your script, this property will be "
"removed in a future version.\n"
"The 'Midplane' property being set for the extrusion of %s is deprecated and has "
"been replaced by the 'SideType' property in FeatureExtrude. Please update your script,"
" this property will be removed in a future version.\n",
baseName
);
if (Midplane.getValue()) {
SideType.setValue("Symmetric");
@@ -949,7 +952,6 @@ void FeatureExtrude::onDocumentRestored()
SideType.setValue("Two sides");
}
else if (Midplane.getValue()) {
// This code is probably now dead, replaced by the onChanged watcher for the Midplane value
Midplane.setValue(false);
SideType.setValue("Symmetric");
}