GPv3: reorder operator #116682

Merged
Falk David merged 14 commits from casey-bianco-davis/blender:GPv3-Reorder into main 2024-02-01 13:15:33 +01:00

This implements the stroke_arrange operator for grease pencil v3
This behaves the same as GPENCIL_OT_stroke_arrange but renamed to be more clear what the operator does.

Note: This also adds new key binds.

This implements the `stroke_arrange` operator for grease pencil v3 This behaves the same as `GPENCIL_OT_stroke_arrange` but renamed to be more clear what the operator does. Note: This also adds new key binds.
casey-bianco-davis added 1 commit 2024-01-01 01:05:36 +01:00
casey-bianco-davis requested review from Falk David 2024-01-01 01:07:51 +01:00
casey-bianco-davis added this to the Grease Pencil project 2024-01-01 01:07:58 +01:00
casey-bianco-davis added the
Interest
Grease Pencil
label 2024-01-01 01:08:01 +01:00

Something like #114194?

Something like #114194?
Author
Member

Something like #114194?

It looks like the function curves.reorder_curves in this PR has the same effect as geometry::reorder_curves() in #114194

I think that #114194 should be merged first and then this PR updated to use geometry::reorder_curves()

> Something like #114194? It looks like the function `curves.reorder_curves` in this PR has the same effect as `geometry::reorder_curves()` in #114194 I think that #114194 should be merged first and then this PR updated to use `geometry::reorder_curves()`
Falk David approved these changes 2024-01-12 11:09:18 +01:00
Falk David left a comment
Member

Thanks :) This looks good to me!

Thanks :) This looks good to me!
Member

@HooglyBoogly Let me know what you think should be done regarding CurvesGeometry::reorder_curves() vs. geometry::reorder_curves(). If the latter can be merged, that would be great.

@HooglyBoogly Let me know what you think should be done regarding `CurvesGeometry::reorder_curves()` vs. `geometry::reorder_curves()`. If the latter can be merged, that would be great.
Member

Yeah, we should use geometry::reorder_curves() here IMO.

Yeah, we should use `geometry::reorder_curves()` here IMO.
Member

@casey-bianco-davis Ping! #114194 was merged and geometry::reorder_curves() can be used :)

@casey-bianco-davis Ping! #114194 was merged and `geometry::reorder_curves()` can be used :)
casey-bianco-davis changed title from GPv3: `reorder` operator to WIP: GPv3: `reorder` operator 2024-01-21 08:02:29 +01:00
casey-bianco-davis added 4 commits 2024-01-21 08:02:44 +01:00
casey-bianco-davis added 1 commit 2024-01-21 09:19:20 +01:00
casey-bianco-davis changed title from WIP: GPv3: `reorder` operator to GPv3: `reorder` operator 2024-01-21 09:21:56 +01:00
Author
Member

Sorry for the delay; I've been without power for a week :(
But I should make the Monday meeting :)

Sorry for the delay; I've been without power for a week :( But I should make the Monday meeting :)
Falk David approved these changes 2024-01-23 16:23:14 +01:00
Falk David left a comment
Member

Thanks for updating, this looks correct to me :)

