The above code is something that I use in my projects; really a simple loop that when it finds a 0 automatically breaks and returns a 0
If all passes it will return a 1.
Please be aware that you need to make that your values are either 0 or 1
Hi all!
// You can customize the names of your inputs and outputs using comments
// like the ones below. Click the "Help" button and read "Customizing
// Input and Output Names" to learn more.
// iz_input 1 "input 1"
// iz_output 1 "all true"
function main()
{
for (let i = 0; i < arguments.length; i++) {
var value = arguments[i]
if (value == 0) {
return 0
}
}
return 1
}
Hi,
Here is a non-javascript solution if that is of use. I modified a macro from a current patch I am working on.
It returns 1 if all inputs are 1 otherwise another value in any input returns a 0.
Best Wishes,
Russell
@dusx thanks for helping. I get anther error, unfortunately.
Hi Nic,
You simply need to break the continous loop. So adding an actor connected to the stream and leave the output open.
This will cause Isadora to accept it.
Ah, this now works after restarting Isadora. Perhaps it might be useful to others, so I'll leave it posted.
Nic
Hello everyone,
I know it's 'illegal' in Isadora to take the numerical output of an actor and feed it back into its input, but is there any way around this? I know you can do it with a video signal. I'm trying to do a little bit of sequential processing which needs a certain amount of feedback from the output. Is there a 'cheat' way around this?
Here's my scene which uses feedback to apply different degrees of smoothing to an input depending on whether it is moving up (input value > output value) or moving down (input value < output value). It works fine, until I connect the input to part of my scene which generates the input, on which point it stops working.
thanks, Nic
@woland The Legacy Rokoko Studio does not display an Isadora option for live streaming as it used to...
@woland I have just sent a ticket, thanks for the quick reply!
try this:
// You can customize the names of your inputs and outputs using comments // like the ones below. Click the "Help" button and read "Customizing // Input and Output Names" to learn more. // iz_input 1 "input 1" // iz_output 1 "output 1" function checkValues(vals) { // Convert arguments object to a real array const values = Array.from(vals); //print(values);// Check if all values in the array are exactly 1 const allOnes = values.every(value => value === 1); //print(allOnes); // Return 1 if all values are 1, otherwise return 0 return allOnes ? 1 : 0;
}
function main()
{
return checkValues(arguments);
}