GPv3: reorder
operator #116682
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116682
Loading…
Reference in New Issue
No description provided.
Delete Branch "casey-bianco-davis/blender:GPv3-Reorder"
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 implements the
stroke_arrange
operator for grease pencil v3This 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.
Something like #114194?
casey-bianco-davis referenced this pull request2024-01-02 00:21:15 +01:00
It looks like the function
curves.reorder_curves
in this PR has the same effect asgeometry::reorder_curves()
in #114194I think that #114194 should be merged first and then this PR updated to use
geometry::reorder_curves()
Thanks :) This looks good to me!
@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.Yeah, we should use
geometry::reorder_curves()
here IMO.@casey-bianco-davis Ping! #114194 was merged and
geometry::reorder_curves()
can be used :)GPv3: `reorder` operatorto WIP: GPv3: `reorder` operatorWIP: GPv3: `reorder` operatorto GPv3: `reorder` operatorSorry for the delay; I've been without power for a week :(
But I should make the Monday meeting :)
Thanks for updating, this looks correct to me :)
@ -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
.@ -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.@ -1605,0 +1670,4 @@
});
}
else if (direction == ReorderDirection::UP) {
Array<int32_t> selected_indices(selected.size());
Array<int>
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,
thru
->through
@ -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"));
cpp casting?:
static_cast<ReorderDirection>(RNA_enum_get(op->ptr, "direction"));
This is not a cast, it's constructing the enum.
If this is int/enum cast, then functional cast is enough.
@ -1605,0 +1731,4 @@
static void GREASE_PENCIL_OT_stroke_reorder(wmOperatorType *ot)
{
static const EnumPropertyItem prop_reorder_direction[] = {
I think this should be outside of operator function
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?
Same as elsewhere really, the smaller the scope the better. So in here is good.
Thanks, noticed one thing (maybe a merge mistake).
@blender-bot build
@ -1540,0 +1693,4 @@
/** \} */
static void grease_pencil_operatormarcos_define()
This was moved to
ED_operatormacros_grease_pencil()
, can be removed here.This is a merge mistake
@blender-bot build
Thanks, looks good.
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".