Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
46b5e138
Commit
46b5e138
authored
20 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
ask if we should remove the temp files
parent
29d84ead
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
demos/anim.script
+24
-13
24 additions, 13 deletions
demos/anim.script
with
24 additions
and
13 deletions
demos/anim.script
+
24
−
13
View file @
46b5e138
// A demo script to save mpeg or gif animations of post-processing views
oldw = General.GraphicsWidth;
oldh = General.GraphicsHeight;
all = GetValue("Animate one view at a time or all views together?
all = GetValue("Animate one view at a time, or all views together (0=one, 1=all)?", 1) ;
0: one at a time, 1: all together", 1) ;
oldw = General.GraphicsWidth;
General.GraphicsWidth = GetValue("Width of animation?", 640);
oldh = General.GraphicsHeight;
General.GraphicsHeight = GetValue("Height of animation?", 640) ;
method = GetValue("Animation method? (0=mpeg_encode, 1=mencoder, 2=whirlgif)?", 0) ;
method = GetValue("Animation method?
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ;
MPEG_ENCODE = 0;
MENCODER = 1;
WHIRLGIF = 2;
Print.JpegQuality = 100;
// Clean-up temp files from previous run
If(method == WHIRLGIF)
System "rm -f /tmp/tmp*.gif" ;
EndIf
If(method == MPEG_ENCODE || method == MENCODER)
System "rm -f /tmp/tmp*.jpg /tmp/tmp.par" ;
EndIf
If(all)
For i In {1:PostProcessing.NbViews}
View[i-1].TimeStep = 0;
EndFor
// Use the first view as the reference
frame = View[0].NbTimeStep;
For index In {1:View[0].NbTimeStep}
Draw;
If(method == WHIRLGIF)
...
...
@@ -102,5 +99,19 @@ If(method == MPEG_ENCODE)
System "mpeg_encode /tmp/tmp.par" ;
EndIf
// Clean-up temp files?
cleanup = GetValue("Remove temporary files?
(The final animation has been saved in /tmp/animation.{gif.mpg})", 1);
If(cleanup)
If(method == WHIRLGIF)
System "rm -f /tmp/tmp*.gif" ;
EndIf
If(method == MPEG_ENCODE || method == MENCODER)
System "rm -f /tmp/tmp*.jpg /tmp/tmp.par" ;
EndIf
EndIf
General.GraphicsWidth = oldw;
General.GraphicsHeight = oldh;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment