mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
automatically add shell thickness to stack and set to zero for infill meshes
and remove when unmodified and we change to another mesh type
This commit is contained in:
parent
eb1ae9f18d
commit
9c2fd1c9d4
1 changed files with 13 additions and 1 deletions
|
@ -68,7 +68,8 @@ class PerObjectSettingsTool(Tool):
|
|||
|
||||
## Returns True when the mesh_type was changed, False when current mesh_type == mesh_type
|
||||
def setMeshType(self, mesh_type: str) -> bool:
|
||||
if self.getMeshType() == mesh_type:
|
||||
old_mesh_type = self.getMeshType()
|
||||
if old_mesh_type == mesh_type:
|
||||
return False
|
||||
|
||||
selected_object = Selection.getSelectedObject(0)
|
||||
|
@ -94,6 +95,17 @@ class PerObjectSettingsTool(Tool):
|
|||
new_instance.resetState() # Ensure that the state is not seen as a user state.
|
||||
settings.addInstance(new_instance)
|
||||
|
||||
for property_key in ["top_bottom_thickness", "wall_thickness"]:
|
||||
if mesh_type == "infill_mesh":
|
||||
if not settings.getInstance(property_key):
|
||||
definition = stack.getSettingDefinition(property_key)
|
||||
new_instance = SettingInstance(definition, settings)
|
||||
new_instance.setProperty("value", 0)
|
||||
new_instance.resetState() # Ensure that the state is not seen as a user state.
|
||||
settings.addInstance(new_instance)
|
||||
elif old_mesh_type == "infill_mesh" and settings.getInstance(property_key) and settings.getProperty(property_key, "value") == 0:
|
||||
settings.removeInstance(property_key)
|
||||
|
||||
self.propertyChanged.emit()
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue