Skip to content

Commit 64a0e9d

Browse files
doaamuhamMrDiver
andauthored
Reformatting the --save_sections output to have the format <Scene>_<SecNum>_<SecName><extension> (#3499)
* Worked on issue 3471, fixing rendered file names to inherit section name * Modified file name to include section number and name * Modified tests for file names to include number and name, in order to pass --------- Co-authored-by: Tristan Schulz <[email protected]>
1 parent 018e4a3 commit 64a0e9d

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

manim/scene/scene_file_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def next_section(self, name: str, type: str, skip_animations: bool) -> None:
191191
and not skip_animations
192192
):
193193
# relative to index file
194-
section_video = f"{self.output_name}_{len(self.sections):04}{config.movie_file_extension}"
194+
section_video = f"{self.output_name}_{len(self.sections):04}_{name}{config.movie_file_extension}"
195195

196196
self.sections.append(
197197
Section(

tests/control_data/videos_data/SceneWithEnabledSections.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
},
1111
"section_dir_layout": [
1212
"SquareToCircle.json",
13-
"SquareToCircle_0000.mp4",
13+
"SquareToCircle_0000_autocreated.mp4",
1414
"."
1515
],
1616
"section_index": [
1717
{
1818
"name": "autocreated",
1919
"type": "default.normal",
20-
"video": "SquareToCircle_0000.mp4",
20+
"video": "SquareToCircle_0000_autocreated.mp4",
2121
"codec_name": "h264",
2222
"width": 854,
2323
"height": 480,

tests/control_data/videos_data/SceneWithSections.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
},
1111
"section_dir_layout": [
1212
"SceneWithSections.json",
13-
"SceneWithSections_0004.mp4",
14-
"SceneWithSections_0003.mp4",
15-
"SceneWithSections_0002.mp4",
16-
"SceneWithSections_0001.mp4",
17-
"SceneWithSections_0000.mp4",
13+
"SceneWithSections_0004_unnamed.mp4",
14+
"SceneWithSections_0003_Prepare For Unforeseen Consequences..mp4",
15+
"SceneWithSections_0002_test.mp4",
16+
"SceneWithSections_0001_unnamed.mp4",
17+
"SceneWithSections_0000_autocreated.mp4",
1818
"."
1919
],
2020
"section_index": [
2121
{
2222
"name": "autocreated",
2323
"type": "default.normal",
24-
"video": "SceneWithSections_0000.mp4",
24+
"video": "SceneWithSections_0000_autocreated.mp4",
2525
"codec_name": "h264",
2626
"width": 854,
2727
"height": 480,
@@ -32,7 +32,7 @@
3232
{
3333
"name": "unnamed",
3434
"type": "default.normal",
35-
"video": "SceneWithSections_0001.mp4",
35+
"video": "SceneWithSections_0001_unnamed.mp4",
3636
"codec_name": "h264",
3737
"width": 854,
3838
"height": 480,
@@ -43,7 +43,7 @@
4343
{
4444
"name": "test",
4545
"type": "default.normal",
46-
"video": "SceneWithSections_0002.mp4",
46+
"video": "SceneWithSections_0002_test.mp4",
4747
"codec_name": "h264",
4848
"width": 854,
4949
"height": 480,
@@ -54,7 +54,7 @@
5454
{
5555
"name": "Prepare For Unforeseen Consequences.",
5656
"type": "default.normal",
57-
"video": "SceneWithSections_0003.mp4",
57+
"video": "SceneWithSections_0003_Prepare For Unforeseen Consequences..mp4",
5858
"codec_name": "h264",
5959
"width": 854,
6060
"height": 480,
@@ -65,7 +65,7 @@
6565
{
6666
"name": "unnamed",
6767
"type": "presentation.skip",
68-
"video": "SceneWithSections_0004.mp4",
68+
"video": "SceneWithSections_0004_unnamed.mp4",
6969
"codec_name": "h264",
7070
"width": 854,
7171
"height": 480,

tests/control_data/videos_data/SceneWithSkipAnimations.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
},
1111
"section_dir_layout": [
1212
"ElaborateSceneWithSections.json",
13-
"ElaborateSceneWithSections_0003.mp4",
14-
"ElaborateSceneWithSections_0001.mp4",
15-
"ElaborateSceneWithSections_0000.mp4",
13+
"ElaborateSceneWithSections_0003_fade out.mp4",
14+
"ElaborateSceneWithSections_0001_transform to circle.mp4",
15+
"ElaborateSceneWithSections_0000_create square.mp4",
1616
"."
1717
],
1818
"section_index": [
1919
{
2020
"name": "create square",
2121
"type": "default.normal",
22-
"video": "ElaborateSceneWithSections_0000.mp4",
22+
"video": "ElaborateSceneWithSections_0000_create square.mp4",
2323
"codec_name": "h264",
2424
"width": 854,
2525
"height": 480,
@@ -30,7 +30,7 @@
3030
{
3131
"name": "transform to circle",
3232
"type": "default.normal",
33-
"video": "ElaborateSceneWithSections_0001.mp4",
33+
"video": "ElaborateSceneWithSections_0001_transform to circle.mp4",
3434
"codec_name": "h264",
3535
"width": 854,
3636
"height": 480,
@@ -41,7 +41,7 @@
4141
{
4242
"name": "fade out",
4343
"type": "default.normal",
44-
"video": "ElaborateSceneWithSections_0003.mp4",
44+
"video": "ElaborateSceneWithSections_0003_fade out.mp4",
4545
"codec_name": "h264",
4646
"width": 854,
4747
"height": 480,

0 commit comments

Comments
 (0)