Part: fix handling of attachment offset rotation changes in attachment editor
This commit is contained in:
committed by
abdullahtahiriyo
parent
d94394bfc2
commit
28dcbc5185
@@ -388,15 +388,10 @@ class AttachmentEditorTaskPanel(FrozenClass):
|
||||
if index >= 0 and index <= 2:
|
||||
plm.Base = pos
|
||||
|
||||
rot = plm.Rotation;
|
||||
(yaw, pitch, roll) = rot.toEuler()
|
||||
if index==3:
|
||||
yaw = Q(self.form.attachmentOffsetYaw.text()).getValueAs(deg)
|
||||
if index==4:
|
||||
pitch = Q(self.form.attachmentOffsetPitch.text()).getValueAs(deg)
|
||||
if index==5:
|
||||
roll = Q(self.form.attachmentOffsetRoll.text()).getValueAs(deg)
|
||||
if index >= 3 and index <= 5:
|
||||
yaw = Q(self.form.attachmentOffsetYaw.text()).getValueAs(deg)
|
||||
pitch = Q(self.form.attachmentOffsetPitch.text()).getValueAs(deg)
|
||||
roll = Q(self.form.attachmentOffsetRoll.text()).getValueAs(deg)
|
||||
rot = App.Rotation(yaw,pitch,roll)
|
||||
plm.Rotation = rot
|
||||
|
||||
|
||||
@@ -455,19 +455,12 @@ void TaskAttacher::onAttachmentOffsetChanged(double /*val*/, int idx)
|
||||
pl.setPosition(pos);
|
||||
}
|
||||
|
||||
Base::Rotation rot = pl.getRotation();
|
||||
double yaw, pitch, roll;
|
||||
rot.getYawPitchRoll(yaw, pitch, roll);
|
||||
if (idx == 3) {
|
||||
yaw = ui->attachmentOffsetYaw->value().getValueAs(Base::Quantity::Degree);
|
||||
}
|
||||
if (idx == 4) {
|
||||
pitch = ui->attachmentOffsetPitch->value().getValueAs(Base::Quantity::Degree);
|
||||
}
|
||||
if (idx == 5) {
|
||||
roll = ui->attachmentOffsetRoll->value().getValueAs(Base::Quantity::Degree);
|
||||
}
|
||||
if (idx >= 3 && idx <= 5){
|
||||
double yaw, pitch, roll;
|
||||
yaw = ui->attachmentOffsetYaw->value().getValueAs(Base::Quantity::Degree);
|
||||
pitch = ui->attachmentOffsetPitch->value().getValueAs(Base::Quantity::Degree);
|
||||
roll = ui->attachmentOffsetRoll->value().getValueAs(Base::Quantity::Degree);
|
||||
Base::Rotation rot;
|
||||
rot.setYawPitchRoll(yaw,pitch,roll);
|
||||
pl.setRotation(rot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user