Get Point XY for Multi XY widget

Continuing the discussion from Multi XY current point selection:

I saw this topic but im not quite sure I understand. onTouch I want to get the current moving points XY position to send, instead of the entire array of points, since im working with ~30 points atm. And i'll only ever be moving one point at a time. So i dont need all the extra data that's being sent

In your case it could be something like this:

// onCreate
// keep a local track of which point is touched
locals.touched = {}
// onTouch
// update list of touched points
if (event.handle !== undefined) {
  locals.touched[event.handle] = event.type == 'start'
}
// onValue
// send a message for each point that's currently being touched
// set bypass to `true` if you want the original message to be bypassed (disables cross-client sync)
for (var n in locals.touched) {
  if (locals.touched[n]) {
    send('/multixy/point/' + n, value[2*n], value[2*n + 1])
  }
}

This is definitely the right direction but I dont think its giving me the XY of a specific point, at least from what I can see. Im sending the data to Unreal engine, im able to print the floats / ints for the message and im seeing a static value that doesnt change as I drag the point, the value changes per point and I can see the message matches which point im touching.

LogBlueprintUserMessages: String: /multixy/point/16
Integers: 0
Floats: -50

this is a log message from UE for example ^

but in OSC I have a text widget showing me the array for every value and I can see that point 16 is actually {-4365, 461} not -50 or just 0

There was a little mistake in the onValue script resulting in the wrong value point coordinates being returned, I edited my post to fix it.

1 Like