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

@ -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)