GPv3: Select random operator #109009

Merged
Falk David merged 4 commits from Lorenzo-Carpaneto/blender:gpv3-select-random into main 2023-06-19 12:15:00 +02:00
Contributor

Adds a "Select random" operator for the new Grease Pencil data type.

Resolves: #108933

Adds a "Select random" operator for the new Grease Pencil data type. Resolves: #108933
Lorenzo-Carpaneto added 1 commit 2023-06-15 14:11:40 +02:00
f0b757bd3c GPv3: Select random operator
Adds a "Select random" operator for the new Grease Pencil data type.

Resolves: #108933
Lorenzo-Carpaneto changed title from GPv3: Select random operator to WIP: GPv3: Select random operator 2023-06-15 14:12:18 +02:00
Falk David requested changes 2023-06-15 14:22:40 +02:00
Falk David left a comment
Member

Looks very good already! I'll look at the UI issue and let you know.
Just a few comments.

Looks very good already! I'll look at the UI issue and let you know. Just a few comments.
@ -175,0 +199,4 @@
{
ot->name = "Select Random";
ot->idname = "GREASE_PENCIL_OT_select_random";
ot->description = "Select random points for non selected strokes";
Member

I think the description is not quite correct. I believe something like Selects random points from the current strokes selection would be more accurate.

I think the description is not quite correct. I believe something like `Selects random points from the current strokes selection` would be more accurate.
@ -247,3 +285,3 @@
keymap_grease_pencil_editing(keyconf);
}
}
Member

Not sure what happened here, maybe some added spaces? in any case, it should not be in the PR.

Not sure what happened here, maybe some added spaces? in any case, it should not be in the PR.
Author
Contributor

I reverted this change and will push now, but this was because the file is currently missing a new line at the end. Shouldn't there be one?

I reverted this change and will push now, but this was because the file is currently missing a new line at the end. Shouldn't there be one?
Member

Ah! I missed that. Yes it should have one, so you can actually keep this change.

Ah! I missed that. Yes it should have one, so you can actually keep this change.

Did I understand correctly that he selects different drawings identically, since their index is not taken into account in the noise?

Did I understand correctly that he selects different drawings identically, since their index is not taken into account in the noise?
Member

@mod_moder That is a good observation! I think what we could do is something like ed::curves::select_random(..., seed + drawing_index, ...);.

@mod_moder That is a good observation! I think what we could do is something like `ed::curves::select_random(..., seed + drawing_index, ...);`.

May better to use hash from two ints?

May better to use hash from two ints?
Member

@mod_moder Right, better to avoid seed collisions and use BLI_hash_int_2d(seed, drawing_index).

@mod_moder Right, better to avoid seed collisions and use `BLI_hash_int_2d(seed, drawing_index)`.

blender::get_default_hash_2<int>(seed, drawing_index) ?

`blender::get_default_hash_2<int>(seed, drawing_index)` ?
Member

blender::get_default_hash_2<int>(seed, drawing_index) ?

Even better :)

> `blender::get_default_hash_2<int>(seed, drawing_index)` ? Even better :)
Lorenzo-Carpaneto added 3 commits 2023-06-15 15:43:02 +02:00
a8ad31a3e3 GPv3: Select random operator
Adds a "Select random" operator for the new Grease Pencil data type.

Resolves: #108933
dc530c2382 GPv3: Select random operator
Adds a "Select random" operator for the new Grease Pencil data type.

Resolves: #108933
498e2f2720 GPv3: Select Random operator
Description updated and better randomization for each editable drawing
Lorenzo-Carpaneto requested review from Falk David 2023-06-17 16:19:31 +02:00
Falk David changed title from WIP: GPv3: Select random operator to GPv3: Select random operator 2023-06-19 10:47:53 +02:00
Falk David approved these changes 2023-06-19 12:14:31 +02:00
Falk David left a comment
Member

Tested, and works well. Congrats!

Tested, and works well. Congrats!
Falk David merged commit fb81740adc into main 2023-06-19 12:15:00 +02:00
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
3 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#109009
No description provided.