|
Save Interaction PositionsAny solution to date for out of order structures with file tools? This qtz uses Kineme File Tools, and .plist files are saved in order, but out of order when read by Struct From File. (Old story, afaik). I was wondering if there's a way with Kineme Data Tools, now that it can save Sample & Hold data with the comp. I can't see how.
|
use a "key" in your structure. Later, refer to each element by "key" instead of index.
hmm, thanks, but can't get it. i can produce keyed sub-structures. for ex., this javascript and interaction are inside an iterator:
this produces an ordered structure which gets jumbled when read back in to the comp. (see screenshots). (EDIT: updated screenshots). how could i do what is suggested?
I'm looking into one of usefuldesign's js demos with some sorting suggestions. Maybe folks have resolved this. I have asked similar question before but i still don't have a clear solution for sorting a .plist structure dictionary with integer key values when members get out of order.
It really doesn't matter if the order is jumbled. You just choose to poll the object using the key not the index.
See attached demo.
I might have once suggested this is infact a problem I while back when I first banged my head against this (non)'problem', BTW ;-)
Also you can add a bit more life to your comp))
I think order jumble may be a problem if one is trying to draw triangle strips with the resulting data, but not if each point is "it's own thing". I may be wrong about that triangle strip thing, but it sure seems like it... I'll test. Just mentioning this in case someone tries something with tri-strip or mesh creator and goes "but it was supposed to work" :-)
If you really want to un-jumble a QC structure object you can do it in JS by iterating though the structure and transposing each item to an element inside an array. Then output the resultant array.
Pretty sure I've post eg comp on a few threads on Kineme. My demo comp folder is too big for me to find it though.
Sidenote: Kineme's Spotlight plugin never really seemed to log Note text inside compositions for me to the extent that I ever get a hit. I tested it with unique strings but wasn't sure if Spotlight needs to comb the HD as part of system maintenance before new results are available. I can't see any way to force a Spotlight update on a Drive/Folder/File either.
ahhh! way too easy! iterator variable index to key member threw me off. thanks, usefuldesign.au.
if you do find that example js for reassigning jumbled structures, it would be great to see it.
There is a "Kineme Structure Key", that returns Key value (Data Tools)... it seems like if Current Index was hooked to Index input on that patch, and then the result of that was used to feed the index of a Structure Index Member, that it would sort something into the right order, when using an iterator. Err... I really should test that, but it sure seems like it would work.
edit...hmm, I'm having a hard time generating a structure that gets read out of order to begin with.
Then look at my demo!
Ewwwww! Yeah, that's a pain!
So I see why I don't run into this as much- when you manually set index, things are fine, but generating it for a given count like that seems to screwup because it's always outputting keys that's don't get order.
One could use the kineme key from index connected to current index of iterator vars. I think the number output of that, hooked to structure index, would reorder it all correctly, in an iterator type setup. Kinda should test that, just theorizing....
.
....
Thanks for posting this with the inertia, voxdeserti. That's nice to see. I haven't explored those tools much.
Why did I think it was a bad idea to put a queue patch inside an iterator? Maybe because I wasn't careful about input/output and would end up with things like 5000 iterations of a 5000 member queue....
Now to the next js challenge here with the interaction inside the iterator patch:
Create the queue order (per iteration) then always keep the same order as structure members change values.
Yes, arrays make the QC structure indexes and keys the same. Objects give 'jumbled' impression: key is what you set, index is seemingly random. Not sure if random is correct word but there's seemingly no rhyme or reason as to how QC assigns the indexes.