GPv3: Cyclical set operator #111904
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#111904
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "casey-bianco-davis/blender:GPv3-cyclical-set-operator"
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?
Simply sets the cyclical property selected strokes. Note this does not add extra geometry like the legacy operator.
Note: adds a key bind 'alt c' to toggle, same as for curves.
Resolves #113671
Is there some design task, or an existing operator to reference? Compared to just setting the "cyclic" attribute on curves, this seems pretty complicated. Anyway, the PR description should explain more about the decisions made in the code.
@HooglyBoogly Yea the part that takes up most of this PR is the
add_geometry
option. Basically, when closing a stroke, it would subdivide the last segment and add more points to it.I agree that this is not ideal and should probably just be handled by the subdivide operator specifically (I am not sure if subdividing the closing segment is possible right now).
It's probably better if the
set_cyclic
operator doesn't do more then setting thecyclic
attribute even though this would not be consistent with the old operator. If user really wanted to, we could still support this by using an operator macro, that would first set thecyclic
attribute and then create the points using another operator.@ -804,0 +957,4 @@
MutableSpan<bool> cyclic = curves.cyclic_for_write();
const OffsetIndices<int> points_by_curve = curves.points_by_curve();
const VArray<bool> selection = *curves.attributes().lookup_or_default<bool>(
I think it would be better to use
retrieve_selected_curves(const bke::CurvesGeometry &curves, IndexMaskMemory &memory)
and then do aIndexMask.foreach_index(...)
.retrieve_selected_curves
99a73f55ba@casey-bianco-davis I think if we remove the
if (add_geometry)
case, we could merge this PR already pretty much. You could split thegeometry
case into another PR.Awesome! Looks good.
Looks good, just two suggestions to make this extra nice :)
Suggested inline moving some constant checks out of the loop, and adding a new version of
array_utils::invert_booleans
that also takes aconst IndexMask &
parameter.Also, if the
cyclic
attribute doesn't already exist, and the mode isCLOSE
, it would be nice to avoid adding the attribute.Also, the description should be updated to reflect the current behavior.
@ -805,0 +824,4 @@
static int grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op)
{
using namespace blender;
We're already in the
blender::
namespace, this shouldn't be necessary@ -805,0 +847,4 @@
IndexMaskMemory memory;
const IndexMask curve_selection = ed::curves::retrieve_selected_curves(curves, memory);
curve_selection.foreach_index([&](const int64_t curve_i) {
Very nice, thanks!
@ -855,0 +914,4 @@
}
/* Remove the attribute if it is empty. */
if (!ed::curves::has_anything_selected(curves.cyclic(), curves.curves_range())) {
This doesn't need to run in "Close" mode.