From 266b5548cc6af07fa1bfddd205b30d7a337e1764 Mon Sep 17 00:00:00 2001 From: Salatiel <9287152+SalatielSauer@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:51:37 -0300 Subject: [PATCH] fix ogzeditor.image callback --- scripts/examples/ogzeditor_mri_helper.js | 4 ++-- scripts/jsocta_helpers.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/examples/ogzeditor_mri_helper.js b/scripts/examples/ogzeditor_mri_helper.js index 7376a17..0870e47 100644 --- a/scripts/examples/ogzeditor_mri_helper.js +++ b/scripts/examples/ogzeditor_mri_helper.js @@ -12,6 +12,6 @@ mapvars({ entities([]); -geometry(() => ogzeditor.image([0, ogzeditor.asset.frames.length], 35, 512, 512, 0, 0, 0, 90, 0, 1, 2, true, 3, (colors, position) => { - return (colors.heightValue >= 5); +geometry(() => ogzeditor.image([0, ogzeditor.asset.frames.length], 35, 512, 512, 0, 0, 0, 90, 0, 1, 2, true, 3, (pixel) => { + return (pixel.heightValue >= 5); })); \ No newline at end of file diff --git a/scripts/jsocta_helpers.js b/scripts/jsocta_helpers.js index 3d3e661..ea975d8 100644 --- a/scripts/jsocta_helpers.js +++ b/scripts/jsocta_helpers.js @@ -421,8 +421,10 @@ function _addImage( const localZ = oZ + offsetZ + (height - 1 - yIndex) * cubeSize; let callbackResult = callback( - { r, g, b, a, brightness, heightValue, width, height }, - { x: localX, y: localY, z: localZ, frameIndex} + { + r, g, b, a, brightness, heightValue, width, height, + x: localX, y: localY, z: localZ, frameIndex + } ); // "false" -> skip, "true" -> keep existing RGBA