add right click to set camera focus
This commit is contained in:
parent
bfc99c0155
commit
cd81d6052f
6 changed files with 18 additions and 2 deletions
|
|
@ -470,6 +470,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function setFocus() {
|
||||
let int = contextInt[0];
|
||||
if (int && int.object && int.object.widget) {
|
||||
API.space.set_focus(undefined, int.point);
|
||||
}
|
||||
}
|
||||
|
||||
function duplicateSelection() {
|
||||
API.selection.for_widgets(function(widget) {
|
||||
let mesh = widget.mesh;
|
||||
|
|
@ -2530,6 +2537,7 @@
|
|||
$('context-duplicate').onclick = duplicateSelection;
|
||||
$('context-mirror').onclick = mirrorSelection;
|
||||
$('context-layflat').onclick = layFlat;
|
||||
$('context-setfocus').onclick = setFocus;
|
||||
|
||||
UI.modal.onclick = API.modal.hide;
|
||||
UI.modalBox.onclick = (ev) => { ev.stopPropagation() };
|
||||
|
|
|
|||
|
|
@ -389,7 +389,12 @@
|
|||
work: KIRI.work
|
||||
};
|
||||
|
||||
function setFocus(widgets) {
|
||||
function setFocus(widgets, point) {
|
||||
if (point) {
|
||||
SPACE.platform.setCenter(point.x, point.z, point.y);
|
||||
SPACE.view.setFocus(new THREE.Vector3(point.x, point.y, point.z));
|
||||
return;
|
||||
}
|
||||
if (widgets === undefined) {
|
||||
widgets = WIDGETS;
|
||||
} else if (!Array.isArray) {
|
||||
|
|
|
|||
|
|
@ -636,7 +636,7 @@
|
|||
|
||||
subst.material = UTIL.round(emitted,2);
|
||||
subst.time = UTIL.round(time,2);
|
||||
subst['print-time'] = subst.time;
|
||||
subst['print_time'] = subst.time;
|
||||
|
||||
append("; --- shutdown ---");
|
||||
appendAllSub(device.gcodePost);
|
||||
|
|
|
|||
Loading…
Reference in a new issue