Added option to rotate multiple base objects as a compound or individually.

This commit is contained in:
Markus Lampert
2018-09-15 18:33:13 -07:00
committed by wmayer
parent cb2afd5a98
commit 99e844863f
2 changed files with 64 additions and 28 deletions

View File

@@ -877,9 +877,13 @@ class TaskPanel:
def modelRotate(self, axis):
angle = self.form.modelRotateValue.value()
with selectionEx() as selection:
bb = PathStock.shapeBoundBox([sel.Object for sel in selection])
for sel in selection:
Draft.rotate(sel.Object, angle, bb.Center, axis)
if self.form.modelRotateCompound.isChecked() and len(selection) > 1:
bb = PathStock.shapeBoundBox([sel.Object for sel in selection])
for sel in selection:
Draft.rotate(sel.Object, angle, bb.Center, axis)
else:
for sel in selection:
Draft.rotate(sel.Object, angle, sel.Object.Shape.BoundBox.Center, axis)
def alignSetOrigin(self):
(obj, by) = self.alignMoveToOrigin()
@@ -1020,6 +1024,7 @@ class TaskPanel:
self.form.modelSetZ0.setEnabled(True)
self.form.modelMoveGroup.setEnabled(True)
self.form.modelRotateGroup.setEnabled(True)
self.form.modelRotateCompound.setEnabled(len(sel) > 1)
else:
self.form.modelSetX0.setEnabled(False)
self.form.modelSetY0.setEnabled(False)