mega brain fart- structure render

gtoledo3's picture

I'm having a difficult time retrofitting my typical javascript queue, so that I can create keys instead of indexes.

When I create javascript patch for test, it sees to deliver the right keys.... but it doesn't work correctly as far as I can tell. The variable don't come in the right order (which shouldn't make a difference, because the patch should just be searching out keys, imo).

Reference the 1st attachment, Structure Transform Javascript Patch.

It bears noting that if I send it a structure index 1, 2, 3, it properly decodes to x, y, z without any shenanigans. I used the structure make patch (extremely rare for me), and I got the same results.

So, what I'm aiming to do, is to take these Keyed Variables and put them in a Javascript Queue that I normally setup for indexes. At first I tried to simply setup a queue with 9 inputs, and hoped that they would line up/work correctly with the patch, regardless of keys, but I'm not getting that kind of result. I know how to make a value a key in Javascript, but I'm having a heck of a time making it work

Structure Transform Javascript Test.qtz1.15 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.'s picture
Re: mega brain fart- structure render

I went through the same question yesterday when I made the three demo JS patches for handling 2D dictionaries. I didn't get it but I tried again when you posted this.

I wanted to code: my_array.push = ("X":.15, "Y":.45, "Z":0.0)

this was an amalgam of the correct lines which I just worked out:

   point = new Object  // optional
   point = {"X":.15, "Y":.45, "Z":0.0}
   n = my_array.push(point)

Fixed comp attached (if I am right in thinking this is what you need).

Structure_Transform_Javascript_Test.qtz4.27 KB's picture
Re: mega brain fart- structure render

Nicer inputs to JS patch:

Structure_Transform_Javascript_Test_i.qtz4.33 KB

gtoledo3's picture
Re: mega brain fart- structure render

Thanks. The fact that I had to make the transform array was eluding my last night.