Random item from Image Resource

Post your awesome Wire patches here, share tutorials
Post Reply
vidumami
Posts: 4
Joined: Thu Mar 28, 2024 23:04

Random item from Image Resource

Post by vidumami »

I looked through the forum and I'm probably trying to do something in Wire that is not possible, but asking here anyway.
  • I have an Image Resource node with 48 instances. Each instance is a link to a .jpg file.
  • I want to output an image that is randomly-selected from the instances.
  • I looked at the Resource Nodes example patch and learned that in order to choose from multiple instances of the Image Resource you need to use the Attribute Index Flow in the Read node. If you try to attach a node that outputs integers (like Random) the Read node breaks the connection to the Texture Out node.
  • This precludes being able to programmatically output instance on the fly (I think?).
Is there another way I could use the Image Resource node to output random items?

I know I can load all the images into my patch via Image nodes and randomly select them via the Gate node but I was hoping I could do it in a neater/more elegant way.

Also, is there a tutorial on the differences between the Event, Signal, and Attribute flows? I couldn't find one in the list of example patches.

Post Reply