Livecoding Mode for Python
@catilac arbeitet bereits daran.
Seit 24.1.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Leverage bevy_ecs to watch the currently running sketch for changes and hotswap on successfully compiling edits
Edit: I'm currently working on this, but there are some architectural questions I have.
Current Approach
I've created a new bevy Asset called Sketch and spawn that object at Startup.
When I make a change to sketch.py bevy will notice. yay
The question now is how does the actual reloading mechanism work for Python? And there is a larger question of how does this mechanism work for other language frontends (Processing4/java, lua, ocaml, scheme, ruby, etc...)
For Python (w/ pyo3)
- Make a change to
sketch.py - Bevy will observe and [emit an event]
processing_pyo3crate will check if a reload is necessary- Using something like importlib.reload(), pyo3 can reload the module, and skip creating a new graphics context if it doesn't have to, and grab the new draw and setup functions.
+--------+ +------+
| Python |------->| Bevy |
+--------+ +------+
^ |
| |
+-- onChange ----+
What about other language front-ends?
I suppose some custom plugin loading could work. The Sketch Asset could be something that Python introduces, so that would allow for us to only use any of that design only for our pyo3 implementation
The other front-ends would have to build their own systems, and we could expose hot-reloading related FFI methods?
I think at the moment, I really like the idea of just having a Python related Livecoding bevy plugin. I'm still learning about bevy's ECS system, but is it possible for us to represent our "scene graph" as an intermediary that can easily map to the existing entities in bevy?
ie:
def draw():
background(220)
fill(255, 0, 100)
stroke(0)
stroke_weight(2)
rect(100, 100, 200, 150)
when I change stroke_weight, could bevy know to update, or refresh that particular entity?
or is it easier to just drop all the entities and re-run the sketch? I might be over thinking it.
For now I'm going to work towards getting python to hotreload.
- Vorherrschende Sprache
- Rust
- Sterne
- 69
- Forks
- 14
- Ø Merge
- 15 T. 22 Std.
- Gemergte PRs (30 T.)
- 3
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus processing/libprocessing
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
processing/libprocessing#233 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
processing/libprocessing#229 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
processing/libprocessing#201 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
processing/libprocessing#194 ·
-
documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
processing/libprocessing#146 · 1 Kommentar ·
Alle Issues in processing/libprocessing
Ähnliche Issues
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
n0-computer/iroh#4550 ·
-
impl detach for native Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
paritytech/zombienet-sdk#591 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
farion1231/cc-switch#7638 · 1 Kommentar ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100