Commit graph

50 commits

Author SHA1 Message Date
Grant Sanderson
3d9a0cd25e
Move resizing out of Window.focus, and into Window.init_for_scene (#2274)
Some checks are pending
docs / build up document and deploy (push) Waiting to run
2024-12-12 14:16:45 -08:00
Grant Sanderson
185f642826 Focus and sync window when initialized for a scene 2024-12-11 09:29:04 -06:00
Grant Sanderson
4b483b75ce Minor tweak 2024-12-10 11:39:23 -06:00
Grant Sanderson
d4c5c4736a Move logic for window size and position into Window class 2024-12-10 11:07:54 -06:00
Grant Sanderson
c02259a39e Remove import 2024-12-10 10:35:21 -06:00
Grant Sanderson
1276724891 Pull out the initial Window.to_default_position from init_for_scene 2024-12-10 10:14:59 -06:00
Grant Sanderson
9e77b0dcdd Consolidate window configuration 2024-12-10 10:10:58 -06:00
Grant Sanderson
53b6c34ebe Create Window outside of Scene, and pass it in as an argument 2024-12-06 09:39:12 -06:00
Grant Sanderson
0e83c9c0d9
Merge branch 'master' into video-work 2024-12-05 16:50:13 -06:00
Varniex
5d3f730824
Cleaning up some imports + Minor Bug fixed in VectorField (#2253)
* cleaning up imports

* sample_points -> sample_coords
2024-12-05 14:42:46 -08:00
Grant Sanderson
3b9ef57b22 Remove utils/customization.py 2024-12-05 11:59:01 -06:00
Splines
1fa17030a2
Add reload() command for interactive scene reloading (#2240)
* Init reload command (lots of things not working yet)

* Add back in class line (accidentally deleted)

* Add back in key modifiers (accidentally deleted)

* Unpack tuple from changed `get_module`

* Init MainRunManager & respawn IPython shell

* Init cleanup of scenes from manager

* Restore string quotes

* Still take `self.preview` into account

* Remove left-over code from module experimentation

* Remove double window activation

* Reset scenes array in RunManager

* Move self.args None check up

* Use first available window

* Don't use constructor for RunManager

* Use self. syntax

* Init moderngl context manually

* Add some comments for failed attempts to reset scene

* Reuse existing shell (this fixed the bug 🎉)

* Remove unused code

* Remove unnecessary intermediate ReloadSceneException

* Allow users to finally exit

* Rename main_run_manager to reload_manager

* Add docstrings to `ReloadManager`

* Improve reset management in window

* Clarify why we use magic exit_raise command

* Add comment about window reuse

* Improve docstrings in ReloadManager & handle case of 0 scenes

* Set scene and title earlier

* Run linter suggestions
2024-11-26 10:09:43 -08:00
Splines
97b6e39abb
Init new focus() command 2024-11-10 18:48:33 +01:00
Grant Sanderson
a5ba721f96 Cease useless rendering
Change so that with a live window, rendering only happens if there has been an event (mouse motion, key press, etc.) to respond to.
2024-08-15 14:03:16 -05:00
Grant Sanderson
8a4d7b4e8c Add a small hack to ensure Window resets properly in non-primary monitors 2023-11-06 12:34:39 -05:00
Grant Sanderson
d1b1df64a5 Ensure Window's scene always points back to window
Issues can arise in the few milliseconds of startup otherwise.
2023-02-04 16:51:14 -08:00
Grant Sanderson
be602930c3 Check that scene has a camera frame in pixel_to_point_coords 2023-02-02 14:46:07 -08:00
Grant Sanderson
215c21babf Small renaming 2023-01-30 15:24:10 -08:00
Grant Sanderson
9628adc957 Ensure scroll zooming works better in 3d 2023-01-30 15:03:05 -08:00
Grant Sanderson
277c471c90 Refactor so that view matrix incorporates frame scaling 2023-01-30 14:15:39 -08:00
Grant Sanderson
09900456f7 Clean up pixel_coords_to_space_coords to work better in 3d 2023-01-28 22:30:46 -08:00
Grant Sanderson
a1595a9e2f Use separate fbo for writing to file when window is active 2023-01-25 22:34:11 -08:00
Grant Sanderson
97789fff35 Swap buffers when resetting to default position 2023-01-24 12:05:39 -08:00
Grant Sanderson
8a6deb4068 Enable recording during a Scene embed 2023-01-23 17:10:18 -08:00
Grant Sanderson
66d12a1687 Specify number of samples at the scene level, and be sure it works for Window as well 2023-01-20 16:30:39 -08:00
Grant Sanderson
2b67aa0e01 Type hints for Window class variables 2022-12-26 09:40:11 -07:00
Grant Sanderson
afab37c2d2 Remove stray digest_config references 2022-12-16 11:00:59 -08:00
YishiMichael
9ef9961d0e
Sort imports 2022-04-12 19:19:59 +08:00
TonyCrane
4fbe948b63
style: insert an empty line after import 2022-02-16 21:08:25 +08:00
TonyCrane
f085e6c2dd
chore: add type hints to manimlib.window 2022-02-15 14:55:35 +08:00
Grant Sanderson
c635f19f2a Push pixel_coords_to_space_coords to Window 2021-08-24 11:26:43 -07:00
slowy07
1e621e8278 fix: fix typo spelling grammar 2021-08-07 22:25:26 +07:00
Calvin Pelletier
a06d5613f4 fix issue #1509 2021-06-04 17:07:41 -07:00
Grant Sanderson
120d26defa If chosen monitor is not available, choose one that does exist 2021-03-18 17:32:45 -07:00
Grant Sanderson
a46b7d6931 Fix window size issue 2021-02-12 13:34:33 -08:00
Grant Sanderson
368a6c3d1c Include from manimlib.mobject.interactive import * 2021-02-11 19:31:00 -08:00
Grant Sanderson
e7240547fb Small reorderings 2021-02-11 12:20:17 -08:00
Grant Sanderson
1798875396 Call Window.init_mgl_context and reorder Window.__init__ 2021-02-10 14:48:00 -08:00
Grant Sanderson
156b83c38e Change window size if it's passed in 2021-02-10 13:37:09 -08:00
Grant Sanderson
36e8421395 Let the user specify which monitor the window should show up in 2021-02-09 10:53:26 -08:00
鹤翔万里
fc6953e102
remove samples=1 in window.py 2021-02-03 17:17:55 +08:00
Grant Sanderson
20b787223b Rename get_position -> find_initial_position 2021-01-19 11:36:28 -08:00
Grant Sanderson
9a502cd83b Move window position logic into window 2021-01-19 11:35:25 -08:00
Grant Sanderson
c65a7fb340 Add Window.is_key_pressed method 2021-01-06 12:47:13 -08:00
Grant Sanderson
592432611b Remove all configuration from constants.py, and clean up the many files affected by this move 2021-01-02 20:47:51 -08:00
Grant Sanderson
bbfce0f5be Change window position defaults 2020-12-04 08:20:06 -08:00
Grant Sanderson
150b03427d Change default window location 2020-08-12 13:23:04 -07:00
Grant Sanderson
1a0b0e748c Fixed pixel_coords_to_space_coords 2020-02-14 10:52:39 -08:00
Grant Sanderson
8db7756d2e A little more window initialization 2020-02-13 10:50:38 -08:00
Grant Sanderson
960e918e61 Basic preview window 2020-02-11 19:51:19 -08:00