How to pick multiple objects in Spark AR Studio.
Say we have more than 5 objects that we need to keep track of. They have their own properties—like size, position, scale and material—that get updated when certain events happen—like an object tap. Keeping track of which object is selected or “active” and which is not can become complex in the Patch Editor.
5 or fewer Option Switch
For 5 or fewer options or objects, the Option Switch and Option Picker sent to Equals Exactly patches works well.
In order to expand these options while isolating the active option, we have to test to make sure every other option is not active.
As the number of options increases, so does the complexity in determining which option is active and which is not.
5 or more And Multiplexer
The And Multiplexer is a patch that takes many inputs and produces single output; a boolean signal that lets us know which object is selected.
Inputs & Output
This method of object selection uses an “And” tree to test against other possible options.
Master On
A pulse sent to the “Master On” input will make the boolean signal true. This is the object we are testing for. If a pulse is received at this input, it will output a true signal; letting us know that this object or option is selected.
Turn Off
A pulse sent to any of “Turn Off” inputs will make the boolean signal false.
Patch Diagram
For each object or option you want to select, add the And Multiplexer patch to test for that object and test against all other options and objects.
Thanks for this amzing blog, I sincerer agreed with everything you said, I will be viisting again .Once again thanks for an amazin blog
Greetings! Very useful advice in this particular post!
It is the little changes that make the biggest changes.
Thanks for sharing!
Keep this going please, great job!