GPv3: Onion Skinning #119792

Merged
Falk David merged 20 commits from filedescriptor/blender:gpv3-old-onion-skinning into main 2024-04-03 15:34:51 +02:00
Member

Implements the onion skinning functionality.

There are no functional changes compared to GPv2 exept for the use_ghosts_always option. This was used to show onion skinning in the final render.

TODO:

  • Onion Skinning toggle in the viewport should hide the onion skinning
  • Add flags for custom colors, onion fade.
  • Onion loop.
  • Add onion skinning toggle to groups
Implements the onion skinning functionality. There are no functional changes compared to GPv2 exept for the `use_ghosts_always` option. This was used to show onion skinning in the final render. TODO: - [x] Onion Skinning toggle in the viewport should hide the onion skinning - [x] Add flags for custom colors, onion fade. - [x] Onion loop. - [x] Add onion skinning toggle to groups
Falk David added 4 commits 2024-03-22 16:15:24 +01:00
Falk David added 2 commits 2024-03-22 17:00:05 +01:00
Falk David added this to the Grease Pencil project 2024-03-22 17:00:19 +01:00
Falk David added 2 commits 2024-03-22 18:16:30 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
293c596911
Fix outline engine
Author
Member

@blender-bot build

@blender-bot build
Falk David added 1 commit 2024-03-25 10:31:35 +01:00
Falk David added 2 commits 2024-03-25 11:38:21 +01:00
Falk David added 1 commit 2024-03-25 12:28:56 +01:00
Falk David changed title from WIP: GPv3: Onion Skinning to GPv3: Onion Skinning 2024-03-25 12:29:02 +01:00
Falk David requested review from Lukas Tönne 2024-03-25 12:29:32 +01:00
Falk David force-pushed gpv3-old-onion-skinning from 39ad8f9bb9 to 870d4ccd00 2024-03-25 12:31:20 +01:00 Compare
Lukas Tönne requested changes 2024-03-26 14:02:26 +01:00
Dismissed
Lukas Tönne left a comment
Member

Code looks good, just some cleanup and comments.

Code looks good, just some cleanup and comments.
@ -233,0 +284,4 @@
layout = self.layout
layout.use_property_split = True
layout.enabled = grease_pencil.users <= 1
Member

What's the purpose of this check? Maybe add a comment.

What's the purpose of this check? Maybe add a comment.
Author
Member

My guess is that this is to indicate that the onion skinning settings are used by multiple users and shouldn't be edited? I don't know. I can also remove the check. It was just taken from the GPv2 code.

My guess is that this is to indicate that the onion skinning settings are used by multiple users and shouldn't be edited? I don't know. I can also remove the check. It was just taken from the GPv2 code.
filedescriptor marked this conversation as resolved
@ -178,6 +178,7 @@ struct DrawingInfo {
const bke::greasepencil::Drawing &drawing;
const int layer_index;
const int frame_number;
const int onion_id;
Member

Add a comment what the onion_id is (distance from current frame i suppose).

Add a comment what the `onion_id` is (distance from current frame i suppose).
filedescriptor marked this conversation as resolved
@ -239,3 +239,3 @@
GP_LAYER_TREE_NODE_MUTE = (1 << 3),
GP_LAYER_TREE_NODE_USE_LIGHTS = (1 << 4),
GP_LAYER_TREE_NODE_USE_ONION_SKINNING = (1 << 5),
GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING = (1 << 5),
Member

What's the reason for using a negative flag here? The RNA property is positive too.

What's the reason for using a negative flag here? The RNA property is positive too.
Author
Member

The flags on tree nodes are "inherited" when you access them (e.g. if the parent group of a layer is not visible, the layer is also not visible). This also applies to onion skinning. So to avoid having to change the root group value, it seemed easier to just invert the flag instead so that the default of 0 is sensible (onion skinning is shown).

The flags on tree nodes are "inherited" when you access them (e.g. if the parent group of a layer is not visible, the layer is also not visible). This also applies to onion skinning. So to avoid having to change the root group value, it seemed easier to just invert the flag instead so that the default of `0` is sensible (onion skinning is shown).
filedescriptor marked this conversation as resolved
@ -383,2 +392,4 @@
*/
int8_t mode;
/**
* Onion skinning settings flag. See `GreasePencilOnionSkinningFlag`.
Member

Usually we just comment flags with /* #GreasePencilOnionSkinningFlag. */

Usually we just comment flags with `/* #GreasePencilOnionSkinningFlag. */`
filedescriptor marked this conversation as resolved
Hans Goudey reviewed 2024-03-26 15:59:44 +01:00
@ -236,0 +252,4 @@
}
return {};
}
else if (do_onion_skinning && layer.use_onion_skinning()) {
Member

else after return

else after return
filedescriptor marked this conversation as resolved
@ -260,4 +260,2 @@
const int icon = (layer_.base.flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0 ? ICON_CLIPUV_DEHLT :
ICON_CLIPUV_HLT;
but = uiDefIconButR(block,
Member

Does it work to use a uiItem function here, instead of the lower level uiDefBut API?

Does it work to use a `uiItem` function here, instead of the lower level `uiDefBut` API?
Author
Member

I'd love too, but UI_but_flag_enable(but, UI_BUT_INACTIVE); takes a uiBut :/

I'd love too, but `UI_but_flag_enable(but, UI_BUT_INACTIVE);` takes a `uiBut` :/
Member

Just like RNA, there are multiple APIs for the same functionality. Here you should be able to use uiLayoutSetActive or uiLayoutSetEnabled.

Just like RNA, there are multiple APIs for the same functionality. Here you should be able to use `uiLayoutSetActive` or `uiLayoutSetEnabled`.
Author
Member

Ok I'll see if I can switch to using a layout with rows and such there. I remember trying this when I wrote that code, but running into issues. Don't know what those were now. I'll try again.

Ok I'll see if I can switch to using a layout with rows and such there. I remember trying this when I wrote that code, but running into issues. Don't know what those were now. I'll try again.
filedescriptor marked this conversation as resolved
Falk David added 1 commit 2024-03-28 11:41:42 +01:00
Falk David added 2 commits 2024-03-28 11:43:16 +01:00
Falk David added 1 commit 2024-03-28 12:41:33 +01:00
Falk David requested review from Lukas Tönne 2024-03-28 12:41:43 +01:00
Falk David added 1 commit 2024-03-29 11:26:45 +01:00
Lukas Tönne approved these changes 2024-04-03 09:29:32 +02:00
Falk David added 1 commit 2024-04-03 14:27:44 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
513d1e881b
Merge branch 'main' into gpv3-old-onion-skinning
Author
Member

@blender-bot build

@blender-bot build
Falk David added 1 commit 2024-04-03 15:13:04 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
b1b5dfa18d
Attempt fix compile error on windows
Author
Member

@blender-bot build

@blender-bot build
Falk David merged commit 8512a608a4 into main 2024-04-03 15:34:51 +02:00
Falk David referenced this issue from a commit 2024-04-03 15:34:52 +02:00
Falk David deleted branch gpv3-old-onion-skinning 2024-04-03 15:34:53 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#119792
No description provided.