Skip to content

Commit 779426a

Browse files
committed
feat: use Manim's next_section for subsections
When next_subsection() is called, it now also calls Manim's next_section() internally. This allows Manim to create separate video files for each subsection automatically when --save_sections flag is used. This is the first step toward eliminating ffmpeg post-processing and letting Manim do the video splitting work natively.
1 parent 3ed6732 commit 779426a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

manim_slides/slide/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ def construct(self):
340340
)
341341
self._pending_subsection_markers.append(marker)
342342

343+
# Call Manim's next_section to create separate video files
344+
if hasattr(self, 'next_section'):
345+
self.next_section(name=name or f"subsection_{len(self._pending_subsection_markers)}")
346+
343347
def _consume_subsection_markers(self) -> tuple[SubsectionMarker, ...]:
344348
markers = tuple(self._pending_subsection_markers)
345349
self._pending_subsection_markers.clear()

0 commit comments

Comments
 (0)