Mesh: Set active attribute values edit mode operator #104426

Merged
Hans Goudey merged 8 commits from HooglyBoogly/blender:mesh-edit-attribute-set-operator into main 2023-02-15 04:35:03 +01:00
Member

This patch adds a simple operator to set values of the active attribute for
the selected element. The aim is to give simple control over attribute values
in edit mode rather than to provide the fastest workflow for most cases.
Eventually this operator might be less important compared to more advanced
attribute editing tools, but for now, exposing a little bit of functionality
is low hanging fruit and will help to see the possibilities.

The implementation mostly consists of boilerplate to register the necessary
property types for the operator and draw their UI. Beyond that, we just loop
over selected elements and set a value.

This patch adds a simple operator to set values of the active attribute for the selected element. The aim is to give simple control over attribute values in edit mode rather than to provide the fastest workflow for most cases. Eventually this operator might be less important compared to more advanced attribute editing tools, but for now, exposing a little bit of functionality is low hanging fruit and will help to see the possibilities. The implementation mostly consists of boilerplate to register the necessary property types for the operator and draw their UI. Beyond that, we just loop over selected elements and set a value.
Hans Goudey added 1 commit 2023-02-07 19:44:32 +01:00
This patch adds a simple operator to set values of the active attribute for
the selected element. The aim is to give simple control over attribute values
in edit mode rather than to provide the fastest workflow for most cases.
Eventually this operator might be less important compared to more advanced
attribute editing tools, but for now, exposing a little bit of functionality
is low hanging fruit and will help to see the possibilities.

The implementation mostly consists of boilerplate to register the necessary
property types for the operator and draw their UI. Beyond that, we just loop
over selected elements and set a value.
Hans Goudey added 1 commit 2023-02-07 19:49:00 +01:00
Add a new node that groups faces inside of boundary edge regions.
This is the opposite action as the existing "Face Group Boundaries" node[1].
It's also the same as some of the "Initialize Face Sets" options in sculpt mode [2].

Discussion in T102962 has favored "Group" for a name for these
sockets rather than "Set", so that is used here.

[1]: https://docs.blender.org/manual/en/3.4/modeling/geometry_nodes/mesh/face_set_boundaries.html
[2]: https://docs.blender.org/manual/en/3.5/sculpt_paint/sculpting/editing/face_sets.html#initialize-face-sets
Hans Goudey requested review from Campbell Barton 2023-02-07 19:53:18 +01:00
Hans Goudey added 1 commit 2023-02-09 18:51:22 +01:00
Hans Goudey added 28 commits 2023-02-12 22:32:57 +01:00
Fixed #104435: Use correct conditional logic when testing if a new NLA strip can be added in the rna_NlaStrip_new method
Fix #104383: don't update declaration for clipboard copy
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
2cfc4d7644
When nodes are copied to the clipboard, they don't need their declaration.
For nodes with dynamic declaration that might depend on the node tree itself,
the declaration could not be build anyway, because the node-clipboard does
not have a node tree.

Pull Request #104432
Cleanup: Move 6 sculpt-session-related files and header to C++
Some checks failed
buildbot/vdev-code-daily-coordinator Build done.
5c8edbd99b
To allow further mesh data structure refactoring. See #103343

Pull Request #104540
GPU: Cleanup GPU_batch.h documentation and some of the API for consistency
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
7e0e07657c
Documented all functions, adding use case and side effects.

Also replace the use of shortened argument name by more meaningful ones.

Renamed `GPU_batch_instbuf_add_ex` and `GPU_batch_vertbuf_add_ex` to remove
the `ex` suffix as they are the main version used (removed the few usage
of the other version).

Renamed `GPU_batch_draw_instanced` to `GPU_batch_draw_instance_range` and
make it consistent with `GPU_batch_draw_range`.
Move the function for getting the language code associated with the
user manual into a utility function (from the generated
rna_manual_reference.py).

This allows other parts of Blender to create a manual URL based on the
current locale preferences and environment.

Ref !104494
Use bpy.utils.manual_language_code() create manual URL's instead of
assuming English.
- undeclared variable warning.
- unreachable-code-return warnings.
- array-parameter, mismatch bound.
- 'requires' is a keyword in C++20, (rename to requires_flag).
Cleanup: spelling in comments
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
4cbe0bff34
The generator now skips these with a warning, they will need to be
corrected in the user manual.

