Merge branch 'master' into feature_simulation_ux_tweaks

# Conflicts:
#	plugins/SimulationView/SimulationView.qml
This commit is contained in:
fieldOfView 2017-11-21 16:49:41 +01:00
commit 863b40b900
12 changed files with 33 additions and 74 deletions

View file

@ -902,7 +902,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
base_file_name = os.path.basename(file_name)
if base_file_name.endswith(".curaproject.3mf"):
base_file_name = base_file_name[:base_file_name.rfind(".curaproject.3mf")]
Application.getInstance().projectFileLoaded.emit(base_file_name)
self.setWorkspaceName(base_file_name)
return nodes
## HACK: Replaces the material container in the given stack with a newly created material container.

View file

@ -1,4 +1,4 @@
# Copyright (c) 2016 Aleph Objects, Inc.
# Copyright (c) 2017 Aleph Objects, Inc.
# Cura is released under the terms of the LGPLv3 or higher.
from UM.Application import Application
@ -166,8 +166,8 @@ class GCodeReader(MeshReader):
return line_width
def _gCode0(self, position, params, path):
x, y, z, f, e = position
if self._is_absolute_positioning:
x = params.x if params.x is not None else x
y = params.y if params.y is not None else y
@ -176,7 +176,7 @@ class GCodeReader(MeshReader):
x += params.x if params.x is not None else 0
y += params.y if params.y is not None else 0
z += params.z if params.z is not None else 0
f = params.f if params.f is not None else f
if params.e is not None:

View file

@ -20,7 +20,7 @@ from cura.Settings.ExtruderManager import ExtruderManager
import os.path
## RenderPass used to display g-code paths.
from plugins.SimulationView.NozzleNode import NozzleNode
from .NozzleNode import NozzleNode
class SimulationPass(RenderPass):
@ -100,7 +100,6 @@ class SimulationPass(RenderPass):
if isinstance(node, ToolHandle):
tool_handle_batch.addItem(node.getWorldTransformation(), mesh = node.getSolidMesh())
elif isinstance(node, NozzleNode):
nozzle_node = node
nozzle_node.setVisible(False)
@ -172,11 +171,11 @@ class SimulationPass(RenderPass):
batch.render(self._scene.getActiveCamera())
# The nozzle is drawn once we know the correct position
if self._layer_view.getActivity() and nozzle_node is not None:
if not self._compatibility_mode and self._layer_view.getActivity() and nozzle_node is not None:
if head_position is not None:
nozzle_node.setVisible(True)
nozzle_node.setPosition(head_position)
nozzle_batch = RenderBatch(self._nozzle_shader, type = RenderBatch.RenderType.Solid)
nozzle_batch = RenderBatch(self._nozzle_shader, type = RenderBatch.RenderType.Transparent)
nozzle_batch.addItem(nozzle_node.getWorldTransformation(), mesh = nozzle_node.getMeshData())
nozzle_batch.render(self._scene.getActiveCamera())

View file

@ -199,6 +199,7 @@ Item
{
layerTypeCombobox.currentIndex = UM.SimulationView.compatibilityMode ? 1 : UM.Preferences.getValue("layerview/layer_view_type");
layerTypeCombobox.updateLegends(layerTypeCombobox.currentIndex);
playButton.pauseSimulation();
viewSettings.extruder_opacities = UM.Preferences.getValue("layerview/extruder_opacities").split("|");
viewSettings.show_travel_moves = UM.Preferences.getValue("layerview/show_travel_moves");
viewSettings.show_helpers = UM.Preferences.getValue("layerview/show_helpers");

View file

@ -15,7 +15,6 @@ class SimulationViewProxy(QObject):
self._controller = Application.getInstance().getController()
self._controller.activeViewChanged.connect(self._onActiveViewChanged)
self._onActiveViewChanged()
self.is_simulationView_selected = False
currentLayerChanged = pyqtSignal()
@ -238,7 +237,6 @@ class SimulationViewProxy(QObject):
def _onActiveViewChanged(self):
active_view = self._controller.getActiveView()
if isinstance(active_view, SimulationView.SimulationView.SimulationView):
# remove other connection if once the SimulationView was created.
if self.is_simulationView_selected:
active_view.currentLayerNumChanged.disconnect(self._onLayerChanged)

View file

@ -45,6 +45,15 @@ _OLD_NOT_SUPPORTED_PROFILES = [
]
# Some containers have their specific empty containers, those need to be set correctly.
_EMPTY_CONTAINER_DICT = {
"1": "empty_quality_changes",
"2": "empty_quality",
"3": "empty_material",
"4": "empty_variant",
}
class VersionUpgrade30to31(VersionUpgrade):
## Gets the version number from a CFG file in Uranium's 3.0 format.
#
@ -126,6 +135,11 @@ class VersionUpgrade30to31(VersionUpgrade):
if quality_profile_id in _OLD_NOT_SUPPORTED_PROFILES:
parser["containers"]["2"] = "empty_quality"
# fix empty containers
for key, specific_empty_container in _EMPTY_CONTAINER_DICT.items():
if parser.has_option("containers", key) and parser["containers"][key] == "empty":
parser["containers"][key] = specific_empty_container
# Update version numbers
if "general" not in parser:
parser["general"] = {}