Thanks for updating, this looks correct to me :)
Iliya Katushenock reviewed 2024-01-23 18:47:46 +01:00
@ -261,6 +261,17 @@ PointCloud *reorder_points(const PointCloud &src_pointcloud,
return dst_pointcloud;
}
bke::CurvesGeometry reorder_curves_geometry(

You can share this code with reorder_curves.

You can share this code with `reorder_curves`.
casey-bianco-davis marked this conversation as resolved
Iliya Katushenock reviewed 2024-01-23 18:52:52 +01:00
@ -1605,0 +1661,4 @@
B.to_indices(indices.as_mutable_span().take_back(B.size()));
}
else if (direction == ReorderDirection::DOWN) {
selected.foreach_index([&](const int curve_i, const int pos) {

Can be foreach_index_optimized<int>, pretty simple loop.

Can be `foreach_index_optimized<int>`, pretty simple loop.
casey-bianco-davis marked this conversation as resolved
@ -1605,0 +1670,4 @@
});
}
else if (direction == ReorderDirection::UP) {
Array<int32_t> selected_indices(selected.size());

Array<int>

`Array<int>`
casey-bianco-davis marked this conversation as resolved
Pratik Borhade reviewed 2024-01-24 11:36:48 +01:00
Pratik Borhade left a comment
Member

Hi, I also checked the PR locally and it's working correctly :D

Hi, I also checked the PR locally and it's working correctly :D
@ -1605,0 +1673,4 @@
Array<int32_t> selected_indices(selected.size());
selected.to_indices(selected_indices.as_mutable_span());
/* Because each index is moving up we need to loop thru the indices backwards,
Member

thru -> through

`thru` -> `through`
casey-bianco-davis marked this conversation as resolved
@ -1605,0 +1696,4 @@
Object *object = CTX_data_active_object(C);
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(object->data);
const ReorderDirection direction = ReorderDirection(RNA_enum_get(op->ptr, "direction"));
Member

cpp casting?: static_cast<ReorderDirection>(RNA_enum_get(op->ptr, "direction"));

cpp casting?: `static_cast<ReorderDirection>(RNA_enum_get(op->ptr, "direction"));`
Member

This is not a cast, it's constructing the enum.

This is not a cast, it's constructing the enum.

If this is int/enum cast, then functional cast is enough.

If this is int/enum cast, then functional cast is enough.
casey-bianco-davis marked this conversation as resolved
@ -1605,0 +1731,4 @@
static void GREASE_PENCIL_OT_stroke_reorder(wmOperatorType *ot)
{
static const EnumPropertyItem prop_reorder_direction[] = {
Member

I think this should be outside of operator function

I think this should be outside of operator function
Member

It's a good question. I think that's only needed if something else needs to use this EnumPropertyItem.
@HooglyBoogly @LukasTonne What do you think about this?

It's a good question. I think that's only needed if something else needs to use this `EnumPropertyItem`. @HooglyBoogly @LukasTonne What do you think about this?
Member

Same as elsewhere really, the smaller the scope the better. So in here is good.

Same as elsewhere really, the smaller the scope the better. So in here is good.
casey-bianco-davis marked this conversation as resolved
casey-bianco-davis added 5 commits 2024-01-27 23:48:33 +01:00
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-lint 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
852c116647
Cleanup: Grammar in comment
casey-bianco-davis requested review from Falk David 2024-01-28 00:09:54 +01:00
Falk David requested changes 2024-01-29 11:54:10 +01:00
Falk David left a comment
Member

Thanks, noticed one thing (maybe a merge mistake).

Thanks, noticed one thing (maybe a merge mistake).
Member

@blender-bot build

@blender-bot build
Falk David reviewed 2024-01-29 12:01:06 +01:00
@ -1540,0 +1693,4 @@
/** \} */
static void grease_pencil_operatormarcos_define()
Member

This was moved to ED_operatormacros_grease_pencil(), can be removed here.

This was moved to `ED_operatormacros_grease_pencil()`, can be removed here.
Author
Member

This is a merge mistake

This is a merge mistake
casey-bianco-davis marked this conversation as resolved
casey-bianco-davis added 2 commits 2024-01-30 02:47:09 +01:00
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
702f36e968
Cleanup: Fix merge error.
casey-bianco-davis requested review from Falk David 2024-01-30 02:48:38 +01:00
Member

@blender-bot build

@blender-bot build
Falk David approved these changes 2024-02-01 13:12:00 +01:00
Falk David left a comment
Member

Thanks, looks good.

Thanks, looks good.
Falk David added 1 commit 2024-02-01 13:12:50 +01:00
Falk David merged commit 1b6e3d46a9 into main 2024-02-01 13:15:33 +01:00

Just as a comment, the name "Arrange" may seem less clear, but we used that name in GPv2 because that is the common name for this operation in most 2D software. For anyone used to using other software, "Arrange" has a clear meaning, much clearer than "Reorder".

Just as a comment, the name "Arrange" may seem less clear, but we used that name in GPv2 because that is the common name for this operation in most 2D software. For anyone used to using other software, "Arrange" has a clear meaning, much clearer than "Reorder".
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
6 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#116682
No description provided.