Fix #115140: Crash undoing painting on linked image from 3DView #115263

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:115140 into main 2023-11-28 12:05:17 +01:00
Member

Related commit: 82aa300e1c / 5596f79821

82aa300e1c made it so that if only linked images are used, painting
would be prohibited. But since painting in Material mode actualy paints
across all materials it could happen that one particular image is linked
whereas another image isnt. In this case, painting on the linked image
would not be prohibited.

Two issues:

  • [1] logic in above commit(s) seems slightly wrong, we could still pass
    the check for linked images (also no image here should also not result
    in a positive check I think).

  • [2] code in project_paint_prepare_all_faces would still work with
    linked images in slots, so
    -- ProjPaintState -> image_tot was incremented
    -- ProjPaintImage was created
    -- this then ends up in the undo push - and crashes on undo

So now [1] is rectified and for [2] we skip faces with associated linked
images.

In addition, slots with linked images are now also greyed out in the UI
(VIEW3D_PT_slots_projectpaint) to give some sort of hint. For the
future it would probably also be good to dissallow selection of such
paint slots, but that is for another commit.

Related commit: 82aa300e1ce4 / 5596f79821ca 82aa300e1ce4 made it so that if only linked images are used, painting would be prohibited. But since painting in Material mode actualy paints across all materials it could happen that one particular image is linked whereas another image isnt. In this case, painting on the linked image would not be prohibited. Two issues: - [1] logic in above commit(s) seems slightly wrong, we could still pass the check for linked images (also no image here should also not result in a positive check I think). - [2] code in `project_paint_prepare_all_faces` would still work with linked images in slots, so -- `ProjPaintState` -> `image_tot` was incremented -- `ProjPaintImage` was created -- this then ends up in the undo push - and crashes on undo So now [1] is rectified and for [2] we skip faces with associated linked images. In addition, slots with linked images are now also greyed out in the UI (`VIEW3D_PT_slots_projectpaint`) to give some sort of hint. For the future it would probably also be good to dissallow selection of such paint slots, but that is for another commit.
Philipp Oeser added 1 commit 2023-11-22 12:07:25 +01:00
cc3bfc1571 Fix #115140: Crash undoing painting on linked image from 3DView
Related commit: 82aa300e1c / 5596f79821

82aa300e1c made it so that if only linked images are used, painting
would be prohibited. But since painting in Material mode actualy paints
across all materials it could happen that one particular image is linked
whereas another image isnt. In this case, painting on the linked image
would not be prohibited.

Two issues:

- [1] logic in above commit(s) seems slightly wrong, we could still pass
the check for linked images (also no image here should also not result
in a positive check I think).

- [2] code in `project_paint_prepare_all_faces` would still work with
linked images in slots, so
-- `ProjPaintState` -> `image_tot` was incremented
-- `ProjPaintImage` was created
-- this then ends up in the undo push - and crashes on undo

So now [1] is rectified and for [2] we skip faces with associated linked
images.

In addition, slots with linked images are now also greyed out in the UI
(`VIEW3D_PT_slots_projectpaint`) to give some sort of hint. For the
future it would probably also be good to dissallow selection of such
paint slots, but that is for another commit.
Philipp Oeser added this to the Sculpt, Paint & Texture project 2023-11-22 12:07:47 +01:00
Philipp Oeser added the
Interest
ID Management
label 2023-11-22 12:07:54 +01:00
Philipp Oeser requested review from Bastien Montagne 2023-11-22 12:08:00 +01:00
Philipp Oeser requested review from Brecht Van Lommel 2023-11-22 12:08:06 +01:00
Bastien Montagne approved these changes 2023-11-27 14:41:02 +01:00
Bastien Montagne left a comment
Owner

LGTM

LGTM
@ -6437,9 +6444,9 @@ bool ED_paint_proj_mesh_data_check(
BKE_texpaint_slot_refresh_cache(scene, ma, ob);
}
if (ma->texpaintslot != nullptr &&
(ma->texpaintslot[ma->paint_active_slot].ima == nullptr ||

Indeed, logic here was utterly broken :(

Indeed, logic here was utterly broken :(
Philipp Oeser merged commit a4b8d214c6 into main 2023-11-28 12:05:17 +01:00
Philipp Oeser deleted branch 115140 2023-11-28 12:05:19 +01:00
Sign in to join this conversation.
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 Assignees
2 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#115263
No description provided.