First try to vvvv plugin

Hi all;
I try to make a plugin to count from 0 to 10000 in a infinite loop.
it works in a console application…
but makes vvvv crash…
would you have any advice ? (I know that regulars nodes would do the job, but really want to learn :-)

namespace counter_vvvv
 {
[PluginInfo(Name = "counter_counter", Category = "premier_pas", AutoEvaluate = true)]

public class Class1 : IPluginEvaluate
{
    [Output("COUNTER_COUNTER")]
    ISpread<int> FPOutCounter;


    public void Evaluate(int SpreadMax)
    {
        FPOutCounter.SliceCount = 1;
        for (int i = 0; i < 10000; i++)
        {

            FPOutCounter[0] = i;
            if (i >9999)
            { i = 0; }
        }

    }
}

}

I think your loop never breaks to let vvvv go to the next frame, i.e. infinite loop. If you take out the if (i<9999) etc it will work, but then it would count from 0-10000 in 1 frame, and so just output that.
If you want it to count frames, take out the first for loop, and leave in the if, and add an i+1 in there and it should just count frames.

you’re right !
thanks !!

The same mistake as I made in my first plugin ;)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.