mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 15:25:02 +08:00
added settings for modifier meshes and grouped meshed
CURA-11403
This commit is contained in:
parent
831a1d4876
commit
dbf722e034
@ -66,43 +66,42 @@ class SettingsExportModel(QObject):
|
||||
"cutting_mesh",
|
||||
"support_mesh"}
|
||||
|
||||
def __init__(self, parent = None):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self._settings_groups = []
|
||||
|
||||
application = CuraApplication.getInstance()
|
||||
|
||||
# Display global settings
|
||||
global_stack = application.getGlobalContainerStack()
|
||||
self._settings_groups.append(SettingsExportGroup(global_stack,
|
||||
"Global settings",
|
||||
SettingsExportGroup.Category.Global,
|
||||
self._exportSettings(global_stack)))
|
||||
self._appendGlobalSettings(application)
|
||||
self._appendExtruderSettings(application)
|
||||
self._appendModelSettings(application)
|
||||
|
||||
# Display per-extruder settings
|
||||
def _appendGlobalSettings(self, application):
|
||||
global_stack = application.getGlobalContainerStack()
|
||||
self._settings_groups.append(SettingsExportGroup(
|
||||
global_stack, "Global settings", SettingsExportGroup.Category.Global, self._exportSettings(global_stack)))
|
||||
|
||||
def _appendExtruderSettings(self, application):
|
||||
extruders_stacks = ExtruderManager.getInstance().getUsedExtruderStacks()
|
||||
for extruder_stack in extruders_stacks:
|
||||
color = ""
|
||||
if extruder_stack.material:
|
||||
color = extruder_stack.material.getMetaDataEntry("color_code")
|
||||
color = extruder_stack.material.getMetaDataEntry("color_code") if extruder_stack.material else ""
|
||||
self._settings_groups.append(SettingsExportGroup(
|
||||
extruder_stack, "Extruder settings", SettingsExportGroup.Category.Extruder,
|
||||
self._exportSettings(extruder_stack), extruder_index=extruder_stack.position, extruder_color=color))
|
||||
|
||||
self._settings_groups.append(SettingsExportGroup(extruder_stack,
|
||||
"Extruder settings",
|
||||
SettingsExportGroup.Category.Extruder,
|
||||
self._exportSettings(extruder_stack),
|
||||
extruder_index=extruder_stack.position,
|
||||
extruder_color=color))
|
||||
def _appendModelSettings(self, application):
|
||||
scene = application.getController().getScene()
|
||||
for scene_node in scene.getRoot().getChildren():
|
||||
self._appendNodeSettings(scene_node, "Model settings", SettingsExportGroup.Category.Model)
|
||||
|
||||
def _appendNodeSettings(self, node, title_prefix, category):
|
||||
stack = node.callDecoration("getStack")
|
||||
if stack:
|
||||
self._settings_groups.append(SettingsExportGroup(
|
||||
stack, f"{title_prefix}", category, self._exportSettings(stack), node.getName()))
|
||||
for child in node.getChildren():
|
||||
self._appendNodeSettings(child, f"Children of {node.getName()}", SettingsExportGroup.Category.Model)
|
||||
|
||||
# Display per-model settings
|
||||
scene_root = application.getController().getScene().getRoot()
|
||||
for scene_node in scene_root.getChildren():
|
||||
per_model_stack = scene_node.callDecoration("getStack")
|
||||
if per_model_stack is not None:
|
||||
self._settings_groups.append(SettingsExportGroup(per_model_stack,
|
||||
"Model settings",
|
||||
SettingsExportGroup.Category.Model,
|
||||
self._exportSettings(per_model_stack),
|
||||
scene_node.getName()))
|
||||
|
||||
@pyqtProperty(list, constant=True)
|
||||
def settingsGroups(self) -> List[SettingsExportGroup]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user