Adding a Loop to my Camera Flow
Hickmat 100000QA3T Visits (336)
So after creating a basic loop flow last night I though I'd try it out in anger in my Motion Camera Flow. Using the Import from clipboard function I pulled my Loop code from my last post into the motion camera flow from 2 posts ago.
My first test was just to wire the Loop flow in to replace the "Inject" node used in the original flow. This highlighted a potential issue in that the loop seemed to flood my Node environment with messages causing the camera flow to stall or even appear to not execute at all. Based on this knowledge I create a couple of functions to set my loop control variable in a way similar to a semaphore.
Once this amendment wss in place I started to test my flow again. This time the loop was stopped but didn't re-start... Hmmmm... A little bit of digging showed that I had wired the outputs from my "Loop" function the wrong way around. With this fixed it was back to testing again. Third time lucky I hoped... Well I was wrong This time I found that having the "Pause" node set to 100 milliseconds still flooded my Node environment despite the use of the semaphore approach. So I turned this up to 200 milliseconds and this time it worked.
I still have some testing to do but just now its looking promising. The flow now looks like:
and the JSON source for the flow: