Displaying multiple objects with one parent image

Hey,

So I am starting a project that triggers object creation on beat detection, and I want the band of FFT to correspond to an image (so band 1 = image 1, band 2 = image 2 etc.)

I am using vectors to dynamically create the objects, but is there a way I can pass an image into these newly created objects in an efficient manner? Passing around ofImages seems to make it take a hit in the performance.

To give some context, I am currently using 3 bands, so 3 vectors, and the maximum entries they can have is 25. The images are also pngs that don’t exceed 2kb.

Thanks a lot

Hi there!

Usually is better if you share some code. That said, are you loading everything on setup? Or loading when you get a trigger?

you can pass pointers to a common image.

this example might help explain:

in the objects:

using it in the object:

passing it in

a pointer is not an object but rather a memory address where an object is (it’s similar to an alias to a file, not the actual file but a record of where the file is). You can pass around pointers to many objects because they are lightweight.

1 Like

Thank you both so much for getting back to me about this,

@hubris Yes the few images are loaded first on setup, and then I was passing the image into the child on trigger, which I could even see is kind of crazy haha

@zach this is exactly what I needed, thanks zach! I’ve wondered this a lot, and now I know. I just put it in the project and it works with no detriment to the frame rate whatsoever.

Thanks again, both of you