3b1b / 3b1b/videos

Can't init submobjects of Pi Creature

未关闭
#43 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
11.2k
派生
2.1k
平均合并
5 小时 49 分钟
30 天内合并 PR
3

描述

when i run the command: `manimgl _2022\wordle\footnote.py WeCanDoBetter` i got the following results,
i find out that the submobjects array is empty but i am sure i config the `pi_creature_images` directory correctly.

```bash
PS F:\manim_videos\videos> manimgl _2022\wordle\footnote.py WeCanDoBetter
ManimGL v1.5.0
Traceback (most recent call last):
File "f:\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "f:\python38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "F:\Python38\Scripts\manimgl.exe\__main__.py", line 7, in
File "f:\python38\lib\site-packages\manimlib\__main__.py", line 25, in main
scene.run()
File "f:\python38\lib\site-packages\manimlib\scene\scene.py", line 80, in run
self.construct()
File "F:\manim_videos\videos\_2022\wordle\footnote.py", line 791, in construct
morty = Mortimer()
File "F:\manim_videos\videos\custom\characters\pi_creature.py", line 70, in __init__
SVGMobject.__init__(self, file_name=svg_file, **kwargs)
File "f:\python38\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 60, in __init__
super().__init__(**kwargs)
File "f:\python38\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 77, in __init__
super().__init__(**kwargs)
File "f:\python38\lib\site-packages\manimlib\mobject\mobject.py", line 80, in __init__
self.init_colors()
File "F:\manim_videos\videos\custom\characters\pi_creature.py", line 110, in init_colors
self.name_parts()
File "F:\manim_videos\videos\custom\characters\pi_creature.py", line 94, in name_parts
self.mouth = self.submobjects[MOUTH_INDEX]
IndexError: list index out of range
PS F:\manim_videos\videos>
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

错误发生在 custom/characters/pi_creature.py 的第 94 行,在访问 self.submobjects[MOUTH_INDEX] 时。检查 pi_creature_images 目录配置和 svg_mobject.py 中的 SVG 文件加载。问题在于 submobjects 为空,因此检查 SVG 解析和目录路径。使用 debug prints 运行场景以查看正在加载哪些文件。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。