GPv3: Frame delete operator (edit mode) #110938
No reviewers
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110938
Loading…
Reference in New Issue
No description provided.
Delete Branch "casey-bianco-davis/blender:GPv3-delete-frame"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This operator is a combination of the delete operator's
frame
mode and theactive_frames_delete_all
operator.This also add the delete menu and key binds.
@ -560,0 +609,4 @@
{
PropertyRNA *prop;
static const EnumPropertyItem prop_greasepencil_delete_types[] = {
move enum-list out of operator function? :)
Thanks. In future, make sure you add correct tags/project so modules devs can easily find the PR :)
Thank you for working on this :)
Added some comments.
@ -560,0 +562,4 @@
/** \name Delete Frame Operator
* \{ */
enum eGREASEPENCIL_DeleteFrameMode {
Since this enum is already defined in the
ed::greasepencil
namespace, it should just be namedDeleteFrameMode
.And the values just
ACTIVE_FRAME
andALL_FRAMES
.@ -560,0 +591,4 @@
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(object->data);
const int current_frame = scene->r.cfra;
eGREASEPENCIL_DeleteFrameMode mode = eGREASEPENCIL_DeleteFrameMode(
can be
const
@ -560,0 +595,4 @@
RNA_enum_get(op->ptr, "type"));
bool changed = false;
if (mode == GREASEPENCIL_DELETEFRAMEOP_ACTIVE_FRAME) {
&& grease_pencil.has_active_layer()
@ -560,0 +598,4 @@
if (mode == GREASEPENCIL_DELETEFRAMEOP_ACTIVE_FRAME) {
bke::greasepencil::Layer &layer = *grease_pencil.get_active_layer_for_write();
if (layer.is_editable()) {
changed |= layer.remove_frame(layer.frame_key_at(current_frame));
Instead of using the
layer.remove_frame
API, which does not handled deletion of drawings, this should usegrease_pencil.remove_frames(layer, {current_frame})
@ -560,0 +604,4 @@
else if (mode == GREASEPENCIL_DELETEFRAMEOP_ALL_FRAMES) {
for (bke::greasepencil::Layer *layer : grease_pencil.layers_for_write()) {
if (layer->is_editable()) {
changed |= layer->remove_frame(layer->frame_key_at(current_frame));
Same as above.
Thanks. But if I am not mistaking I would need commit access to add tags/project?
@casey-bianco-davis I think you just need to be part of the contributors group. I'll ask
One remaining comment, otherwise this looks ready :)
@ -561,0 +605,4 @@
DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_GEOM | ND_DATA | NA_EDITED, &grease_pencil);
}
else {
This else case can be removed. We usually don't report errors in case the operator doesn't have something to operate on.
GPv3: Frame delete operator (edit mode).to GPv3: Frame delete operator (edit mode)LGTM. Will commit with some cleanup changes.
Committed by
5870ffa570
Pull request closed