Skip to content
Snippets Groups Projects
Commit f8cc9a7e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

refine

parent ace80234
No related branches found
No related tags found
No related merge requests found
......@@ -213,7 +213,7 @@ static void change_print_parameter(int frame)
{
double first = CTX::instance()->print.parameterFirst;
double last = CTX::instance()->print.parameterLast;
double steps = CTX::instance()->print.parameterSteps;
double steps = CTX::instance()->print.parameterSteps - 1;
if(steps <= 0) steps = 1;
double step = (last - first) / steps;
double v = first + frame * step * CTX::instance()->post.animStep;
......@@ -562,22 +562,20 @@ void CreateOutputFile(const std::string &fileName, int format, bool redraw)
}
if(cycle != 2)
status_play_manual(!cycle, 0, false);
else
change_print_parameter(0);
for(unsigned int i = 0; i < frames.size(); i++){
if(cycle == 2)
change_print_parameter(i);
if(fp)
CreateOutputFile(CTX::instance()->homeDir + frames[i], FORMAT_PPM, false);
if(cycle != 2)
status_play_manual(!cycle, CTX::instance()->post.animStep, false);
else
change_print_parameter(i + 1);
if(!fp){
else{
drawContext::global()->draw();
SleepInSeconds(CTX::instance()->post.animDelay);
}
if(cycle != 2)
status_play_manual(!cycle, CTX::instance()->post.animStep, false);
}
if(fp){
int repeat = (int)(CTX::instance()->post.animDelay * 24);
int repeat = (int)(CTX::instance()->post.animDelay * 30);
if(repeat < 1) repeat = 1;
std::string pattern("I");
// including P frames would lead to smaller files, but the quality
......
......@@ -408,7 +408,7 @@ int mpegFileDialog(const char *name)
dialog->v[2] = new Fl_Value_Input(WB, y, ww2, BH);
dialog->v[3] = new Fl_Value_Input(WB + ww2, y, ww2, BH);
dialog->v[4] = new Fl_Value_Input(WB + 2 * ww2, y, 2 * BB + WB - 3 * ww2, BH,
"First / Last / Steps");
"First / last / steps");
dialog->v[4]->align(FL_ALIGN_RIGHT);
dialog->v[4]->minimum(1);
dialog->v[4]->maximum(500);
......@@ -500,7 +500,7 @@ int mpegFileDialog(const char *name)
opt_print_delete_tmp_files(0, GMSH_SET | GMSH_GUI, (int)dialog->c[2]->value());
int format = (o == dialog->preview) ? FORMAT_MPEG_PREVIEW : FORMAT_MPEG;
dialog->buttons->deactivate();
CreateOutputFile(name, format);
CreateOutputFile(name, format, o == dialog->ok);
dialog->buttons->activate();
if(o == dialog->ok){
dialog->window->hide();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment