Merge branch '4.3'

This commit is contained in:
Diego Prado Gesto 2019-09-10 14:17:31 +02:00
commit 190984462b
5 changed files with 18 additions and 39 deletions

View file

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

View file

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

View file

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

View file

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

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

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