Fix #110341: Appended text looses user after reload #110344

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:110341 into main 2023-07-21 14:41:52 +02:00
Member

Even if a text datablock was "used" by in the Text Editor, it would be
lost after save/reload if no fake user is set.

This is not in line with other datablocks if they are used by an editor
(e.g. images, clips, masks etc.).

Now handle this with IDWALK_CB_USER_ONE (instead of IDWALK_CB_NOP)
in id_refcount_recompute_callback >
BKE_screen_foreach_id_screen_area which re-ensures a user is set.

(Bit on shaky ground here, but this seems like this is how this is
handled for other editors "consuming" a datablock).

Even if a text datablock was "used" by in the Text Editor, it would be lost after save/reload if no fake user is set. This is not in line with other datablocks if they are used by an editor (e.g. images, clips, masks etc.). Now handle this with `IDWALK_CB_USER_ONE` (instead of `IDWALK_CB_NOP`) in `id_refcount_recompute_callback` > `BKE_screen_foreach_id_screen_area` which re-ensures a user is set. (Bit on shaky ground here, but this seems like this is how this is handled for other editors "consuming" a datablock).
Philipp Oeser added 1 commit 2023-07-21 14:24:56 +02:00
Even if a text datablock was "used" by in the Text Editor, it would be
lost after save/reload if no fake user is set.

This is not in line with other datablocks if they are used by an editor
(e.g. images, clips, masks etc.).

Now handle this with `IDWALK_CB_USER_ONE` (instead of `IDWALK_CB_NOP`)
in `id_refcount_recompute_callback` >
`BKE_screen_foreach_id_screen_area` which re-ensures a user is set.

(Bit on shaky ground here, but this seems like this is how this is
handled for other editors "consuming" a datablock).
Philipp Oeser added this to the Core project 2023-07-21 14:25:05 +02:00
Philipp Oeser added the
Interest
ID Management
label 2023-07-21 14:25:13 +02:00
Philipp Oeser requested review from Bastien Montagne 2023-07-21 14:25:21 +02:00
Bastien Montagne approved these changes 2023-07-21 14:33:17 +02:00

Note that this can probably also be backported to 3.3 and 3.6?

Note that this can probably also be backported to 3.3 and 3.6?
Author
Member

Note that this can probably also be backported to 3.3 and 3.6?

will add it to #109399 and #100749

> Note that this can probably also be backported to 3.3 and 3.6? will add it to #109399 and #100749
Philipp Oeser merged commit 126fd4a181 into main 2023-07-21 14:41:52 +02:00
Philipp Oeser deleted branch 110341 2023-07-21 14:41:54 +02:00
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
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
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
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
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#110344
No description provided.