Merge branch 'master' into feature_support_meshes_present

# Conflicts:
#	cura/Scene/CuraSceneController.py
#	cura/Scene/CuraSceneNode.py
This commit is contained in:
fieldOfView 2020-06-04 10:27:11 +02:00
commit c34162a2ba
2961 changed files with 361563 additions and 555322 deletions

View file

@ -15,9 +15,11 @@ from cura.Settings.ExtruderManager import ExtruderManager #To get global-inherit
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
## The per object setting visibility handler ensures that only setting
# definitions that have a matching instance Container are returned as visible.
class PerObjectSettingVisibilityHandler(UM.Settings.Models.SettingVisibilityHandler.SettingVisibilityHandler):
"""The per object setting visibility handler ensures that only setting
definitions that have a matching instance Container are returned as visible.
"""
def __init__(self, parent = None, *args, **kwargs):
super().__init__(parent = parent, *args, **kwargs)

View file

@ -61,7 +61,7 @@ Item
updateMeshTypeCheckedState(type)
}
UM.I18nCatalog { id: catalog; name: "uranium"}
UM.I18nCatalog { id: catalog; name: "cura"}
Column
{

View file

@ -12,9 +12,11 @@ from UM.Settings.SettingInstance import SettingInstance
from UM.Event import Event
## This tool allows the user to add & change settings per node in the scene.
# The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
class PerObjectSettingsTool(Tool):
"""This tool allows the user to add & change settings per node in the scene.
The settings per object are kept in a ContainerStack, which is linked to a node by decorator.
"""
def __init__(self):
super().__init__()
self._model = None
@ -48,26 +50,31 @@ class PerObjectSettingsTool(Tool):
except AttributeError:
return ""
## Gets the active extruder of the currently selected object.
#
# \return The active extruder of the currently selected object.
def getSelectedActiveExtruder(self):
"""Gets the active extruder of the currently selected object.
:return: The active extruder of the currently selected object.
"""
selected_object = Selection.getSelectedObject(0)
return selected_object.callDecoration("getActiveExtruder")
## Changes the active extruder of the currently selected object.
#
# \param extruder_stack_id The ID of the extruder to print the currently
# selected object with.
def setSelectedActiveExtruder(self, extruder_stack_id):
"""Changes the active extruder of the currently selected object.
:param extruder_stack_id: The ID of the extruder to print the currently
selected object with.
"""
selected_object = Selection.getSelectedObject(0)
stack = selected_object.callDecoration("getStack") #Don't try to get the active extruder since it may be None anyway.
if not stack:
selected_object.addDecorator(SettingOverrideDecorator())
selected_object.callDecoration("setActiveExtruder", extruder_stack_id)
## Returns True when the mesh_type was changed, False when current mesh_type == mesh_type
def setMeshType(self, mesh_type: str) -> bool:
"""Returns True when the mesh_type was changed, False when current mesh_type == mesh_type"""
old_mesh_type = self.getMeshType()
if old_mesh_type == mesh_type:
return False

View file

@ -60,16 +60,12 @@ UM.Dialog
CheckBox
{
id: toggleShowAll
anchors
{
top: parent.top
right: parent.right
}
text: catalog.i18nc("@label:checkbox", "Show all")
checked: listview.model.showAll
onClicked: listview.model.showAll = checked
}
ScrollView
@ -85,7 +81,7 @@ UM.Dialog
}
ListView
{
id:listview
id: listview
model: UM.SettingDefinitionsModel
{
id: definitionsModel
@ -98,6 +94,7 @@ UM.Dialog
excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
return excluded_settings
}
showAll: toggleShowAll.checked || filterInput.text !== ""
}
delegate:Loader
{

View file

@ -3,6 +3,6 @@
"author": "Ultimaker B.V.",
"version": "1.0.1",
"description": "Provides the Per Model Settings.",
"api": "7.1",
"api": "7.2.0",
"i18n-catalog": "cura"
}