Fix: Vertex paint filter operators broken undo #106136

Merged
Joseph Eagar merged 3 commits from JosephEagar/blender:blender-v3.5-vpaint_fixes into blender-v3.5-release 2023-03-25 22:10:20 +01:00
Member

Vertex paint's filter operators were not properly going through the SculptSession API.
Undo didn't work and sometimes the operators would do nothing or produce corrupted colors.

The transform_active_color helper function now handles all of this. It ensures a valid
SculptSession exists and executes an undo push.

Vertex paint's filter operators were not properly going through the SculptSession API. Undo didn't work and sometimes the operators would do nothing or produce corrupted colors. The `transform_active_color` helper function now handles all of this. It ensures a valid SculptSession exists and executes an undo push.
Joseph Eagar added 1 commit 2023-03-25 19:23:00 +01:00
db8141df4e Sculpt: Fix vertex paint filter operators
Refactored vpaint filter ops to properly set up
a SculptSession and execute an undo push.
Hans Goudey requested changes 2023-03-25 21:00:34 +01:00
Hans Goudey left a comment
Member

Mostly looks reasonable, just a request for an improved comment and another small tweak mentioned inline.

Mostly looks reasonable, just a request for an improved comment and another small tweak mentioned inline.
@ -1848,2 +1848,4 @@
if (is_paint_tool) {
if (ss->vcol_domain == ATTR_DOMAIN_CORNER) {
/* Ensure pbvh nodes have loop indices, needed for undo. */
Member

This sort of comment ends up being confusing a year later, it says "needed for undo" but that brings up more questions than it answers-- why would "undo" need this data? what is meant by "undo" here? etc.

I don't know the actual reason, but I'd expect something like "needed in order to interpolate from face corners to vertices for undo step storage"

And one more question, could the sculpt undo system call this function directly rather than doing it here?

This sort of comment ends up being confusing a year later, it says "needed for undo" but that brings up more questions than it answers-- why would "undo" need this data? what is meant by "undo" here? etc. I don't know the actual reason, but I'd expect something like "needed in order to interpolate from face corners to vertices for undo step storage" And one more question, could the sculpt undo system call this function directly rather than doing it here?
@ -13,6 +13,7 @@
#include "BLI_array.hh"
#include "BLI_index_mask_ops.hh"
#include "BLI_index_range.hh"
Member

Not sure where this BKE_mesh_mapping.h include is coming from, it doesn't look necessary here.

Not sure where this `BKE_mesh_mapping.h` include is coming from, it doesn't look necessary here.
@ -291,0 +306,4 @@
int nodes_num;
BKE_pbvh_search_gather(obact->sculpt->pbvh, nullptr, nullptr, &nodes, &nodes_num);
for (int i : IndexRange(nodes_num)) {
Member

I'm not sure, but it seems more clear/common to add the update tags directly after the data is changed rather than before.

I'm not sure, but it seems more clear/common to add the update tags directly after the data is changed rather than before.

Do you consider this a regression? At this point (4 days before the release) only critical issues should be fixed in 3.5.

Do you consider this a regression? At this point (4 days before the release) only critical issues should be fixed in 3.5.
Joseph Eagar added 1 commit 2023-03-25 21:57:06 +01:00
Hans Goudey reviewed 2023-03-25 21:59:53 +01:00
Member

This header is still added in this patch.

This header is still added in this patch.
Joseph Eagar added 1 commit 2023-03-25 22:01:44 +01:00
Hans Goudey approved these changes 2023-03-25 22:05:29 +01:00
Hans Goudey left a comment
Member

Fix commit titles should begin with Fix:, so maybe something like Fix: Vertex paint filter operators broken undo

Fix commit titles should begin with `Fix:`, so maybe something like `Fix: Vertex paint filter operators broken undo`
Author
Member

Do you consider this a regression? At this point (4 days before the release) only critical issues should be fixed in 3.5.

It's a regression, yes, it makes the operators pretty much unusable.

> Do you consider this a regression? At this point (4 days before the release) only critical issues should be fixed in 3.5. It's a regression, yes, it makes the operators pretty much unusable.
Joseph Eagar changed title from Sculpt: Fix vertex paint filter operators to Fix: Vertex paint filter operators broken undo 2023-03-25 22:07:47 +01:00
Joseph Eagar merged commit 16cb13b8a0 into blender-v3.5-release 2023-03-25 22:10:20 +01:00
Joseph Eagar deleted branch blender-v3.5-vpaint_fixes 2023-03-25 22:10:21 +01: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#106136
No description provided.