Merge branch '2.3' of github.com:Ultimaker/Cura into 2.3

This commit is contained in:
Jaime van Kessel 2016-09-07 17:19:49 +02:00
commit 30e08da8aa
5 changed files with 26 additions and 15 deletions

View File

@ -693,17 +693,17 @@ class CuraApplication(QtApplication):
continue # Node that doesnt have a mesh and is not a group. continue # Node that doesnt have a mesh and is not a group.
if node.getParent() and node.getParent().callDecoration("isGroup"): if node.getParent() and node.getParent().callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted) continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
nodes.append(node) nodes.append(node)
if nodes: if nodes:
op = GroupedOperation() op = GroupedOperation()
for node in nodes: for node in nodes:
# Ensure that the object is above the build platform
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
op.addOperation(SetTransformOperation(node, Vector(0, node.getWorldPosition().y - node.getBoundingBox().bottom, 0))) op.addOperation(SetTransformOperation(node, Vector(0, node.getWorldPosition().y - node.getBoundingBox().bottom, 0)))
op.push() op.push()
## Reset all transformations on nodes with mesh data. ## Reset all transformations on nodes with mesh data.
@pyqtSlot() @pyqtSlot()
def resetAll(self): def resetAll(self):
Logger.log("i", "Resetting all scene transformations") Logger.log("i", "Resetting all scene transformations")
@ -719,15 +719,17 @@ class CuraApplication(QtApplication):
if nodes: if nodes:
op = GroupedOperation() op = GroupedOperation()
for node in nodes: for node in nodes:
# Ensure that the object is above the build platform # Ensure that the object is above the build platform
node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator) node.removeDecorator(ZOffsetDecorator.ZOffsetDecorator)
center_y = 0
op.addOperation(SetTransformOperation(node, Vector(0, node.getMeshData().getCenterPosition().y, 0), Quaternion(), Vector(1, 1, 1))) if node.callDecoration("isGroup"):
center_y = node.getWorldPosition().y - node.getBoundingBox().bottom
else:
center_y = node.getMeshData().getCenterPosition().y
op.addOperation(SetTransformOperation(node, Vector(0, center_y, 0), Quaternion(), Vector(1, 1, 1)))
op.push() op.push()
## Reload all mesh data on the screen from file. ## Reload all mesh data on the screen from file.
@pyqtSlot() @pyqtSlot()
def reloadAll(self): def reloadAll(self):

View File

@ -1,4 +1,4 @@
# Copyright (c) 2015 Ultimaker B.V. # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher. # Cura is released under the terms of the AGPLv3 or higher.
import configparser import configparser
@ -53,10 +53,10 @@ class CuraProfileReader(ProfileReader):
parser.read_string(serialized) parser.read_string(serialized)
if not "general" in parser: if not "general" in parser:
Logger.log('w', "Missing required section 'general'.") Logger.log("w", "Missing required section 'general'.")
return None return None
if not "version" in parser["general"]: if not "version" in parser["general"]:
Logger.log('w', "Missing required 'version' property") Logger.log("w", "Missing required 'version' property")
return None return None
version = int(parser["general"]["version"]) version = int(parser["general"]["version"])

View File

@ -7,6 +7,7 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Application import Application from UM.Application import Application
from UM.Preferences import Preferences from UM.Preferences import Preferences
from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator from cura.Settings.SettingOverrideDecorator import SettingOverrideDecorator
from cura.Settings.ExtruderManager import ExtruderManager
## This tool allows the user to add & change settings per node in the scene. ## This tool allows the user to add & change settings per node in the scene.
@ -71,11 +72,17 @@ class PerObjectSettingsTool(Tool):
global_container_stack = Application.getInstance().getGlobalContainerStack() global_container_stack = Application.getInstance().getGlobalContainerStack()
if global_container_stack: if global_container_stack:
self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1 self._multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
# Ensure that all extruder data is reset
if not self._multi_extrusion: if not self._multi_extrusion:
# Ensure that all extruder data is reset default_stack_id = global_container_stack.getId()
root_node = Application.getInstance().getController().getScene().getRoot() else:
for node in DepthFirstIterator(root_node): default_stack_id = ExtruderManager.getInstance().getExtruderStack(0).getId()
node.callDecoration("setActiveExtruder", global_container_stack.getId())
root_node = Application.getInstance().getController().getScene().getRoot()
for node in DepthFirstIterator(root_node):
node.callDecoration("setActiveExtruder", default_stack_id)
self._updateEnabled() self._updateEnabled()
def _updateEnabled(self): def _updateEnabled(self):

View File

@ -10,6 +10,7 @@
"manufacturer": "Ultimaker", "manufacturer": "Ultimaker",
"file_formats": "text/x-gcode;application/x-stl-ascii;application/x-stl-binary;application/x-wavefront-obj;application/x3g", "file_formats": "text/x-gcode;application/x-stl-ascii;application/x-stl-binary;application/x-wavefront-obj;application/x3g",
"visible": false, "visible": false,
"has_materials": true,
"preferred_material": "*generic_pla*", "preferred_material": "*generic_pla*",
"preferred_quality": "*normal*", "preferred_quality": "*normal*",
"machine_extruder_trains": "machine_extruder_trains":

View File

@ -14,6 +14,7 @@
"platform": "ultimaker2_platform.obj", "platform": "ultimaker2_platform.obj",
"platform_texture": "Ultimaker2backplate.png", "platform_texture": "Ultimaker2backplate.png",
"platform_offset": [9, 0, 0], "platform_offset": [9, 0, 0],
"has_materials": false,
"supported_actions":["UpgradeFirmware"] "supported_actions":["UpgradeFirmware"]
}, },
"overrides": { "overrides": {