Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00

224 Commits

Author SHA1 Message Date
Falk David 847c3f3b92 Merge branch 'main' into grease-pencil-v3 2023-05-30 10:41:54 +02:00
Falk David 914dcc7059 Merge branch 'main' into grease-pencil-v3 2023-05-26 16:52:12 +02:00
Falk David 72f4d7b40c Merge branch 'main' into grease-pencil-v3 2023-05-26 14:56:20 +02:00
Falk David 36269df4b4 Remove ifdefs for rna code 2023-05-26 14:55:56 +02:00
Falk David d38e05d48a Cleanup runtime handling 2023-05-26 14:53:14 +02:00
Falk David b5912421c0 Add API to find a layer by name
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-26 11:03:05 +02:00
Falk David 63ee6f614a Merge branch 'main' into grease-pencil-v3 2023-05-26 10:58:41 +02:00
Falk David 8cc26b97fd Cleanup layer mask code 2023-05-26 10:55:50 +02:00
Falk David 67ca73341d Clear color values 2023-05-26 10:54:34 +02:00
Falk David a7596f02a8 Add dirty flag to frames storage 2023-05-25 17:24:06 +02:00
Falk David 1abfe8a49c Fix missing function 2023-05-25 17:22:05 +02:00
Falk David c4f159e96e Fix crash when reading 2023-05-25 17:20:49 +02:00
Falk David 229e5a54b4 Write id struct before animation data 2023-05-25 15:04:39 +02:00
Falk David ef95c1734c Fix crash when current drawing on layer is empty 2023-05-25 13:54:20 +02:00
Falk David 409643e35b Add function to check for active layer 2023-05-25 11:53:09 +02:00
Falk David 0504c6a5a3 Cleanup 2023-05-25 11:34:01 +02:00
Falk David fc722206e6 Merge branch 'main' into grease-pencil-v3 2023-05-25 11:28:50 +02:00
Falk David 85dd04fbf0 Cleanup 2023-05-23 16:22:35 +02:00
Falk David a1fbfbc810 Add test for layer iteration 2023-05-23 16:22:22 +02:00
Falk David a1e76c9848 Create runtime structs when reading the ID 2023-05-23 15:48:30 +02:00
Falk David 501723e73e Fix naming 2023-05-23 15:47:49 +02:00
Falk David e80fc2ad39 Refactor: Store layer tree in DNA 2023-05-23 15:12:34 +02:00
Falk David 89b7a985f3 Fix keymap error 2023-05-23 15:11:36 +02:00
Falk David 91a17bd55b Merge branch 'main' into grease-pencil-v3 2023-05-23 14:36:04 +02:00
Falk David 6ea4c85870 Merge branch 'main' into grease-pencil-v3 2023-05-23 10:16:48 +02:00
Falk David 7ee7b363bc Merge branch 'main' into grease-pencil-v3 2023-05-22 10:53:48 +02:00
Falk David 1b1dec6e72 Merge branch 'main' into grease-pencil-v3 2023-05-15 15:03:05 +02:00
Falk David 69169e98f2 Add initial rna api 2023-05-08 14:16:51 +02:00
Falk David 6e627b37e9 Add function for reference cycles check 2023-05-08 13:42:33 +02:00
Falk David 70afcb8afb Move StrokeCache to greasepencil namespace 2023-05-08 12:34:23 +02:00
Falk David 53fa7c7945 Cleanup 2023-05-08 12:25:08 +02:00
Falk David 2dea9b8f26 Merge branch 'main' into grease-pencil-v3 2023-05-08 12:14:11 +02:00
Falk David d64d8a72df Unused parameters 2023-05-04 15:06:53 +02:00
Falk David d4ba6c9429 Use namespace `blender::draw::greasepencil` 2023-05-04 15:05:57 +02:00
Falk David 79498b8740 Merge branch 'main' into grease-pencil-v3
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-04 13:58:16 +02:00
Falk David 4a71836304 More cleanup 2023-05-04 12:04:51 +02:00
Falk David 1d385c9d0f More cleanup 2023-05-04 11:44:33 +02:00
Falk David b990adfd65 Merge branch 'main' into grease-pencil-v3 2023-05-04 11:17:13 +02:00
Falk David 78d2b32f80 Update comment 2023-05-03 16:36:46 +02:00
Falk David 754ed9a6d0 comment
buildbot/vexp-code-patch-coordinator Build done. Details
2023-05-03 15:15:10 +02:00
Falk David 0460a4c1a0 Add GreasePencil::bounds_min_max function 2023-05-03 12:59:48 +02:00
Falk David e7652c5e0d Fix frame override method and add test 2023-05-03 11:52:55 +02:00
Falk David 9a64690cac More cleanup 2023-05-03 11:30:05 +02:00
Falk David 17901af2ee Merge branch 'main' into grease-pencil-v3 2023-05-03 10:46:48 +02:00
Falk David 52a4453b95 Store layer masks as array instead of list 2023-05-02 15:01:52 +02:00
Falk David cff9b40253 Remove user_count in DNA 2023-05-02 14:14:33 +02:00
Falk David fc78ab38ba Cleanup 2023-05-02 14:14:13 +02:00
Falk David 594101f899 Merge branch 'main' into grease-pencil-v3 2023-05-02 12:50:52 +02:00
Falk David 95eb26ff59 Cleanup 2023-04-27 21:14:51 +02:00
Falk David 6d8da7352a Cleanup comment 2023-04-27 21:14:51 +02:00
Falk David 9b2fb10049 Fix double free 2023-04-27 21:14:51 +02:00
Falk David 96307ec7c9 Rework layers caching system 2023-04-27 21:14:14 +02:00
Falk David 992fea69e0 Refactor: Use reinitialize() in sorted_keys() 2023-04-26 18:15:49 +02:00
Falk David 4c20869bd0 Make layer tree storage functions static 2023-04-26 18:10:07 +02:00
Falk David 8b1de6f275 Make layer_cache_ private 2023-04-26 17:46:37 +02:00
Falk David 1861d9716b More cleanup 2023-04-26 17:37:13 +02:00
Falk David dcec69e18f Refactor array resizing functions to be generic 2023-04-26 17:34:50 +02:00
Falk David 7257549ded Stroke buffer functions can be const 2023-04-26 17:34:50 +02:00
Falk David 76e813ece2 Fix typo 2023-04-26 17:34:50 +02:00
Falk David 976b6af0b4 Refactor drawing cache creation 2023-04-26 17:29:36 +02:00
Falk David 1e8fa34055 Merge branch 'main' into grease-pencil-v3 2023-04-26 17:01:27 +02:00
Falk David 520c95f261 Cleanup 2023-04-25 17:31:57 +02:00
Falk David 7492a2254b Merge branch 'main' into grease-pencil-v3 2023-04-25 17:08:29 +02:00
Falk David 228d817743 Fix keymap test failing
buildbot/vexp-code-patch-coordinator Build done. Details
2023-04-24 19:25:08 +02:00
Falk David b2f8f066c0 Make draw keymap dependent of experimental setting
buildbot/vexp-code-patch-coordinator Build done. Details
2023-04-24 18:42:50 +02:00
Falk David 43735e8963 Fix crash 2023-04-24 18:36:26 +02:00
Falk David 2292211298 Fix copy of drawing user count 2023-04-24 18:34:53 +02:00
Falk David e4eddaa839 Fix old grease pencil not rendering
When the experimental option was turned off, old grease pencil
objects would no longer render.
2023-04-24 18:34:31 +02:00
Falk David 1de1e3e866 Add user count to the drawings 2023-04-24 17:17:57 +02:00
Falk David e563b48441 Fix typo 2023-04-24 15:59:47 +02:00
Falk David dd364090c5 Add definition to remove gp3 code from non-alpha build 2023-04-24 15:55:38 +02:00
Falk David 30abf241bb Add is_visible and is_locked functions for layers 2023-04-24 15:46:03 +02:00
Falk David d06a401fe4 Copy all fields for tree nodes, layers and masks 2023-04-24 15:45:35 +02:00
Falk David 8e4f38fb14 Fix renaming issue 2023-04-24 15:44:41 +02:00
Falk David f1378e0e13 Fix merge issue 2023-04-24 15:44:08 +02:00
Falk David 2135640b5a Merge branch 'main' into grease-pencil-v3 2023-04-24 13:21:50 +02:00
Falk David 04bcf0648b Merge branch 'main' into grease-pencil-v3 2023-04-24 10:58:42 +02:00
Falk David 4fe4947ac4 Cleanup 2023-04-18 13:37:03 +02:00
Falk David e38ecf84a7 Tag sorted_keys_cache in remove_drawing 2023-04-18 13:33:27 +02:00
Falk David cf497d0051 Merge branch 'main' into grease-pencil-v3 2023-04-18 13:30:05 +02:00
Falk David 4316f8fcd5 Cleanup tagging of sorted_keys_cache 2023-04-18 12:30:45 +02:00
Falk David 22527b9bbc Fix crash when layer has no keyframes. 2023-04-18 12:16:21 +02:00
Falk David fbf61c87e2 Refactor save/load layer tree
Move the loading and saving of the layer tree into the runtime class.
2023-04-18 11:32:24 +02:00
Falk David 6ec1320839 Add grease pencil frame flag + cleanup 2023-04-17 19:01:45 +02:00
Falk David 85c87d901c Add onion skinning settings. 2023-04-17 18:50:39 +02:00
Falk David f49427d182 Add layer masks 2023-04-17 17:37:24 +02:00
Falk David 9e9063b241 Fix crash when converting grease pencil object 2023-04-17 14:10:07 +02:00
Falk David ac66f9b624 Make sure to construct the CurvesGeometry in place 2023-04-17 13:32:49 +02:00
Falk David 549d39c1f4 Remove unused undef. 2023-04-17 13:24:47 +02:00
Falk David 3c7cd7c485 Get length of layer name when converting. 2023-04-17 13:21:13 +02:00
Falk David 0b8243206a Merge branch 'main' into grease-pencil-v3 2023-04-17 12:48:00 +02:00
Falk David 80e88a1ebd Add more fields to `GreasePencilLayer`
Also makes sure to convert the data from the old gpd structure.
2023-04-17 12:44:03 +02:00
Falk David a182f4ebf2 Set materials inside the conversion function. 2023-04-17 12:42:02 +02:00
Falk David ea442d52d6 Fix bug in saving layer tree to storage and add test 2023-04-17 10:40:29 +02:00
Falk David 01923aae9b Conversion of stroke attributes 2023-04-14 17:48:11 +02:00
Falk David efb93b7f6b Add deltatime, rotation, and color to point conversion 2023-04-14 16:02:19 +02:00
Falk David b06adcf8c4 Merge branch 'main' into grease-pencil-v3 2023-04-14 13:40:47 +02:00
Falk David dee0aeaf7d Cleanup remove_drawing test 2023-04-14 12:11:18 +02:00
Falk David 4949aa74ee Refactor the stroke cache 2023-04-14 11:49:15 +02:00
Falk David 4e36522acb Merge branch 'main' into grease-pencil-v3 2023-04-14 11:34:53 +02:00
Falk David c8dc81e8e4 Big refactor
* Move functions out of line.
* Remove custom iterators
* Implement a cache of the flattend layer tree
2023-04-14 11:32:54 +02:00
Falk David ad75af67a8 Cleanup 2023-04-13 15:54:35 +02:00
Falk David 47f5a89576 Merge branch 'main' into grease-pencil-v3 2023-04-13 15:21:10 +02:00
Falk David 79d27606a7 Cleanup 2023-04-13 15:13:23 +02:00
Falk David 8bc1fe5372 Bounding box fix 2023-04-13 14:45:39 +02:00
Falk David c72ade033d Improve active layer functionality 2023-04-13 13:33:14 +02:00
Falk David bee460756f Fix some errors in the UI 2023-04-13 13:30:45 +02:00
Falk David 3dec305fb5 More cleanup 2023-04-12 16:46:00 +02:00
Falk David d88ffa83fc Cleanup 2023-04-12 16:41:37 +02:00
Falk David e150c87747 Merge branch 'main' into grease-pencil-v3 2023-04-12 16:13:05 +02:00
Falk David 8088c04536 Add active_layer 2023-04-12 14:43:13 +02:00
Falk David 0b9a5381f9 Add GreasePencilFrame in the layer map
buildbot/vexp-code-patch-coordinator Build done. Details
This struct now holds more information than just the index into the
drawing array. In the future, we can have more fields if we want to.
2023-04-12 12:01:45 +02:00
Falk David 24c70100bb Merge branch 'main' into grease-pencil-v3 2023-04-12 10:32:51 +02:00
Falk David d0c38114b2 Fix add_empty_darings not initializing runtime data 2023-04-12 10:32:11 +02:00
Falk David a115eaccb5 Fix sorted_keys cache not being cleared 2023-04-12 10:31:42 +02:00
Falk David 2b6e2624f8 Remove print 2023-04-12 10:31:10 +02:00
Falk David abc5711167 Check experimental option in poll function 2023-04-11 14:47:26 +02:00
Falk David 95b43c41a8 Fix missing ID cases 2023-04-11 13:28:42 +02:00
Falk David 90cfecccec Merge branch 'main' into grease-pencil-v3 2023-04-11 10:20:44 +02:00
Falk David 47090c658d Cleanup and documentation 2023-04-06 18:38:57 +02:00
Falk David 95580761d7 Fix crash on conversion 2023-04-06 18:38:18 +02:00
Falk David c12da19352 Merge branch 'main' into grease-pencil-v3 2023-04-05 18:51:37 +02:00
Falk David db356e6c57 Add fucntion to remove a drawing 2023-04-05 18:51:07 +02:00
Falk David 14f4073efc Add function to add empty drawings 2023-04-05 15:32:15 +02:00
Falk David d764640076 Add function to get the root group directly 2023-04-05 14:02:07 +02:00
Falk David 45727a574e Add new ID craetion test 2023-04-05 13:50:25 +02:00
Falk David 07f985949e Merge branch 'main' into grease-pencil-v3 2023-04-05 12:17:36 +02:00
Falk David 493b061a96 Initial paint operator 2023-04-05 11:18:38 +02:00
Falk David ed0f8eefbe Merge branch 'main' into grease-pencil-v3 2023-04-04 11:58:00 +02:00
Falk David 3bff9cb5d6 WIP Initial paint operator 2023-04-04 11:57:23 +02:00
Falk David 8f689e43f4 Spelling 2023-04-04 11:55:56 +02:00
Falk David b54b24ede2 Cleanup 2023-04-04 11:19:48 +02:00
Falk David f8f40d12e3 Fix object data not being copied correctly 2023-04-04 11:19:48 +02:00
Falk David de60ebe156 Improve triangles API for drawings 2023-04-04 11:19:48 +02:00
Falk David 64bc0aa09f Fix crash trying to free empty drawing array 2023-04-03 13:12:48 +02:00
Falk David de2ac3ab17 Add operator to toggle to draw mode 2023-04-03 12:54:08 +02:00
Falk David 1f413c26ff Multithreading for batch cache creation 2023-03-31 11:39:26 +02:00
Falk David c95b00ea0a WIP multithread batch cache creation 2023-03-30 18:02:21 +02:00
Falk David 6c38afd07d Use frames API correctly in layer class 2023-03-30 15:45:07 +02:00
Falk David 47c1aba366 Enable paint mode for the new object 2023-03-30 13:34:22 +02:00
Falk David 1e85673349 Cleanup: Move functions to save/load from storage 2023-03-30 12:33:27 +02:00
Falk David 00726d67d9 Cleanup + fix compiler warnings 2023-03-30 11:01:29 +02:00
Falk David 76565f700f Merge branch 'main' into grease-pencil-v3 2023-03-30 10:35:32 +02:00
Falk David 59067b9cb8 Add shader based toggle for showing fills and strokes 2023-03-30 10:35:01 +02:00
Falk David 5f7673a081 Initialize stroke index offset 2023-03-30 10:34:13 +02:00
Falk David 64e2a38be5 For now, always enable AA 2023-03-30 10:33:53 +02:00
Falk David 22247394f5 Cleanup 2023-03-30 10:32:36 +02:00
Falk David 7ffca78f93 Fix crash when trying to select gp objects in the viewport 2023-03-30 10:32:15 +02:00
Falk David 73c9a8397a Merge branch 'main' into grease-pencil-v3 2023-03-29 17:14:49 +02:00
Falk David 9238e8fe9a Fix enable grease pencil engine for new type 2023-03-29 17:13:10 +02:00
Falk David fe51c411e1 Fix rendering of fills 2023-03-29 17:11:56 +02:00
Falk David b1da925d5b Fix loading of the layers from storage 2023-03-29 17:11:18 +02:00
Falk David a55f44db8b Fix fill triangulating not properly 2023-03-29 17:10:40 +02:00
Falk David 6e12c30288 Invalidate drawing cache when frame is changed 2023-03-29 15:00:12 +02:00
Falk David 1b087afa06 Improve visible drawing iteration 2023-03-29 14:59:38 +02:00
Falk David 8ae7836a7f Fix crash when generating triangles 2023-03-28 18:06:22 +02:00
Falk David 6d480ab9f0 Fix depth buffer issue 2023-03-28 17:44:45 +02:00
Falk David f753866ab4 Merge branch 'main' into grease-pencil-v3 2023-03-28 15:14:58 +02:00
Falk David 8dd953ead0 Add experimental option for GP v3 2023-03-28 12:55:08 +02:00
Falk David ff4d3e93ac Fix memory leak from the layer tree storage. 2023-03-28 12:54:21 +02:00
Falk David 903e7cb07b Add initial rendering of fills 2023-03-27 19:10:00 +02:00
Falk David 47ab3d91ce WIP fix strokes rendering 2023-03-27 15:38:45 +02:00
Falk David f27e618e79 WIP fill index buffers 2023-03-27 15:01:10 +02:00
Falk David bda9abf647 Merge branch 'main' into grease-pencil-v3 2023-03-23 17:28:28 +01:00
Falk David 279f706462 Cleanup 2023-03-23 17:27:40 +01:00
Falk David a64920900c Convert materials 2023-03-23 17:22:55 +01:00
Falk David 1d67ad4d7e Add batch cache callbacks 2023-03-23 17:21:50 +01:00
Falk David e38d286f4e Fix layer group copying 2023-03-23 12:06:57 +01:00
Falk David 7136099ae5 WIP intitial draw cache for GP v3 2023-03-23 12:06:39 +01:00
Falk David 0fb7416237 Fix error in shader when using gpencil_next 2023-03-23 12:05:28 +01:00
Falk David 218a5dd68d Convert radii by taking gps->thickness into account 2023-03-23 12:04:49 +01:00
Falk David f4b45ac3aa Rename draw_cache_impl_gpencil to legacy 2023-03-23 12:04:12 +01:00
Falk David 1ed953e066 Fix error when building depsgraph relations 2023-03-23 12:03:13 +01:00
Falk David c04f2785c1 Cleanup 2023-03-23 12:01:28 +01:00
Falk David 950ebeaca7 Merge branch 'main' into grease-pencil-v3 2023-03-22 10:18:23 +01:00
Falk David 10bd06927b Fix read and copy issue 2023-03-21 18:02:56 +01:00
Falk David f616d9c237 Fix issues in copy function 2023-03-21 16:22:55 +01:00
Falk David 560d24e8b1 WIP copy grease pencil data 2023-03-21 15:47:35 +01:00
Falk David e31a79f8b7 WIP read and write grease pencil data 2023-03-21 15:47:23 +01:00
Falk David 26c0ba7ba4 For now, disable drawing 2023-03-21 13:03:26 +01:00
Falk David d337e69eba Filter IDs for ID_GP 2023-03-21 13:02:58 +01:00
Falk David 59543f562f Merge branch 'main' into grease-pencil-v3 2023-03-21 12:46:32 +01:00
Falk David 0c5a607c78 Use fixture in tests 2023-03-21 11:37:46 +01:00
Falk David 7a604627cf Merge branch 'main' into grease-pencil-v3 2023-03-20 12:31:10 +01:00
Falk David 40fafee172 WIP new object rendering with gpencil-next 2023-03-20 12:30:39 +01:00
Falk David 93f1282d12 WIP Add API to iterate over visible drawings 2023-03-20 12:29:17 +01:00
Falk David fcca4e04fa Merge branch 'gpencil-next' into grease-pencil-v3 2023-03-17 17:36:56 +01:00
Falk David e380d4aa5c Merge branch 'main' into gpencil-next 2023-03-17 17:25:58 +01:00
Falk David 0e397f0aaf WIP Fix crashes when converting object 2023-03-17 16:30:23 +01:00
Falk David 41fa00848f WIP Convert legacy gpencil to new 2023-03-17 16:29:55 +01:00
Falk David 55f09417fb WIP correct the copy constructor of TreeNode 2023-03-17 13:37:09 +01:00
Falk David 0d250c931e WIP delete copy constructor 2023-03-17 13:03:37 +01:00
Falk David 7c4c8868d1 WIP Fix copy and move issue 2023-03-17 12:57:26 +01:00
Falk David af5f43651f WIP Fix memory issue 2023-03-17 12:46:27 +01:00
Falk David a97d624e95 WIP Use unique_ptr in TreeNode 2023-03-17 12:38:13 +01:00
Falk David d60b604189 WIP Add layer and layer group 2023-03-17 11:05:15 +01:00
Falk David 545d9086fd Merge branch 'main' into grease-pencil-v3 2023-03-16 18:18:33 +01:00
Falk David fa9457ff2e Add test file 2023-03-16 18:17:50 +01:00
Falk David 8f7cb82d3e Add TreeNode class 2023-03-16 18:17:40 +01:00
Falk David b16cbe1e18 WIP Add initial grease pencil object 2023-03-14 18:11:31 +01:00
Falk David bf6134f7ad WIP Initial gpencil data conversion function 2023-03-14 16:38:21 +01:00
Falk David c0b7e37436 WIP Dummy conversion to curves object for testing 2023-03-14 16:00:39 +01:00
Falk David 2c44ee7e12 WIP progress on converting frame 2023-03-14 15:59:23 +01:00
Falk David 429018a3a8 WIP add legacy frame conversion function 2023-03-14 14:44:20 +01:00
Falk David 17f723245b Merge branch 'main' into grease-pencil-v3 2023-03-14 11:59:25 +01:00
Falk David f133504646 WIP Fix build errors and add initial read function 2023-03-14 11:51:15 +01:00
Falk David e8131012d1 Fix compiler error 2023-03-13 19:24:36 +01:00
Falk David c7b9b3853b Merge branch 'main' into grease-pencil-v3 2023-03-13 19:21:13 +01:00
Falk David f6eaaf714a Merge branch 'refactor-curves-extract-read-write-functions' into grease-pencil-v3 2023-03-13 17:38:51 +01:00
Falk David f1c018a162 Refactor: Extract CurvesGeometry read/write function 2023-03-13 17:32:02 +01:00
Falk David 1549aeabd8 WIP read write 2023-03-13 17:19:01 +01:00
Falk David 672069022d Fix compiler errors 2023-03-13 14:38:22 +01:00
Falk David 3bfc2ff49b WIP: Fix DNA padding 2023-03-13 13:01:27 +01:00
Falk David b1c7503067 WIP DNA padding 2023-03-13 12:39:39 +01:00
Falk David 8a9ce0fca3 WIP: Updates to the DNA 2023-03-13 12:07:30 +01:00
Falk David c34a56b574 Merge branch 'main' into grease-pencil-v3 2023-03-13 11:33:55 +01:00
Falk David 82ec8fef44 WIP: DNA changes 2023-03-13 11:33:11 +01:00
Falk David 4f1d550ee8 WIP: Add data-bock type and DNA 2023-03-13 08:31:36 +01:00
Falk David db99c202b4 Merge branch 'main' into refactor-gpencil-rename-files-legacy
buildbot/vexp-code-patch-coordinator Build done. Details
2023-03-09 12:20:20 +01:00
Falk David e8d45e8ace Rename gpencil files to legacy
This renames the `BKE_gpencil_*` as well as the `DNA_gpencil_types.h`
files to indicate that it's the legacy grease pencil.
2023-03-09 12:13:42 +01:00
Clément Foucault 21b89060c3 GPencil: Add project task for Gpencil Next 2022-11-14 20:59:09 +01:00
Clément Foucault 99bde3d4f3 Merge branch 'master' into gpencil-next 2022-11-14 14:01:30 +01:00
Clément Foucault fb75e97b53 Merge branch 'master' into gpencil-next 2022-11-14 11:18:33 +01:00
Clément Foucault a7707c8956 GPencil: Draw engine rewrite: Initial commit 2022-11-13 15:51:36 +01:00