mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
extract_scene now behaves more as expected when passed explicit output file names already containing an extension
This commit is contained in:
parent
e4ba832aac
commit
551501b69e
1 changed files with 12 additions and 1 deletions
|
@ -70,6 +70,17 @@ def get_configuration():
|
||||||
parser.add_argument("-o", "--output_name")
|
parser.add_argument("-o", "--output_name")
|
||||||
parser.add_argument("-n", "--start_at_animation_number")
|
parser.add_argument("-n", "--start_at_animation_number")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
if args.output_name != None:
|
||||||
|
output_name_root, output_name_ext = os.path.splitext(args.output_name)
|
||||||
|
expected_ext = '.png' if args.show_last_frame else '.mp4'
|
||||||
|
if not output_name_ext in ['', expected_ext]
|
||||||
|
print "WARNING: The output will be to (doubly-dotted) %s%s"%output_name_root%expected_ext
|
||||||
|
output_name = args.output_name
|
||||||
|
else:
|
||||||
|
# If anyone wants .mp4.mp4 and is surprised to only get .mp4, or such... Well, too bad.
|
||||||
|
output_name = output_name_root
|
||||||
|
else:
|
||||||
|
output_name = args.output_name
|
||||||
except argparse.ArgumentError as err:
|
except argparse.ArgumentError as err:
|
||||||
print(str(err))
|
print(str(err))
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
@ -87,7 +98,7 @@ def get_configuration():
|
||||||
"quiet" : args.quiet or args.write_all,
|
"quiet" : args.quiet or args.write_all,
|
||||||
"ignore_waits" : args.preview,
|
"ignore_waits" : args.preview,
|
||||||
"write_all" : args.write_all,
|
"write_all" : args.write_all,
|
||||||
"output_name" : args.output_name,
|
"output_name" : output_name,
|
||||||
"start_at_animation_number" : args.start_at_animation_number,
|
"start_at_animation_number" : args.start_at_animation_number,
|
||||||
"end_at_animation_number" : None,
|
"end_at_animation_number" : None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue