GPv3: Join Operator #117916
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#117916
Loading…
Reference in New Issue
No description provided.
Delete Branch "PRiera1/blender:gpv3_merge_points"
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?
Create new stroke of selected points/strokes in active layer. Resolves #113582 and #113570
In terms of UI, the operator is in the
Grease Pencil
menu, since it works for both point and stroke mode. It has also the default keymapCtrl + J
The operator affects the selection in the active layer in two possible ways, depending on the value of the rna parameter
active_layer_behavior
This enum parameter can have these values:copy selection
: the new stroke has a copy of the selected points. The already existing curves are not affected.move selection
: the points selected in the active layer are moved to the new stroke, thus affecting the existing curves.Default value is
copy selection
Video with demo for the points selection mode, using copy mode:
Same action in move mode:
Example in strokes selection mode:
Join Operatorto GPv3: Join OperatorThanks for opening it again!
BTW, I don't know why the modal that appears in the bottom-left is disabled. Perhaps I'm missing to implement some callback? Would appreciate some guidance with this.
Also, I forgot to mention in the description that, despite the rna parameter behaves effectively as a boolean, I thought it would make more sense from the UX's perspective to implement it as an enum. I think in this case a combobox is a better choice than a checkbox
@PRiera1 This is because GPv3 doesn't have an edit mode undo system yet. See !117072.
@PRiera1 Also, please keep the UI the same as GPv2. We're trying to just be compatible for now and not introduce functional changes if we can avoid it.
I noticed while testing that when using the
Copy selection
mode, the previous selection on the active layer doesn't get cleared. That's not the case in GPv2.@ -398,0 +399,4 @@
* Change the direction of selected points (switch the start and end) without changing their
* shape.
*/
void reverse_points(const IndexMask &points_to_reverse);
This API shouldn't be added here. It's too specific for what you're doing. Keep it local to the operator file.
@ -0,0 +38,4 @@
bool belongs_to_active_layer;
};
enum class ActionOnNextRange { NOTHING, REVERSE_EXISTING, REVERSE_ADDITION, REVERSE_BOTH };
These don't need to be capitalized.
@ -0,0 +40,4 @@
enum class ActionOnNextRange { NOTHING, REVERSE_EXISTING, REVERSE_ADDITION, REVERSE_BOTH };
enum ActiveLayerBehavior { COPY_SELECTION, MOVE_SELECTION };
Can also use
enum class
. Just useint(ActiveLayerBehavior::<...>)
in theEnumPropertyItem
.Also: Same as above.
@ -0,0 +423,4 @@
const int active_layer_behavior = RNA_enum_get(op->ptr, "active_layer_behavior");
const Layer *active_layer = grease_pencil.get_active_layer();
if (active_layer == nullptr) {
Better to use the dedicated function here:
b02afb17dd
to059f0abaa3
Hello @filedescriptor, I solved the issue you mention in your last comment about the selection. This PR has been open for some time. I will appreciate any review.
Hi! Thanks for approving!
Checkout
From your project repository, check out a new branch and test the changes.