On 01/06/2014 at 15:58, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I`ve called a ProgressDialog from within my ObjectData plugin and trying to figure out how to properly update the progress.
In the sdk docs there`s an example and what this does is override the virtual Main() function and run a for/next loop inside it to demonstrate the progress bar updating..
This works fine but when i try a similar thing ( using my own custom percentage variable which is updated elsewhere in the plugin ) it only seems to read the value of the variable as it is when the ProgressDialog is initially instantiated - ie it`s not reading the updated value as it updates elsewhere.
Here`s an example of my Main() override:
void MyProgressDialog::Main(C4DThread *bt)
{
SetPercent(0.f);
while (progPercent != 1)
{
GePrint(RealToString(progPercent)); // only ever prints zero or whatever initial value i set,
SetPercent((Real) progPercent); // and doesnt recognise that progPercent is being updated elsewhere.
}
SetPercent(1.f);
}
To be honest im probably overlooking something obvious and maybe there
s an alternative to using While to check the variable, but any advice would be appreciated!