Sculpt: Add polyline hide operator #119483
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119483
Loading…
Reference in New Issue
No description provided.
Delete Branch "Sean-Kim/blender:polyline-hide"
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 PR adds a polyline hide operator for sculpt mode as well as the necessary generic callback code to allow using this gesture in other selection tools.
Added Features
WM_gesture_polyline_*
callback functions for usage in other operatorsKnown Limitations
Design Task: #119353
@ -96,3 +96,3 @@
}
std::unique_ptr<GestureData> init_from_lasso(bContext *C, wmOperator *op)
static std::unique_ptr<GestureData> init_from_lasso(bContext *C,
I'm unsure about the naming here and for a term that would encompass both types. Originally I was thinking of "border" but that term is already currently used to specifically mean box selection in other areas of Blender.
@ -83,0 +83,4 @@
else if (ELEM(type, WM_GESTURE_POLYLINE)) {
gesture->points_alloc = 64;
short *border = static_cast<short int *>(
MEM_mallocN(sizeof(short[2]) * gesture->points_alloc, "polyline points"));
I'm unsure of the data structure here, I was also considering using
To make the code intent more explicit, but opted instead to always store the current position in the last spot of the current array.
Does the sculpt gesture system have to know that the polyline shape exists? Seems that the existing lasso code could be used directly by the new operators without changing anything.
@ -692,0 +911,4 @@
ot->name = "Polyline Gesture";
ot->idname = "WM_OT_polyline_gesture";
ot->description = "Outline a selection area with each mouse click.";
The period is added automatically here
@HooglyBoogly That's a fair point. I thought it would be best to be explicit about them being different types for future maintenance since
would read to me as an error at
init_from_lasso
if I was more unfamiliar with the code. In the end though, I can't think of any particular usecase where the lasso and polyline code actually need to diverge withinsculpt_gesture.cc
Right, I agree. I would have had the same instinct to make things explicit like that, but I don't think it helps us in practice and will probably end up with unnecessary boilerplate in a lot of places.
No idea what's going on with this issue - noticed it somehow removed you from the reviewer list...?
Sounds good, I'll make the change here and consider renaming or adding other comments in
sculpt_gesture.cc
in a later PR to be more indicative of future usage.Just to make sure, to run the tool,
Enter
also works, right? the gif only shows the "click on first point" method@ThinkingPolygons - Yes, pressing enter will also submit the shape - I didn't add a GIF for that.
@Sergey @HooglyBoogly could anytone of you get @buildbot to make a build of this PR so that I can test from a users POV?
@blender-bot package
Package build started. Download here when ready.
I suspect something is wrong with the current build
https://builder.blender.org/download/patch/PR119483
When using lasso hide or polyline hide, nothing happens. I activate the tool in the toolbar, press left mouse down and drag on the screen over a spher. Nothing happens. Box hide works as intended.
@DanielBystedt the polyline tool is working fine, the lasso tool is not
also, the polyline works by clicking to add points, not click and drag
I fixed the issue @ThinkingPolygons brought up, made a mistake with the keymap entries, so Lasso Hide should be working again. I confirmed that Polyline Hide is also working still in this build. Since I don't have permissions to kick off a new package build, could you submit another request @HooglyBoogly ?
Clicked the wrong button and accidentially closed it...
WIP: Sculpt: Add polyline hide operatorto Sculpt: Add polyline hide operatorUpdated and removed WIP. I've been working on making an icon for this separately, but the process is taking a bit longer than I'd like so I changed the icon here to just use the "None" placeholder.
@blender-bot package
Package build started. Download here when ready.
In terms of functionality the polyline hide perfectly. Thanks for adding hotkey hints in the lower info bar! The tool icon is currently missing, but once there is an icon I am ready to approve the commit.
Let me know if the icon will be added in another PR for whatever reason.
@DanielBystedt - I was planning on adding it in a future PR since we're still in alpha for 4.2 until June 5th. If you think we need one before landing this, would a reasonable compromise here be adding it to theSculpt
menu only and changing the toolbar when the icon is done?Edit: Ignore this, I finished the icon file recently so at this point I think this question is moot.
Just a note that @JulienKaspar and @pablovazquez left some notes on the icon here
blender/blender-assets#2
Once the the icon comments are fixed I am ready to approve the PR
@blender-bot package
Only blender organization members with write access can start builds. See documentation for details.
@HooglyBoogly can you make a trigger a build with blender-bot? I just want to check the build before approving the commit
@blender-bot package
Package build started. Download here when ready.
any news on this?
@ThinkingPolygons - The icon PR was recently updated. Once that gets approved, I'll update this PR with the latest changes and then the only thing remaining should be the functional review from Hans and any changes that come from that
Sean Kim referenced this pull request2024-04-12 03:44:00 +02:00
I think there's an issue with the right click select keymap, it works quite differently-- I have to hold down right click for the whole operation and add points with LMB.
@ -1664,0 +1664,4 @@
/* In the context of a sculpt gesture, both lasso and polyline modal
* operators are handled as the same general shape.
* TODO: Rename to polygon? */
I think the current name is fine, at least it's not worth adding a TODO here
@ -697,0 +809,4 @@
break;
}
const float cur[2] = {float(cur_x), float(cur_y)};
const float2 cur(cur_x, cur_y);
same with
orig
Thanks for the feedback - haven't yet addressed this in the most recent commit.
Updated the keymap so that with RCS enabled, the interactions remain the same (i.e. starting the tool & adding points with LMB and canceling with RMB / ESC)
Works great! I'll wait for Daniel's approval to commit this.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Works great. Thank you for the commit!