diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-15 14:01:56 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-15 14:01:56 (GMT) |
commit | f92f341bb8dfa17c8d9fd1951414033af4136ffd (patch) | |
tree | 09f0939e997fca80ada816100c2c0c13a4f2946f /mainwin.cc | |
parent | 4c53f4ec2281b0aeff77ec1bbd91daf6890fbce0 (diff) |
Clifford Wolf:
Added dumping of animation frames
Some indenting fixes
git-svn-id: http://svn.clifford.at/openscad/trunk@314 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'mainwin.cc')
-rw-r--r-- | mainwin.cc | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -485,7 +485,7 @@ void MainWindow::compile(bool procevents) root_node = NULL; enableOpenCSG = false; - // Initialize special variables + // Initialize special variables root_ctx.set_variable("$t", Value(e_tval->text().toDouble())); Value vpt; @@ -895,13 +895,23 @@ void MainWindow::actionCompile() compile(!viewActionAnimate->isChecked()); - // Go to non-CGAL view mode + // Go to non-CGAL view mode if (!viewActionOpenCSG->isChecked() && !viewActionThrownTogether->isChecked()) { viewModeOpenCSG(); } else { screen->updateGL(); } + + if (viewActionAnimate->isChecked() && e_dump->isChecked()) { + QImage img = screen->grabFrameBuffer(); + QString filename; + double s = e_fsteps->text().toDouble(); + double t = e_tval->text().toDouble(); + filename.sprintf("frame%05d.png", int(round(s*t))); + img.save(filename, "PNG"); + } + current_win = NULL; } |