Forum

How to carry data in between Frames in a VL Class?

vl

#1

Hi,

i think i am missing some important concepts in dealing with custom data types in VL…

i intend to save some data in between frames in my custom datatype.
basically i want to detect activity throughout my individual tracking markers.
for this i want to save the positional data in a queue as a kind of a “movement history”.

if i put data into the queue in the mainloop, everything works as expected.
but when i put the same queue into my marker class i end up with only 1 entry.

i am not entirely sure what is going on there, maybe someone can elaborate a little on how to deal with data in pads in between frames and in between different operations that use the pad.

I am also wondering why i cannot get Velocity data from the Damper node when i put it into the class, whereas it works as expected when ran in the mainloop…

greetings,
clemens

buffer_quest.zip (8.4 KB)


#2

when there is only data of one frame, it often indicates that the instance get’s re-created every frame… hence all data inside has it’s initial value. so check outside (where you use your data type) whether you create the instance once then then keep the instance until the next frame in a pad, for example.

also there is something odd here:
image

you cannot pass data from update (gray) to create (white), create can only be called once per instance, update comes after, so your “frames” pad will have a value of 0 when the queue gets created.


#3

yaay… thanks!

when there is only data of one frame, it often indicates that the instance get’s re-created every frame… hence all data inside has it’s initial value. so check outside (where you use your data type) whether you create the instance once then then keep the instance until the next frame in a pad, for example.

i did not think of saving the whole object into a pad… although i should have known from the video particle video tutorial :>
my thinking was, that my queue in the pad of my class would exist through multiple frames once created…

only 1 element in thequeue:
fail
multiple elements in the queue:
no_fail


#4

yes, second image looks correct. if it is a class you don’t need to store it back after update, since the link does only transport a reference. putting the reference in a pad after create is enough. you only need to save it back when you use a record.