This caused tests/python/bl_rna_manual_reference.py to fail looking
up URL's.
RNA: return a dummy language value when WITH_INTERNATIONAL=OFF
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
c2c62c3618
Without this, every access to "language" would warn that the enum
value didn't match a value in the enum items.

This made the bl_rna_manual_reference.py test output practically
unusable.
Tests: minor updates to make bl_rna_manual_reference more useful
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
b77c82e2bb
- Avoid flooding the output with every match that succeeds.
- Report patterns listed in the manual that don't match anything in
  Blender.
- Disable external URL lookups, this is too slow.
  Instead use a LOCAL_PREFIX (a local build of the manual)
  or skip the test.
Cycles: Fix MetalRT checkbox not hooked up to device on AMD
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
01480229b1
(Follow on from D17043)
On AMD Navi2 devices the MetalRT checkbox was not hooked up properly and had no effect. This patch fixes it.

Co-authored-by: Michael Jones <michael_p_jones@apple.com>
Pull Request #104520
Fix #104026: Click-Drag to select graph editor channels no longer working
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
51ceeb506f
Box-Selecting channels in the dope sheet with click-drag was no longer possible as of Blender 3.2

Due to the removal of tweak events the box select operator was always shadowed by the click operator.

Original Phabricator discussion here: https://archive.blender.org/developer/D17065

Use `WM_operator_flag_only_pass_through_on_press` on click operator to fix it

Co-authored-by: Christoph Lendenfeld <chris.lenden@gmail.com>
Pull Request #104505
Sequencer: Don't create undo step when click-select does nothing
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
5d30c3994e
When the sequencer is empty (i.e., there are no sequences),
we would have the deselect_all variable set to true called
ED_sequencer_deselect_all to select any existing sequences.

Ref !104453
Fix #104514: GPencil merge down layer misses some frames
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
dc9f7fe64f
When merging two gpencil layers, if the destination layer had a keyframe
where the source layer did not, strokes of the previous keyframe
in source layer were lost in that frame.

This happened because the merge operator was looping through
frames of the source layer and appending strokes in the
corresponding destination layer, but never completing
other frames than the ones existing in the source layer.

This patch fixes it by first adding in source layer
all frames that are in destination layer.

Co-authored-by: Amelie Fondevilla <amelie.fondevilla@les-fees-speciales.coop>
Pull Request #104558
Sculpt: Fix Dyntopo Warnings
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
88f9c55f7f
Because of T95965, some attributes are stored as generic attributes
in Mesh but have special handling for the conversion to BMesh.

Expose a function to tell whether certain attribute names are handled
specially in the conversion, and refactor the error checking process
to use it. Also check for generic attributes on the face domain which
wasn't done before.

Author: Hans Goudey
Reviewed By: Joseph Eagar

Co-authored-by: Joseph Eagar <joeedh@gmail.com>
Pull Request #104567
Geometry Nodes: Experimental option for Volumes
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
bad2c3b9ef
Adds an experimental option under "New Features" in preferences,
which enables visibility of the new Volume Nodes.
Right now this option does nothing but will be used during development.
See #103248

Pull Request #104552
Cleanup: Use lambdas in mesh mapping callback, remove unused arguments
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
284cdbb6cf
Using callback functions didn't scale well as more arguments are added.
It got very confusing when to pass tehmarguments weren't always used.
Instead use a `FunctionRef` with indices for arguments. Also remove
unused edge arguments to topology mapping functions.
Fix: Inaccessible default for node group image sockets
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
0ea15a6fbb
The type was just skipped when drawing defaults for the image sockets.
This just adds `threading::parallel_for` and `threading::parallel_invoke` in a few
places where it can be added trivially. The run time of the `separate_geometry`
function changes from 830 ms to 413 ms in my test file.

Pull Request #104563
Revert "Un-ignore modules in .gitmodules configuration"
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
fae661a1ab
This reverts commit aab707ab70.

