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

polish
parent b7c54dc3
No related branches found
No related tags found
No related merge requests found
// This script creates an mpeg or gif animation by looping over all // This script creates an mpeg or gif animation by looping over all
// the time steps and/or all the post-processing views // the time steps and/or all the post-processing views
all = GetValue("Animate one view at a time or all views together?
0: one at a time, 1: all together", 1) ;
oldw = General.GraphicsWidth;
neww = GetValue("Width of animation? (enter 0 to keep current width)", 640); neww = GetValue("Width of animation? (enter 0 to keep current width)", 640);
oldh = General.GraphicsHeight;
newh = GetValue("Height of animation? (enter 0 to keep current height)", 640) ; newh = GetValue("Height of animation? (enter 0 to keep current height)", 640) ;
all = GetValue("Animate one view at a time or all views together?
0: one at a time, 1: all together", 1) ;
method = GetValue("Animation encoder? method = GetValue("Animation encoder?
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ; 0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0) ;
...@@ -18,6 +13,9 @@ MPEG_ENCODE = 0; ...@@ -18,6 +13,9 @@ MPEG_ENCODE = 0;
MENCODER = 1; MENCODER = 1;
WHIRLGIF = 2; WHIRLGIF = 2;
oldw = General.GraphicsWidth;
oldh = General.GraphicsHeight;
If(neww) If(neww)
General.GraphicsWidth = neww; General.GraphicsWidth = neww;
EndIf EndIf
...@@ -25,8 +23,6 @@ If(newh) ...@@ -25,8 +23,6 @@ If(newh)
General.GraphicsHeight = newh; General.GraphicsHeight = newh;
EndIf EndIf
Print.JpegQuality = 100;
If(all) If(all)
maxstep = 1; maxstep = 1;
For i In {1:PostProcessing.NbViews} For i In {1:PostProcessing.NbViews}
...@@ -78,7 +74,6 @@ If(!all) ...@@ -78,7 +74,6 @@ If(!all)
EndFor EndFor
EndIf EndIf
NUM_FRAMES = index; NUM_FRAMES = index;
ENCODER = method; ENCODER = method;
Include "encode.script"; Include "encode.script";
......
// This script creates an mpeg or gif animation by applying // This script creates an mpeg or gif animation by applying
// incremental rotations around the 3 coordinate axes // incremental rotations around the 3 coordinate axes
oldw = General.GraphicsWidth;
neww = GetValue("Width of animation? (enter 0 to keep current width)", 640); neww = GetValue("Width of animation? (enter 0 to keep current width)", 640);
oldh = General.GraphicsHeight;
newh = GetValue("Height of animation? (enter 0 to keep current height)", 640); newh = GetValue("Height of animation? (enter 0 to keep current height)", 640);
steps = GetValue("Number of steps", 360);
xinc = GetValue("X-axis rotation increment (in degrees)", 0);
yinc = GetValue("Y-axis rotation increment (in degrees)", 1);
zinc = GetValue("Z-axis rotation increment (in degrees)", 0);
method = GetValue("Animation encoder? method = GetValue("Animation encoder?
0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0); 0: mpeg_encode (MPEG1), 1: mencoder (MPEG4), 2: whirlgif (GIF89)", 0);
...@@ -14,11 +14,11 @@ MPEG_ENCODE = 0; ...@@ -14,11 +14,11 @@ MPEG_ENCODE = 0;
MENCODER = 1; MENCODER = 1;
WHIRLGIF = 2; WHIRLGIF = 2;
steps = GetValue("Number of steps", 360); oldr = General.Trackball;
xinc = GetValue("X-axis rotation increment (in degrees)", 0); oldw = General.GraphicsWidth;
yinc = GetValue("Y-axis rotation increment (in degrees)", 1); oldh = General.GraphicsHeight;
zinc = GetValue("Z-axis rotation increment (in degrees)", 0);
General.Trackball = 0;
If(neww) If(neww)
General.GraphicsWidth = neww; General.GraphicsWidth = neww;
EndIf EndIf
...@@ -26,19 +26,11 @@ If(newh) ...@@ -26,19 +26,11 @@ If(newh)
General.GraphicsHeight = newh; General.GraphicsHeight = newh;
EndIf EndIf
Print.JpegQuality = 100;
General.Trackball = 0;
General.Light0X = 1;
General.Light0Y = 0;
General.Light0Z = 0;
index = 0; index = 0;
For (1:steps) For (1:steps)
General.RotationX += xinc; General.RotationX += xinc;
General.RotationY += yinc; General.RotationY += yinc;
General.RotationZ += zinc; General.RotationZ += zinc;
index++; index++;
Draw; Draw;
If(method == WHIRLGIF) If(method == WHIRLGIF)
...@@ -53,5 +45,6 @@ NUM_FRAMES = index; ...@@ -53,5 +45,6 @@ NUM_FRAMES = index;
ENCODER = method; ENCODER = method;
Include "encode.script"; Include "encode.script";
General.Trackball = oldr;
General.GraphicsWidth = oldw; General.GraphicsWidth = oldw;
General.GraphicsHeight = oldh; General.GraphicsHeight = oldh;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment