Grease Pencil: Sculpt Tools Will Revert Back to Add After One Use of Subtract #115313
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115313
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: Microsoft Windows 11 Home
Graphics card: NVIDIA GeForce RTX 3060 Ti
Blender Version
Broken: 4.0.0 (As shown on splash screen and downloaded from the main website)
Worked: 3.6.6 Stable
Short description of error
When manually switching a sculpt tool from +add to -subtract (As in pressing the GUI button, rather than using the CTRL key), the tool will automatically switch back to +add after using it one time.
(I have tested this on the 4.1.0 Alpha with both my own settings configs and factory default settings with the same result)
Exact steps for others to reproduce the error
Open a 2D Animation file or create a new one.
Draw a stroke of any thickness.
Go into sculpt mode.
Change the tool to any tool that has an alternate mode (+ -) and set the mode to the subtract mode.
Sculpt the stroke once, if it does not change back immediately try sculpting the stroke one more time.
I also have that
Hi, thanks for the report. Can confirm the regression, checking.
Caused by
325acb51df
@JacquesLucke @antoniov ^
Guess I found the fix.
The root problem here seems to be that
BrushGpencilSettings.sculpt_flag
is a mess. It's used with e.g.BRUSH_DIR_IN
(fromeBrushFlags
), withGP_SCULPT_FLAG_TMP_INVERT
(fromeGP_Sculpt_Flag
) andGP_SCULPT_FLAGMODE_APPLY_THICKNESS
(fromeGP_Sculpt_Mode_Flag
).This caused the issue in the C++ conversion, because of the newly added
ENUM_OPERATORS(eGP_Sculpt_Flag, GP_SCULPT_FLAG_TMP_INVERT)
. The problem is that the passed max value is not actually the max value, even though it looks like it should based on the code.The fix would be to pass the actual max value into the
ENUM_OPERATORS
macro. Since the max value is not obvious right now, I'd like to ask @antoniov to look into this.Following diff fixes the problem:
Below bitwise operation was giving wrong answer after clearing the flag so I tried explicit casting.
But I don't quite understand why we require explicit casting here, shouldn't enum be implicitly treated as int in this operation?
Oh @JacquesLucke already commented, didn't notice that
Your fix should work as well, but I think it would be better to fix the root cause of the bug.
@antoniov Could you look into this. It seems like right now there is
sculpt_flag
andsculpt_mode_flag
, but sometimessculpt_flag
is using flags fromeGP_Sculpt_Mode_Flag
oreBrushFlags
. There should be some consistency here.I'm really sorry, but right now I'm very busy working on several personal projects and I don't have the time or energy to dedicate myself to fixing Blender bugs.
Any update here? Would be good to have a solution for 4.1, even if the root cause isn't fixed.
@ThomasDinges working on it :)