diff options
-rw-r--r-- | cura/CuraActions.py | 33 | ||||
-rw-r--r-- | plugins/SolidView/SolidView.py | 6 | ||||
-rw-r--r-- | resources/shaders/overhang.shader | 2 | ||||
-rw-r--r-- | resources/themes/cura-light/icons/rotate_face_layflat.svg | 12 | ||||
-rwxr-xr-x | resources/themes/cura-light/styles.qml | 4 |
5 files changed, 18 insertions, 39 deletions
diff --git a/cura/CuraActions.py b/cura/CuraActions.py index 3a1b35d987..b92abbe706 100644 --- a/cura/CuraActions.py +++ b/cura/CuraActions.py @@ -75,39 +75,6 @@ class CuraActions(QObject): operation.addOperation(center_operation) operation.push() - # Rotate the selection, so that the face that the mouse-pointer is on, faces the build-plate. - @pyqtSlot() - def bottomFaceSelection(self) -> None: - selected_face = Selection.getSelectedFace() - if not selected_face: - Logger.log("e", "Bottom face operation shouldn't have been called without a selected face.") - return - - original_node, face_id = selected_face - meshdata = original_node.getMeshDataTransformed() - if not meshdata or face_id < 0 or face_id > Selection.getMaxFaceSelectionId(): - return - - rotation_point, face_normal = meshdata.getFacePlane(face_id) - rotation_point_vector = Vector(rotation_point[0], rotation_point[1], rotation_point[2]) - face_normal_vector = Vector(face_normal[0], face_normal[1], face_normal[2]) - rotation_quaternion = Quaternion.rotationTo(face_normal_vector.normalized(), Vector(0.0, -1.0, 0.0)) - - operation = GroupedOperation() - current_node = None # type: Optional[SceneNode] - for node in Selection.getAllSelectedObjects(): - current_node = node - parent_node = current_node.getParent() - while parent_node and parent_node.callDecoration("isGroup"): - current_node = parent_node - parent_node = current_node.getParent() - if current_node is None: - return - - rotate_operation = RotateOperation(current_node, rotation_quaternion, rotation_point_vector) - operation.addOperation(rotate_operation) - operation.push() - ## Multiply all objects in the selection # # \param count The number of times to multiply the selection. diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index a8cff675d9..536006ffaa 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -140,9 +140,9 @@ class SolidView(View): 1.0 ] - # Color the currently selected face-id. - face = Selection.getSelectedFace() - uniforms["selected_face"] = (Selection.getMaxFaceSelectionId() + 1) if not face or node != face[0] else face[1] + # Color the currently selected face-id. (Disable for now.) + #face = Selection.getHoverFace() + uniforms["hover_face"] = -1 #if not face or node != face[0] else face[1] except ValueError: pass diff --git a/resources/shaders/overhang.shader b/resources/shaders/overhang.shader index cb34f25893..a7473177e5 100644 --- a/resources/shaders/overhang.shader +++ b/resources/shaders/overhang.shader @@ -153,7 +153,7 @@ u_normalMatrix = normal_matrix u_viewPosition = view_position u_lightPosition = light_0_position u_diffuseColor = diffuse_color -u_faceId = selected_face +u_faceId = hover_face [attributes] a_vertex = vertex diff --git a/resources/themes/cura-light/icons/rotate_face_layflat.svg b/resources/themes/cura-light/icons/rotate_face_layflat.svg new file mode 100644 index 0000000000..261a624cf0 --- /dev/null +++ b/resources/themes/cura-light/icons/rotate_face_layflat.svg @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="28px" height="28px" viewBox="0 0 28 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <!-- Generator: Sketch 57.1 (83088) - https://sketch.com --> + <title>select face lay flat</title> + <desc>Created with Sketch.</desc> + <g id="select-face-lay-flat" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="rotate_layflat" fill="#000000" fill-rule="nonzero"> + <path d="M14.251,13.493 L12.557,17.823 L0,25.231 L18.333,27.733 L21.256,19.618 L28,15.37 L14.251,13.493 Z M20.275,19.274 L17.587,26.758 L2.571,24.758 L13.56,18.242 L14.93,14.57 L25.586,15.976 L20.275,19.274 Z M11.01,1.283 C15.878525,1.02618706 20.376659,3.87743916 22.222,8.39 L19.768,9.018 L23.95,13.295 L25.565,7.534 L23.204,8.138 C21.2324413,3.16323798 16.3058511,0.00172080637 10.962,0.282 C7.204,0.472 3.923,2.317 1.765,5.064 L2.557,5.676 C4.542,3.15 7.558,1.456 11.01,1.283 L11.01,1.283 Z" id="Shape"></path> + </g> + <polygon id="Path-6" stroke="#000000" fill="#000000" points="18 18 10 23 16 24"></polygon> + </g> +</svg>
\ No newline at end of file diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 2cf3b0ed58..f2361a8604 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -240,8 +240,8 @@ QtObject } Behavior on color { ColorAnimation { duration: 50; } } - border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? Theme.getSize("default_lining").width : 0 - border.color: Theme.getColor("lining") + border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? (control.checked ? Theme.getSize("thick_lining").width : Theme.getSize("default_lining").width) : 0 + border.color: control.checked ? Theme.getColor("icon") : Theme.getColor("lining") } } |