A different solution to the submodule problem is being considered in #104573.
Revert to the previous behavior that developers are familiar with for now.
Cleanup: Use utility function to find groups in node tree
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
d411be8a99
Add `contains_group` method in python api for `NodeTree` type, cleanup
`ntreeHasTree` function, reuse `ntreeHasTree` in more place in code.
The algorithm has been changed to not recheck trees by using set.

Performance gains from avoiding already checked node trees:
Based on tests, can say that for large files with a huge number
of trees, the response speed of opening the search menu in the
node editor increased by ~200 times (for really large projects
with 16 individual groups in 6 levels of nesting). Group insert
operations are also accelerated, but this is different in some cases.

Pull Request #104465
This adds a new `select_linked` function that selects all the points
on a curve if there is at least one point already selected.
This also adds a keymap for the operator.

Co-authored-by: Falk David <falkdavid@gmx.de>
Pull Request #104569
"Center" -> "Middle" when describing vertical alignment.
"Align X" -> "Horizontal Alignment"
"Align Y" -> "Vertical Alignment"
Vertical alignment options rearranged to be consistently top-most to
bottom-most.

---

Co-authored-by: joshua-maros <60271685+joshua-maros@users.noreply.github.com>
Pull Request #104493
Curves: Add lasso and circle select
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
7351f533e0
This adds a `select_lasso` and a `select_circle` function for the Curves object. It is used in the `view3d_lasso_select` and `view3d_circle_select` operator.

Co-authored-by: Falk David <falkdavid@gmx.de>
Pull Request #104560
Tests: Fix device list of benchmark script only showing a single GPU
All checks were successful
buildbot/vdev-code-daily-coordinator Build done.
8a32d56056
Pull Request #104583
Brecht Van Lommel added this to the Modeling project 2023-02-13 09:25:32 +01:00
Hans Goudey added 1 commit 2023-02-13 22:59:00 +01:00
Hans Goudey added 1 commit 2023-02-14 03:57:50 +01:00
Campbell Barton reviewed 2023-02-15 03:38:13 +01:00
@ -0,0 +354,4 @@
ot->description = "Set values of the active attribute for selected elements";
ot->idname = "MESH_OT_attribute_set";
ot->exec = set_attribute_exec;

Prefer unique names that follow the operator naming, makes it convenient to add breakpoints, mesh_attribute_set_exec, mesh_attribute_set_ui ... etc.

Prefer unique names that follow the operator naming, makes it convenient to add breakpoints, `mesh_attribute_set_exec`, `mesh_attribute_set_ui` ... etc.
HooglyBoogly marked this conversation as resolved
Campbell Barton approved these changes 2023-02-15 03:38:32 +01:00
Campbell Barton left a comment
Owner

LGTM, (minor request inline)

LGTM, (minor request inline)
Hans Goudey added 2 commits 2023-02-15 04:28:26 +01:00
Hans Goudey merged commit 6661342dc5 into main 2023-02-15 04:35:03 +01:00
Hans Goudey deleted branch mesh-edit-attribute-set-operator 2023-02-15 04:35:04 +01:00
Member

This is nice but shoudn't this properties be exposed in the N panel?

There is precedence of this with regular custom properties
image

And even more relevant with hardcoded attributes like bevel or crease
image

Floating dialogs are a bad way to edit property values because of their lack of visibility and their volatility.

This is nice but shoudn't this properties be exposed in the N panel? There is precedence of this with regular custom properties ![image](/attachments/f1906972-7333-4e98-99c7-9a2698e5bf85) And even more relevant with hardcoded attributes like bevel or crease ![image](/attachments/1b1e86fc-8dc3-4d73-8071-7b662df1c99d) Floating dialogs are a bad way to edit property values because of their lack of visibility and their volatility.
Author
Member

This is only the first of quite a few ways we talked about to edit attributes. It was by far the simplest to implement, which made it possible to get the ability to edit attributes into 3.5. We also talked about showing the attributes in the side panel, interactive gizmos for different attribute types, and a "technical paint mode" for painting generic attributes.

This is only the first of quite a few ways we talked about to edit attributes. It was by far the simplest to implement, which made it possible to get the ability to edit attributes into 3.5. We also talked about showing the attributes in the side panel, interactive gizmos for different attribute types, and a "technical paint mode" for painting generic attributes.
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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
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#104426
No description provided.