rename setting vars for outline -> edges
This commit is contained in:
parent
9328e17381
commit
2ed2571759
4 changed files with 16 additions and 21 deletions
|
|
@ -918,7 +918,7 @@ const conf = exports({
|
||||||
autoLayout: true,
|
autoLayout: true,
|
||||||
spaceRandoX: false,
|
spaceRandoX: false,
|
||||||
spaceLayout: 1,
|
spaceLayout: 1,
|
||||||
outline: 20,
|
edgeangle: 20,
|
||||||
units: "mm",
|
units: "mm",
|
||||||
exportOcto: false,
|
exportOcto: false,
|
||||||
exportGhost: false,
|
exportGhost: false,
|
||||||
|
|
@ -955,7 +955,7 @@ const conf = exports({
|
||||||
widget: {},
|
widget: {},
|
||||||
// legacy localStorage settings (like octo print)
|
// legacy localStorage settings (like octo print)
|
||||||
local: {
|
local: {
|
||||||
'model.outline': false,
|
'model.edges': false,
|
||||||
'cam.anim.model': false,
|
'cam.anim.model': false,
|
||||||
'cam.anim.stock': false,
|
'cam.anim.stock': false,
|
||||||
'cam.anim.speed': 3
|
'cam.anim.speed': 3
|
||||||
|
|
|
||||||
|
|
@ -1711,7 +1711,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
lineType: newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
|
lineType: newSelect(LANG.op_line_s, {title: LANG.op_line_l, action: lineTypeSave, modes:FDM}, "linetype"),
|
||||||
animesh: newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"),
|
animesh: newSelect(LANG.op_anim_s, {title: LANG.op_anim_l, action: aniMeshSave, modes:CAM}, "animesh"),
|
||||||
units: newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM}, "units"),
|
units: newSelect(LANG.op_unit_s, {title: LANG.op_unit_l, action: unitsSave, modes:CAM}, "units"),
|
||||||
outline: newInput(LANG.op_spoa_s, {title:LANG.op_spoa_l, convert:toFloat, size:3}),
|
edgeangle: newInput(LANG.op_spoa_s, {title:LANG.op_spoa_l, convert:toFloat, size:3}),
|
||||||
_____: newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}),
|
_____: newGroup(LANG.lo_menu, $('prefs-lay'), {inline: true}),
|
||||||
autoSave: newBoolean(LANG.op_save_s, booleanSave, {title:LANG.op_save_l}),
|
autoSave: newBoolean(LANG.op_save_s, booleanSave, {title:LANG.op_save_l}),
|
||||||
autoLayout: newBoolean(LANG.op_auto_s, booleanSave, {title:LANG.op_auto_l}),
|
autoLayout: newBoolean(LANG.op_auto_s, booleanSave, {title:LANG.op_auto_l}),
|
||||||
|
|
@ -2657,15 +2657,10 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
$('rot_z_lt').onclick = () => { api.selection.rotate(0,0, d * $('rot_z').value) };
|
$('rot_z_lt').onclick = () => { api.selection.rotate(0,0, d * $('rot_z').value) };
|
||||||
$('rot_z_gt').onclick = () => { api.selection.rotate(0,0,-d * $('rot_z').value) };
|
$('rot_z_gt').onclick = () => { api.selection.rotate(0,0,-d * $('rot_z').value) };
|
||||||
// rendering options
|
// rendering options
|
||||||
$('render-edges').onclick = () => { api.view.outline({ toggle: true }); api.conf.save() };
|
$('render-edges').onclick = () => { api.view.edges({ toggle: true }); api.conf.save() };
|
||||||
$('render-ghost').onclick = () => { api.view.wireframe(false, 0, api.view.is_arrange() ? 0.4 : 0.25); };
|
$('render-ghost').onclick = () => { api.view.wireframe(false, 0, api.view.is_arrange() ? 0.4 : 0.25); };
|
||||||
$('render-wire').onclick = () => { api.view.wireframe(true, 0, api.space.is_dark() ? 0.25 : 0.5); };
|
$('render-wire').onclick = () => { api.view.wireframe(true, 0, api.space.is_dark() ? 0.25 : 0.5); };
|
||||||
$('render-solid').onclick = () => { api.view.wireframe(false, 0, 1); };
|
$('render-solid').onclick = () => { api.view.wireframe(false, 0, 1); };
|
||||||
// mesh buttons
|
|
||||||
// $('mesh-swap').onclick = () => { api.widgets.replace() };
|
|
||||||
// $('mesh-enable').onclick = () => { api.selection.enable() };
|
|
||||||
// $('mesh-disable').onclick = () => { api.selection.disable() };
|
|
||||||
// $('mesh-rename').onclick = () => { api.widgets.rename() };
|
|
||||||
$('mesh-export-stl').onclick = () => { objectsExport('stl') };
|
$('mesh-export-stl').onclick = () => { objectsExport('stl') };
|
||||||
$('mesh-export-obj').onclick = () => { objectsExport('obj') };
|
$('mesh-export-obj').onclick = () => { objectsExport('obj') };
|
||||||
$('mesh-merge').onclick = api.selection.merge;
|
$('mesh-merge').onclick = api.selection.merge;
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ gapp.register("kiri.main", [], (root, exports) => {
|
||||||
update_speeds: updateSpeeds,
|
update_speeds: updateSpeeds,
|
||||||
hide_slices: hideSlices,
|
hide_slices: hideSlices,
|
||||||
snapshot: null,
|
snapshot: null,
|
||||||
outline: setOutline,
|
edges: setEdges,
|
||||||
unit_scale: unitScale,
|
unit_scale: unitScale,
|
||||||
wireframe: setWireframe,
|
wireframe: setWireframe,
|
||||||
},
|
},
|
||||||
|
|
@ -388,14 +388,14 @@ gapp.register("kiri.main", [], (root, exports) => {
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setOutline(bool) {
|
function setEdges(bool) {
|
||||||
if (bool && bool.toggle) {
|
if (bool && bool.toggle) {
|
||||||
api.local.toggle('model.outline');
|
api.local.toggle('model.edges');
|
||||||
} else {
|
} else {
|
||||||
api.local.set('model.outline', bool);
|
api.local.set('model.edges', bool);
|
||||||
}
|
}
|
||||||
bool = api.local.getBoolean('model.outline');
|
bool = api.local.getBoolean('model.edges');
|
||||||
api.widgets.each(w => w.setOutline(bool));
|
api.widgets.each(w => w.setEdges(bool));
|
||||||
SPACE.update();
|
SPACE.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -892,23 +892,23 @@ gapp.register("kiri.main", [], (root, exports) => {
|
||||||
setVisibleLayer();
|
setVisibleLayer();
|
||||||
setWidgetVisibility(true);
|
setWidgetVisibility(true);
|
||||||
api.widgets.opacity(1);
|
api.widgets.opacity(1);
|
||||||
api.view.outline(api.local.getBoolean('model.outline'));
|
api.view.edges(api.local.getBoolean('model.edges'));
|
||||||
break;
|
break;
|
||||||
case VIEWS.SLICE:
|
case VIEWS.SLICE:
|
||||||
$('act-slice').classList.add('selected');
|
$('act-slice').classList.add('selected');
|
||||||
updateSpeeds();
|
updateSpeeds();
|
||||||
updateSliderMax();
|
updateSliderMax();
|
||||||
setWidgetVisibility(true);
|
setWidgetVisibility(true);
|
||||||
!isCAM && api.view.outline(false);
|
!isCAM && api.view.edges(false);
|
||||||
break;
|
break;
|
||||||
case VIEWS.PREVIEW:
|
case VIEWS.PREVIEW:
|
||||||
$('act-preview').classList.add('selected');
|
$('act-preview').classList.add('selected');
|
||||||
setWidgetVisibility(true);
|
setWidgetVisibility(true);
|
||||||
!isCAM && api.view.outline(false);
|
!isCAM && api.view.edges(false);
|
||||||
break;
|
break;
|
||||||
case VIEWS.ANIMATE:
|
case VIEWS.ANIMATE:
|
||||||
$('act-animate').classList.add('selected');
|
$('act-animate').classList.add('selected');
|
||||||
!isCAM && api.view.outline(false);
|
!isCAM && api.view.edges(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log("invalid view mode: "+mode);
|
console.log("invalid view mode: "+mode);
|
||||||
|
|
|
||||||
|
|
@ -828,7 +828,7 @@ class Widget {
|
||||||
return Date.now() - mark;
|
return Date.now() - mark;
|
||||||
}
|
}
|
||||||
|
|
||||||
setOutline(set) {
|
setEdges(set) {
|
||||||
if (!(api && api.conf)) {
|
if (!(api && api.conf)) {
|
||||||
// missing api features in engine mode
|
// missing api features in engine mode
|
||||||
return;
|
return;
|
||||||
|
|
@ -844,7 +844,7 @@ class Widget {
|
||||||
}
|
}
|
||||||
if (set) {
|
if (set) {
|
||||||
let dark = api.space.is_dark();
|
let dark = api.space.is_dark();
|
||||||
let angle = api.conf.get().controller.outline || 20;
|
let angle = api.conf.get().controller.edgeangle || 20;
|
||||||
let edges = new THREE.EdgesGeometry(mesh.geometry, angle);
|
let edges = new THREE.EdgesGeometry(mesh.geometry, angle);
|
||||||
let material = new THREE.LineBasicMaterial({ color: 0 });
|
let material = new THREE.LineBasicMaterial({ color: 0 });
|
||||||
this.outline = new THREE.LineSegments(edges, material);
|
this.outline = new THREE.LineSegments(edges, material);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue