From 5fd4683e4128c00c10867136a5b02945f0e9951e Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 30 Nov 2020 10:59:24 -0500 Subject: [PATCH] add tool position to animation. bump rev 2.4.d9 --- package.json | 2 +- src/kiri/init.js | 2 +- src/license.js | 2 +- src/mode/cam/animate.js | 13 +++++++++++++ src/mode/cam/client.js | 1 + web/kiri/index.css | 27 +++++++++++++++++++++++++++ web/kiri/index.html | 3 ++- 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d1919387..9d84e3ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "2.4.8D", + "version": "2.4.9D", "description": "grid.space 3d slice & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/src/kiri/init.js b/src/kiri/init.js index 340d5c51..9b968112 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1637,7 +1637,7 @@ ], {modes:CAM, class:"ext-buttons f-row"}), camSep1: UC.newGroup(null, null, {modes:CAM, class:"set-sep"}), - camStock: UC.newGroup(LANG.cs_menu, null, {modes:CAM}), + camStock: UC.newGroup(LANG.cs_menu, null, {modes:CAM, marker: true}), camStockX: UC.newInput(LANG.cs_wdth_s, {title:LANG.cs_wdth_l, convert:UC.toFloat, bound:UC.bound(0,9999), modes:CAM, units:true}), camStockY: UC.newInput(LANG.cs_dpth_s, {title:LANG.cs_dpth_l, convert:UC.toFloat, bound:UC.bound(0,9999), modes:CAM, units:true}), camStockZ: UC.newInput(LANG.cs_hght_s, {title:LANG.cs_hght_l, convert:UC.toFloat, bound:UC.bound(0,9999), modes:CAM, units:true}), diff --git a/src/license.js b/src/license.js index 31065a35..e8eba713 100644 --- a/src/license.js +++ b/src/license.js @@ -3,7 +3,7 @@ let terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: "2.4.D8" + VERSION: "2.4.D9" }; if (typeof(module) === 'object') { diff --git a/src/mode/cam/animate.js b/src/mode/cam/animate.js index 4f6a68c4..bb737f82 100644 --- a/src/mode/cam/animate.js +++ b/src/mode/cam/animate.js @@ -8,6 +8,7 @@ self.kiri.loader.push(function() { CAM = KIRI.driver.CAM, API, WORLD, SPACE, meshes = {}, + toolPosX, toolPosY, toolPosZ, speedValues = [ 25, 12, 6, 3 ], speedNames = [ "1x", "2x", "4x", "8x" ], speedIndex = 0, @@ -22,6 +23,7 @@ self.kiri.loader.push(function() { SPACE = (API = api).const.SPACE; WORLD = SPACE.platform.world; $('layer-animate').innerHTML = ''; + $('layer-toolpos').innerHTML = ''; Object.keys(meshes).forEach(id => deleteMesh(id)); } @@ -50,6 +52,12 @@ self.kiri.loader.push(function() { setTimeout(() => { play({steps: 1}); }, delay || 0); + const toolpos = $('layer-toolpos'); + toolpos.innerHTML = ''; + UC.setGroup(toolpos); + toolPosX = UC.newInput('x', {disabled: true, size: 7}); + toolPosY = UC.newInput('y', {disabled: true, size: 7}); + toolPosZ = UC.newInput('z', {disabled: true, size: 7}); }); }; @@ -87,6 +95,11 @@ self.kiri.loader.push(function() { mesh.position.y = pos.y; mesh.position.z = pos.z; SPACE.update(); + if (id !== 0) { + toolPosX.value = pos.x.toFixed(2); + toolPosY.value = pos.y.toFixed(2); + toolPosZ.value = pos.z.toFixed(2); + } } } if (data.mesh_update) { diff --git a/src/mode/cam/client.js b/src/mode/cam/client.js index 5564a28f..f0e90847 100644 --- a/src/mode/cam/client.js +++ b/src/mode/cam/client.js @@ -56,6 +56,7 @@ api.ui.camContour.marker.style.display = proc.camContourXOn || proc.camContourYOn ? 'flex' : 'none'; api.ui.camTracing.marker.style.display = proc.camTraceOn ? 'flex' : 'none'; + api.ui.camStock.marker.style.display = proc.camStockOn ? 'flex' : 'none'; updateStock(settings, 'settings.saved.internal'); }); diff --git a/web/kiri/index.css b/web/kiri/index.css index 2654690d..054e590d 100644 --- a/web/kiri/index.css +++ b/web/kiri/index.css @@ -899,11 +899,38 @@ th, tr, td, label { border-radius: 3px; border: 1px solid #aaa; margin: 1px 2px 2px 4px; + padding: 2px; justify-content: center; align-items: center; font-weight: bold; background-color: #ddd; } +#layer-toolpos { + position: absolute; + right: 3px; + bottom: 3px; +} +#layer-toolpos label, #layer-toolpos input { + display: inline-flex; + height: 30px; + border-radius: 3px; + border: 1px solid #ccc; + justify-content: center; + align-items: center; + font-weight: bold; + background-color: #ddd; +} +#layer-toolpos label { + width: 30px; + padding: 1px 1px 1px 1px; + margin: 1px 1px 2px 6px; +} +#layer-toolpos input { + background-color: #eee; + font-family: monospace; + padding: 1px 4px 1px 4px; + margin: 1px 1px 2px 1px; +} #slider { display: none; diff --git a/web/kiri/index.html b/web/kiri/index.html index f6313961..ed7086ab 100644 --- a/web/kiri/index.html +++ b/web/kiri/index.html @@ -385,13 +385,14 @@
alerts
alerts
alerts
-

this site uses cookies to preserve application preferences

+
+