This commit is contained in:
fieldOfView 2016-07-14 08:57:13 +02:00
commit daf03b0a7b
10 changed files with 95 additions and 53 deletions

View file

@ -564,15 +564,17 @@ class CuraApplication(QtApplication):
node = Selection.getSelectedObject(0)
if node:
group_node = None
if node.getParent():
group_node = node.getParent()
if not group_node.callDecoration("isGroup"):
op = RemoveSceneNodeOperation(node)
else:
while group_node.getParent().callDecoration("isGroup"):
group_node = group_node.getParent()
op = RemoveSceneNodeOperation(group_node)
op = RemoveSceneNodeOperation(node)
op.push()
if group_node:
if len(group_node.getChildren()) == 1:
group_node.getChildren()[0].setParent(group_node.getParent())
op = RemoveSceneNodeOperation(group_node)
op.push()
## Create a number of copies of existing object.
@pyqtSlot("quint64", int)

View file

@ -35,10 +35,10 @@ class ExtruderManager(QObject):
@pyqtProperty(str, notify = activeExtruderChanged)
def activeExtruderStackId(self):
if not UM.Application.getInstance().getGlobalContainerStack():
return None #No active machine, so no active extruder.
return None # No active machine, so no active extruder.
try:
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getBottom().getId()][str(self._active_extruder_index)].getId()
except KeyError: #Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)].getId()
except KeyError: # Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
return None
## The instance of the singleton pattern.
@ -74,47 +74,43 @@ class ExtruderManager(QObject):
def getActiveExtruderStack(self):
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
if global_container_stack:
global_definition_container = UM.Application.getInstance().getGlobalContainerStack().getBottom()
if global_definition_container:
if global_definition_container.getId() in self._extruder_trains:
if str(self._active_extruder_index) in self._extruder_trains[global_definition_container.getId()]:
return self._extruder_trains[global_definition_container.getId()][str(self._active_extruder_index)]
if global_container_stack.getId() in self._extruder_trains:
if str(self._active_extruder_index) in self._extruder_trains[global_container_stack.getId()]:
return self._extruder_trains[global_container_stack.getId()][str(self._active_extruder_index)]
return None
## Adds all extruders of a specific machine definition to the extruder
# manager.
#
# \param machine_definition The machine to add the extruders for.
def addMachineExtruders(self, machine_definition):
# \param machine_definition The machine definition to add the extruders for.
# \param machine_id The machine_id to add the extruders for.
def addMachineExtruders(self, machine_definition, machine_id):
changed = False
machine_id = machine_definition.getId()
machine_definition_id = machine_definition.getId()
if machine_id not in self._extruder_trains:
self._extruder_trains[machine_id] = { }
changed = True
container_registry = UM.Settings.ContainerRegistry.getInstance()
if container_registry:
# Add the extruder trains that don't exist yet.
for extruder_definition in container_registry.findDefinitionContainers(machine = machine_definition.getId()):
for extruder_definition in container_registry.findDefinitionContainers(machine = machine_definition_id):
position = extruder_definition.getMetaDataEntry("position", None)
if not position:
UM.Logger.log("w", "Extruder definition %s specifies no position metadata entry.", extruder_definition.getId())
if not container_registry.findContainerStacks(machine = machine_id, position = position): # Doesn't exist yet.
self.createExtruderTrain(extruder_definition, machine_definition, position)
self.createExtruderTrain(extruder_definition, machine_definition, position, machine_id)
changed = True
# Gets the extruder trains that we just created as well as any that still existed.
extruder_trains = container_registry.findContainerStacks(type = "extruder_train", machine = machine_definition.getId())
extruder_trains = container_registry.findContainerStacks(type = "extruder_train", machine = machine_id)
for extruder_train in extruder_trains:
self._extruder_trains[machine_id][extruder_train.getMetaDataEntry("position")] = extruder_train
# Ensure that the extruder train stacks are linked to global stack.
extruder_train.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
changed = True
if changed:
self.extrudersChanged.emit(machine_definition)
self.extrudersChanged.emit(machine_id)
## Creates a container stack for an extruder train.
#
@ -127,17 +123,18 @@ class ExtruderManager(QObject):
# \param extruder_definition The extruder to create the extruder train for.
# \param machine_definition The machine that the extruder train belongs to.
# \param position The position of this extruder train in the extruder slots of the machine.
def createExtruderTrain(self, extruder_definition, machine_definition, position):
# \param machine_id The id of the "global" stack this extruder is linked to.
def createExtruderTrain(self, extruder_definition, machine_definition, position, machine_id):
# Cache some things.
container_registry = UM.Settings.ContainerRegistry.getInstance()
machine_id = machine_definition.getId()
machine_definition_id = machine_definition.getId()
# Create a container stack for this extruder.
extruder_stack_id = container_registry.uniqueName(extruder_definition.getId())
container_stack = UM.Settings.ContainerStack(extruder_stack_id)
container_stack.setName(extruder_definition.getName()) # Take over the display name to display the stack with.
container_stack.addMetaDataEntry("type", "extruder_train")
container_stack.addMetaDataEntry("machine", machine_definition.getId())
container_stack.addMetaDataEntry("machine", machine_id)
container_stack.addMetaDataEntry("position", position)
container_stack.addContainer(extruder_definition)
@ -145,7 +142,7 @@ class ExtruderManager(QObject):
variant = container_registry.findInstanceContainers(id = "empty_variant")[0]
if machine_definition.getMetaDataEntry("has_variants"):
# First add any variant. Later, overwrite with preference if the preference is valid.
variants = container_registry.findInstanceContainers(definition = machine_id, type = "variant")
variants = container_registry.findInstanceContainers(definition = machine_definition_id, type = "variant")
if len(variants) >= 1:
variant = variants[0]
preferred_variant_id = machine_definition.getMetaDataEntry("preferred_variant")
@ -163,9 +160,9 @@ class ExtruderManager(QObject):
if machine_definition.getMetaDataEntry("has_materials"):
# First add any material. Later, overwrite with preference if the preference is valid.
if machine_definition.getMetaDataEntry("has_variant_materials", default = "False") == "True":
materials = container_registry.findInstanceContainers(type = "material", definition = machine_id, variant = variant.getId())
materials = container_registry.findInstanceContainers(type = "material", definition = machine_definition_id, variant = variant.getId())
else:
materials = container_registry.findInstanceContainers(type = "material", definition = machine_id)
materials = container_registry.findInstanceContainers(type = "material", definition = machine_definition_id)
if len(materials) >= 1:
material = materials[0]
preferred_material_id = machine_definition.getMetaDataEntry("preferred_material")
@ -247,4 +244,4 @@ class ExtruderManager(QObject):
def _addCurrentMachineExtruders(self):
global_stack = UM.Application.getInstance().getGlobalContainerStack()
if global_stack and global_stack.getBottom():
self.addMachineExtruders(global_stack.getBottom())
self.addMachineExtruders(global_stack.getBottom(), global_stack.getId())

View file

@ -115,7 +115,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
changed = True
manager = ExtruderManager.getInstance()
for extruder in manager.getMachineExtruders(global_container_stack.getBottom().getId()):
for extruder in manager.getMachineExtruders(global_container_stack.getId()):
extruder_name = extruder.getName()
material = extruder.findContainer({ "type": "material" })
if material:

View file

@ -239,7 +239,6 @@ class MachineManager(QObject):
if self._active_container_stack and self._active_container_stack != self._global_container_stack:
self._active_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
self._active_container_stack.propertyChanged.disconnect(self._onGlobalPropertyChanged)
self._active_container_stack = ExtruderManager.getInstance().getActiveExtruderStack()
if self._active_container_stack:
self._active_container_stack.containersChanged.connect(self._onInstanceContainersChanged)
@ -292,7 +291,7 @@ class MachineManager(QObject):
new_global_stack.addContainer(quality_instance_container)
new_global_stack.addContainer(current_settings_instance_container)
ExtruderManager.getInstance().addMachineExtruders(definition)
ExtruderManager.getInstance().addMachineExtruders(definition, new_global_stack.getId())
Application.getInstance().setGlobalContainerStack(new_global_stack)

View file

@ -1,6 +1,11 @@
[2.1.3]
*Material Profiles
New material profiles for CPE+, PC, Nylon and TPU for the Ultimaker 2+ family.
[2.1.2]
Cura has been completely reengineered from the ground up for an even more seamless integration between hardware, software and materials. Together with its intuitive new user interface, its now also ready for any future developments. For the beginner Cura makes 3D printing incredibly easy, and for more advanced users, there are over 140 new customisable settings.
Cura has been completely reengineered from the ground up for an even more seamless integration between hardware, software and materials. Together with its intuitive new user interface, its now also ready for any future developments. For the beginner Cura makes 3D printing incredibly easy, and for more advanced users, there are over 200 customizable settings.
*Select Multiple Objects
You now have the freedom to select and manipulate multiple objects at the same time.
@ -27,22 +32,61 @@ An optimized 64-bit Windows Cura version is now available. This allows you to lo
Cura allows you to set a number of lines/layers instead of millimeters. The engine automatically calculates the right settings.
*Per-Object Settings
You can now override individual settings for different objects in advanced mode.
Per-object settings allow you to override individual profile settings per object.
*Fuzzy Skin
Prints the outer walls with a jittering motion to give your object a diffused finish.
*Engine Features
*Wire Printing
The object is printed with a mid-air / net-like structure, following the mesh surface. The build plate will move up and down during diagonal segments. Though not visible in layer view, you can view the result in other software, such as Repetier Host or http://chilipeppr.com/tinyg.
*Line Width
Line width settings added per feature: Global, Walls, Top/Bottom, Infill, Skirt, Support.
* Conical Support
An experimental filament, cost-reduction feature, for support.
*Pattern Settings
Pattern settings improved per feature: Top/Bottom, Infill, Support.
*Shell
*Alternate Skin Rotation
Helps to combat the pillowing problem on top layers.
*Alternate Extra Wall
For better infill adhesion.
*Horizontal Expansion
Allows to compensate model x,y-size to get a 1:1 result.
*Travel
*Avoid Printed Parts
When moving to the next part to print, avoid collisions between the nozzle and other parts which are already printed.
*Support
*Stair Step Height
Sets the balance between sturdy and hard to remove support. By setting steps of the stair-like bottom of the support resting on the model.
*ZigZag
A new, infill type thats easily breakable, introduced specially for support.
*Support Roofs
A new sub-feature to reduce scars the support leaves on overhangs.
*Support Towers
Specialized support for tiny overhang areas.
*ZigZag infill
A new, infill type thats easily breakable, introduced specially for support.
*Special Modes
* Avoid Printed Parts
While combing, the print head moves around printed parts, avoiding collisions with the nozzle and a part thats already printed.
*Surface Mode
This mode will print the surface of the mesh instead of the enclosed volume. This used to be called Only follow mesh surface. In addition to the surface mode and normal, a both mode has now been added. This ensures all closed volumes are printed as normal and all loose geometry as single walls.
*Experimental Features
*Conical Support
An experimental filament, cost-reduction feature, for support.
*Draft Shield
Prints a protective wall at a set distance around the object that prevents air from hitting the print, reducing warping.
*Fuzzy Skin
Prints the outer walls with a jittering motion to give your object a diffuse finish.
*Wire Printing
The object is printed with a mid-air / net-like structure, following the mesh surface. The build plate will move up and down during diagonal segments. Though not visible in layer view, you can view the result in other software, such as Repetier Host or http://chilipeppr.com/tinyg.

