Skip to content

Commit a933dd3

Browse files
authored
Merge pull request #63 from huguesdevimeux/added-dry-run
Added dry run
2 parents 865c4c1 + 44717c8 commit a933dd3

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,6 @@ For users:
193193
```sh
194194
manim example_scenes.py SquareToCircle -pl
195195
```
196-
1. Run the following command:
197-
For developers:
198-
```sh
199-
python3 manim.py example_scenes.py SquareToCircle -pl
200-
```
201196

202197
![](./readme-assets/command.png)
203198

manim/config.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,67 +23,72 @@ def parse_cli():
2323
"-p", "--preview",
2424
action="store_true",
2525
help="Automatically open the saved file once its done",
26-
),
26+
)
2727
parser.add_argument(
2828
"-w", "--write_to_movie",
2929
action="store_true",
3030
help="Render the scene as a movie file",
31-
),
31+
)
3232
parser.add_argument(
3333
"-s", "--save_last_frame",
3434
action="store_true",
3535
help="Save the last frame",
36-
),
36+
)
37+
parser.add_argument(
38+
"--dry_run",
39+
action="store_true",
40+
help= "Do a dry run (render scenes but generate no output files)",
41+
)
3742
parser.add_argument(
3843
"-l", "--low_quality",
3944
action="store_true",
4045
help="Render at a low quality (for faster rendering)",
41-
),
46+
)
4247
parser.add_argument(
4348
"-m", "--medium_quality",
4449
action="store_true",
4550
help="Render at a medium quality",
46-
),
51+
)
4752
parser.add_argument(
4853
"--high_quality",
4954
action="store_true",
5055
help="Render at a high quality",
51-
),
56+
)
5257
parser.add_argument(
5358
"-k", "--four_k",
5459
action="store_true",
5560
help="Render at a 4K quality",
56-
),
61+
)
5762
parser.add_argument(
5863
"-g", "--save_pngs",
5964
action="store_true",
6065
help="Save each frame as a png",
61-
),
66+
)
6267
parser.add_argument(
6368
"-i", "--save_as_gif",
6469
action="store_true",
6570
help="Save the video as gif",
66-
),
71+
)
6772
parser.add_argument(
6873
"-f", "--show_file_in_finder",
6974
action="store_true",
7075
help="Show the output file in finder",
71-
),
76+
)
7277
parser.add_argument(
7378
"-t", "--transparent",
7479
action="store_true",
7580
help="Render to a movie file with an alpha channel",
76-
),
81+
)
7782
parser.add_argument(
7883
"-q", "--quiet",
7984
action="store_true",
8085
help="",
81-
),
86+
)
8287
parser.add_argument(
8388
"-a", "--write_all",
8489
action="store_true",
8590
help="Write all the scenes from a file",
86-
),
91+
)
8792
parser.add_argument(
8893
"-o", "--file_name",
8994
help="Specify the name of the output file, if"
@@ -140,8 +145,8 @@ def parse_cli():
140145
def get_configuration(args):
141146
file_writer_config = {
142147
# By default, write to file
143-
"write_to_movie": args.write_to_movie or not args.save_last_frame,
144-
"save_last_frame": args.save_last_frame,
148+
"write_to_movie": (args.write_to_movie or not args.save_last_frame) and not args.dry_run,
149+
"save_last_frame": args.save_last_frame and not args.dry_run,
145150
"save_pngs": args.save_pngs,
146151
"save_as_gif": args.save_as_gif,
147152
# If -t is passed in (for transparent), this will be RGBA

tests/tests_sample_scenes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
# This file is intended to test any new feature added.
44
# Feel free to add a test or to modify one when adding a new/changing a feature.
5-
5+
class Test(Scene):
6+
def construct(self):
7+
square = Square()
8+
self.play(ShowCreation(square))
9+
610
class Test_geometry(Scene):
711
def construct(self):
812
circle = Circle()

0 commit comments

Comments
 (0)