Copy link to clipboard
Copied
I'm getting some strange glitches in my plugin I'm developing when using MFR.
This effect calls for many random numbers every frame to generate boxes and place them in random positions.
It's a relatively simple plugin so there's not much more to it than that. However, when caching for a preview, some frames have the boxes in the same position as the previous frame. If I disable MFR from Settings - > Preferences -> Memory & Performance it goes away and every frame has correct random box positions. So that's how I'm assuming it has to do with MFR.
I'm not using any out of the box functions just your bases srand() for see initialization and rand() for generating a new number.
I even tried a thread-safe random generator but the issue persists:
int intRand(const int & min, const int & max) { static thread_local std::mt19937 generator; std::uniform_int_distribution<int> distribution(min,max); return distribution(generator); }
Any ideas what could be causing this? Has anyone else had similar issues?
I should also say that it's the first bunch of frames that tend to have more issues and then they have fewer.
-Richard
Copy link to clipboard
Copied
possibly a re-entrancy issue.
is it possible that the value on which you base your srand() is being asynchronously overritten between the entry point and the call for srand()?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now