View file

@ -129,7 +129,7 @@ class StartSliceJob(Job):
self._buildGlobalSettingsMessage(stack)
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getBottom().getId()):
for extruder_stack in cura.Settings.ExtruderManager.getInstance().getMachineExtruders(stack.getId()):
self._buildExtruderMessage(extruder_stack)
for group in object_groups:

View file

@ -88,7 +88,7 @@ class GCodeWriter(MeshWriter):
data = {"global_quality": serialized}
manager = ExtruderManager.getInstance()
for extruder in manager.getMachineExtruders(stack.getBottom().getId()):
for extruder in manager.getMachineExtruders(stack.getId()):
extruder_quality = extruder.findContainer({"type": "quality"})
flat_extruder_quality_id = machine_manager.duplicateContainer(extruder_quality.getId())

View file

@ -93,7 +93,6 @@ class SliceInfo(Extension):
"printtime": print_information.currentPrintTime.getDisplayString(),
"filament": material_used,
"language": Preferences.getInstance().getValue("general/language"),
"materials_profiles ": {}
}
for container in global_container_stack.getContainers():
container_id = container.getId()

View file

@ -47,11 +47,11 @@ class MachineInstance:
raise UM.VersionUpgrade.InvalidVersionException("The version of this machine instance is wrong. It must be 1.")
self._type_name = config.get("general", "type")
self._variant_name = config.get("general", "variant", fallback = "empty")
self._variant_name = config.get("general", "variant", fallback = "empty_variant")
self._name = config.get("general", "name", fallback = "")
self._key = config.get("general", "key", fallback = None)
self._active_profile_name = config.get("general", "active_profile", fallback = "empty")
self._active_material_name = config.get("general", "material", fallback = "empty")
self._active_profile_name = config.get("general", "active_profile", fallback = "empty_quality")
self._active_material_name = config.get("general", "material", fallback = "empty_material")
self._machine_setting_overrides = {}
for key, value in config["machine_settings"].items():

View file

@ -215,8 +215,9 @@ Item {
// This ensures that the value in any of the deeper containers need not be removed, which is
// needed for the reset button (which deletes the top value) to correctly go back to profile
// defaults.
propertyProvider.setPropertyValue("value", propertyProvider.getPropertyValue("value", last_entry))
propertyProvider.setPropertyValue("state", "InstanceState.Calculated")
propertyProvider.setPropertyValue("value", propertyProvider.getPropertyValue("value", last_entry))
}
}