Page 1 of 1

Random item from Image Resource

Posted: Fri Jul 18, 2025 03:54
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.

Re: Random item from Image Resource

Posted: Mon Jul 21, 2025 23:36
by tijnisfijn
Hi, you are unfortunately correct in thinking that's not very easily done at the moment and that's indeed to be tough because the image resources are always in attribute. Slow and attribute slow is something that you can't change dynamically wire has to rebuild every time you change a attribute there is sort of a workaround that you can do like this.

--begin-wire-patch--
1649.3oc6b0zaiaCD8uxBcpEvLQ7CQIkaJ1wE6gtsX6VzC6FTPaQGysxRtRT4iMv+26PIYa4XGE6lrEEBbuDYsCGxYlmHAdOM5QmoYooxoZUVZgyEe9QmY4YKfKHCbxJ0KK0tNWOvQmA2hN.LNIo1XmqWMXiwr0FuwV2ANpz5Q2xN28cp2AM7.yN2L6oZgJUluis7m2o3cLzaeC8O3r6evXWkFKueG6n6aW.X2BwMRvtqa78ujGCq3Kdz4l7rxkPR9wUCbxyxz046zrXoyErUficVH0BikhR87LXLNNPPKzxaxxev4hzxjjANwxkIYOrPlp+jH+Fo1X+jbQ5z401mJV.9y4OT4R3W2JyKLUKvnEhuZ7IDbKTolqHv5eoPaFn6pUFOWLMWsrp5V4pXUwxDwCen1ivMTwvzploLwiyT2YATg.ihwrYHF2mfD9jXzzYg9SBiwghPyJHQMUlVHGqRZbRyM150EBUR8UY4paTohj25H6uKEIJMjBoj.O.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GgtjywHWRzkW44MzmLd7aInuAkrFPrsl2tfUWSpS7OM61j.2ji1hgGaJLu68c28Ddem67EpeHkG3GPbYTlmuKcaivbJ6AW01YO6zTcbSsQmfWKTeS14gXltJB9+bOht0wbe7KZ2KBQa1Xl6yOFHZj6n.DiDFgh77BP7vKG5ELxcDi30FhheSaVmmrG6Sy4Mo00Yt0YlsnxetLQqVl7PmnR9gTkccaJZEk0JJqUTVqnrVQYshxZEk0JJqUTVqnrVQYshxZEk0JJqUTVqnrVQYshxZEk0JJauWT1FBQOMMYWOnSTb0iVTfS8CREg9BZOhIszdjFgiBOf1ijWs1iGHYtW5pIMrkL6eqgq6mkHa+uqxqfcOivHgd9XrG1mRogAr+05qbjeYxN15a3wIyFcXX.hwGxPQgXNx2MB9wXhG0M3+RMLZB9VB.ahwNKsAG36NV0SKun9D8BJNNLP.yNP+BxX3i40LfxCnHla3knfgAgHFMZbzUQgQjKcaCEnmNTXaxnSkz2AwrYHOosB6.SXDyVUoUEXed02bRH7o9UAOhyOCxGeKy7QtrR9Q4ltL7yNFvtuiQ3KyqVfosDMeX6LxyNvw7Yzb0+..FAOVK
--end-wire-patch--

But it's still really a workaround because it's still not a dynamic thing. You can't automate it in arena. It is definitely something that we have somewhere in our list of things we want, but I can't give you a ETA.

In the meantime, you can watch this tutorial to get to know a bit more about the different flow types
phpBB [video]

Re: Random item from Image Resource

Posted: Tue Jul 22, 2025 00:04
by vidumami
Thank you for the tutorial link, I've had fun with Wire so far but I know I have a lot to learn.

How can I open the example patch for the workaround in Wire Editor?

Re: Random item from Image Resource

Posted: Tue Jul 22, 2025 01:12
by tijnisfijn
You can just copy the patch and paste it inside wire. you have to add the images yourself, though it did not include those. Have fun if you have more questions don't hesitate to ask.