ghost mode in slice/preview uses gray instead of a color to better show lines
This commit is contained in:
parent
6febda7df2
commit
837f584907
3 changed files with 15 additions and 7 deletions
|
|
@ -2633,8 +2633,8 @@
|
||||||
$('rot_z_gt').onclick = () => { API.selection.rotate(0,0,-d) };
|
$('rot_z_gt').onclick = () => { API.selection.rotate(0,0,-d) };
|
||||||
// rendering options
|
// rendering options
|
||||||
$('render-hide').onclick = () => { API.view.wireframe(false, 0, 0); };
|
$('render-hide').onclick = () => { API.view.wireframe(false, 0, 0); };
|
||||||
$('render-ghost').onclick = () => { API.view.wireframe(false, 0, 0.5); };
|
$('render-ghost').onclick = () => { API.view.wireframe(false, 0, API.view.isArrange() ? 0.5 : 0.25); };
|
||||||
$('render-wire').onclick = () => { API.view.wireframe(true, 0, 0.5); };
|
$('render-wire').onclick = () => { API.view.wireframe(true, 0, API.space.isDark() ? 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 buttons
|
||||||
$('mesh-heal').onclick = () => { API.widgets.heal() };
|
$('mesh-heal').onclick = () => { API.widgets.heal() };
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,8 @@
|
||||||
clear: clearWorkspace,
|
clear: clearWorkspace,
|
||||||
save: saveWorkspace,
|
save: saveWorkspace,
|
||||||
set_focus: setFocus,
|
set_focus: setFocus,
|
||||||
update: SPACE.update
|
update: SPACE.update,
|
||||||
|
isDark() { return settings.controller.dark }
|
||||||
},
|
},
|
||||||
tweak,
|
tweak,
|
||||||
util: {
|
util: {
|
||||||
|
|
@ -398,14 +399,14 @@
|
||||||
b64dec: obj => { return JSON.parse(new TextDecoder().decode(base64js.toByteArray(obj))) }
|
b64dec: obj => { return JSON.parse(new TextDecoder().decode(base64js.toByteArray(obj))) }
|
||||||
},
|
},
|
||||||
view: {
|
view: {
|
||||||
get: function() { return viewMode },
|
get() { return viewMode },
|
||||||
set: setViewMode,
|
set: setViewMode,
|
||||||
update_slider: updateSlider,
|
update_slider: updateSlider,
|
||||||
update_fields: updateFields,
|
update_fields: updateFields,
|
||||||
wireframe: setWireframe,
|
wireframe: setWireframe,
|
||||||
snapshot: null,
|
snapshot: null,
|
||||||
unit_scale: unitScale,
|
unit_scale: unitScale,
|
||||||
isArrange: function() { return viewMode === VIEWS.ARRANGE }
|
isArrange() { return viewMode === VIEWS.ARRANGE }
|
||||||
},
|
},
|
||||||
widgets: {
|
widgets: {
|
||||||
map: function() {
|
map: function() {
|
||||||
|
|
|
||||||
|
|
@ -501,14 +501,16 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
||||||
/**
|
/**
|
||||||
* @param {number} color
|
* @param {number} color
|
||||||
*/
|
*/
|
||||||
PRO.setColor = function(color,settings) {
|
PRO.setColor = function(color, settings, save = true) {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
console.trace('legacy call with settings');
|
console.trace('legacy call with settings');
|
||||||
}
|
}
|
||||||
if (Array.isArray(color)) {
|
if (Array.isArray(color)) {
|
||||||
color = color[this.getExtruder() % color.length];
|
color = color[this.getExtruder() % color.length];
|
||||||
}
|
}
|
||||||
this.color = color;
|
if (save) {
|
||||||
|
this.color = color;
|
||||||
|
}
|
||||||
let material = this.mesh.material;
|
let material = this.mesh.material;
|
||||||
material.color.set(color);
|
material.color.set(color);
|
||||||
};
|
};
|
||||||
|
|
@ -953,6 +955,11 @@ console.log/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
|
||||||
let wire = widget.wire = new THREE.LineSegments(geo, mat);
|
let wire = widget.wire = new THREE.LineSegments(geo, mat);
|
||||||
mesh.add(wire);
|
mesh.add(wire);
|
||||||
}
|
}
|
||||||
|
if (KIRI.api.view.get() === KIRI.conf.VIEWS.ARRANGE) {
|
||||||
|
this.setColor(this.color);
|
||||||
|
} else {
|
||||||
|
this.setColor(0x888888,undefined,false);
|
||||||
|
}
|
||||||
if (opacity !== undefined) {
|
if (opacity !== undefined) {
|
||||||
widget.setOpacity(opacity);
|
widget.setOpacity(opacity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue