On 23/09/2014 at 12:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;
---------
Hey Guys,
When making organic models like humans and monsters. We mostly use edge selections to create UV pelt maps to unwrap the UV's. And often it's quite hard to select the points of feet and hands.
There's usually some points that are buried and not easy to select them. And most of the time the C4D loop tools in C4D don't let me select them. Because they can't deal with the topology variations.
And Grow Selection grows in all directions. Not just in one direction. So that's not an option either.
So I have created a custom method that allows me to grow select edge loops in one direction. It's actually pretty slick.:slightly_smiling_face:
But the problem is this method does a lot of analyzing inside of it. And it requires more time to execute than the average method.
There's a loop in it that I jump back to several times until the correct vertice is found and selected.
So what happens is it works perfect if I run the method manually. But if try to run the method consecutively several times in a loop. It messes up, and I don't get good results from it.
I'm guessing that is because the method doesn't have enough time to finish before being called again.
Is there a way to give a method more time to finish without using threading?
something like this?
//My custom method
LONG GetNextPoint()
{
//Code that finds the next point along X
//Does quite a lot of analyzing and thinking (very time consuming)
}
Bool SimplePlugin::Execute(BaseDocument *doc)
{
for(LONG i=0; i<10; i++)
{
GetNextPoint();
Wait for 5 seconds before running GetNextPoint() again in the next iteration
}
EventAdd();
return TRUE;
}
I've tried various types of sleeping and timers. But they never seem to work. They don't let the method finish working.
Am I forced to use threading?
I'd rather not do that if I can avoid it.
-ScottA