Commit 12d28cd
committed
feat(annotations): broadcast live-stroke geometry to plugin_events_group
AnnotationBasePtr is not Python-bound, so Python plugins cannot
subscribe to live_edit_event_group directly. Serialize the cumulative
in-progress stroke via Annotation::serialise() and broadcast it as a
JsonStore alongside (event_atom, annotation_data_atom, user_id,
stroke_completed) via plugin_events_group(), so Python plugins can
render partial strokes directly from event geometry instead of
polling/hot-scanning bookmarks. Shapes (Square/Circle/Arrow/Line/
Ellipse) are only broadcast on pen-up, since a shape isn't a
meaningful annotation until the drag completes.
Also fix subscribe_to_plugin_events: BroadcastActor forwards messages
via send_as(current_sender(), subscriber, msg), so a Python subscriber
sees the owning actor as the sender, not the broadcast group. The
2-arg add_message_callback() only registered the group's address, so
plugin_events_ messages were silently dropped. Pass the plugin's actor
as the owner_actor (3rd arg), mirroring the same fix already applied
to subscribe_to_event_group.
Signed-off-by: Sam.Richards@taurich.org <Sam.Richards@taurich.org>1 parent eb3d235 commit 12d28cd
2 files changed
Lines changed: 28 additions & 7 deletions
File tree
- python/src/xstudio/plugin
- src/plugin/viewport_overlay/annotations/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
| 299 | + | |
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| |||
Lines changed: 27 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
1300 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
1301 | 1322 | | |
1302 | 1323 | | |
1303 | 1324 | | |
| |||
0 commit comments