Make Local on linked mesh object: object gets removed if redo function is used #34446

Closed
opened 2013-02-26 17:04:55 +01:00 by CodeManX · 17 comments
Member

%%%--- Blender version with error, and version that worked ---
2.66-official

- Short description of error ---

If one changes the type for Make Local operator in Redo panel, object disappears (from scene as well as from bpy.data.objects)

- Steps for others to reproduce the error (preferably based on attached .blend file) ---
  1. Save default scene (cube) to .blend for linking that cube later
  2. Open new scene
  3. File > Link
  4. Add the cube from .blend (step 1)
  5. Click menu Object > Make Local > Selected objects (for instance, any type will work)
  6. Change type of the operation in Redo panel to something else
  7. Cube vanishes

Redo should either be disabled for this op, or made working.%%%

%%%--- Blender version with error, and version that worked --- 2.66-official - Short description of error --- If one changes the type for Make Local operator in Redo panel, object disappears (from scene as well as from bpy.data.objects) - Steps for others to reproduce the error (preferably based on attached .blend file) --- 1) Save default scene (cube) to .blend for linking that cube later 2) Open new scene 3) File > Link 4) Add the cube from .blend (step 1) 5) Click menu Object > Make Local > Selected objects (for instance, any type will work) 6) Change type of the operation in Redo panel to something else 7) Cube vanishes Redo should either be disabled for this op, or made working.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

#44858 was marked as duplicate of this issue

#44858 was marked as duplicate of this issue

#40428 was marked as duplicate of this issue

#40428 was marked as duplicate of this issue
Member

%%%Will investigate it.%%%

%%%Will investigate it.%%%
Author
Member

%%%I later notices these messages in system console (no report popup showed however):

Object Cube.001 lost data.
Warning: Warning in console
Warning: LIB ERROR: object lost from scene: 'Scene'%%%

%%%I later notices these messages in system console (no report popup showed however): Object Cube.001 lost data. Warning: Warning in console Warning: LIB ERROR: object lost from scene: 'Scene'%%%

Added subscriber: @mutantbob

Added subscriber: @mutantbob

◀ Merged tasks: #40428.

◀ Merged tasks: #40428.
Ton Roosendaal was unassigned by Julian Eisel 2014-12-26 17:09:43 +01:00
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel

Added subscriber: @bliblubli

Added subscriber: @bliblubli
Bastien Montagne was assigned by Julian Eisel 2015-07-30 12:01:49 +02:00
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

Old bug and nobody assigned to it :/ Maybe @mont29 can give it a go?

Old bug and nobody assigned to it :/ Maybe @mont29 can give it a go?

Added subscribers: @carlosdp, @MarioSottile

Added subscribers: @carlosdp, @MarioSottile

Added subscribers: @Sergey, @ideasman42

Added subscribers: @Sergey, @ideasman42

pfffff… this is a very nice can of worms. :(

So, as found by @carlosdp in D1376, the issue is that we do not re-read lib data blocks and ID placholders (ID_ID bheads) in undo context (in blo_read_file_internal), because BLO_read_from_memfile copies lib datablocks and Main data directly from oldmain. The idea being, linked data do not change from undo/redo.

This is valid as long as linked data was not changed by the undo step - but if some was deleted, it will be missing from oldmain, leading to data loss (note that does not only concerns objects, all linkable data types can be affected).

Now, we do can address that issue, by carefully mixing reuse of needed data from oldmain, and "normal" re-reading of missing one, see D1485. We already swim in some rather dark waters here imho, this gives a rather non-easy-to-follow code, but it seems to work quite well from some quick tests.

Nasty thing now: this leads us to another issue - re-reading some data from libraries means its address won't be the same as previously. Henceforth, any further redo will lose the data again, because it will try to find it (in fd->libmap) based on its old address.

I guess we could store someway in new ID that old address, but have the feeling that would be swimming in pitch black waters. So I’d end up voting for @carlosdp solution - revert that “smart” trick in undos - that, or accept the bug. Unless someone has a better idea? @ideasman42, @Sergey?

pfffff… this is a very nice can of worms. :( So, as found by @carlosdp in [D1376](https://archive.blender.org/developer/D1376), the issue is that we do not re-read lib data blocks and ID placholders (ID_ID bheads) in undo context (in `blo_read_file_internal`), because `BLO_read_from_memfile` copies lib datablocks and Main data directly from oldmain. The idea being, linked data do not change from undo/redo. This is valid as long as linked data was not changed by the undo step - but if some was deleted, it will be missing from oldmain, leading to data loss (note that does not only concerns objects, all linkable data types can be affected). Now, we do can address that issue, by carefully mixing reuse of needed data from oldmain, and "normal" re-reading of missing one, see [D1485](https://archive.blender.org/developer/D1485). We already swim in some rather dark waters here imho, this gives a rather non-easy-to-follow code, but it seems to work quite well from some quick tests. Nasty thing now: this leads us to another issue - re-reading some data from libraries means its address won't be the same as previously. Henceforth, any further redo will lose the data again, because it will try to find it (in fd->libmap) based on its old address. I guess we could store someway in new ID that old address, but have the feeling that would be swimming in pitch black waters. So I’d end up voting for @carlosdp solution - revert that “smart” trick in undos - that, or accept the bug. Unless someone has a better idea? @ideasman42, @Sergey?

Hehe, actually, some pause was useful here - fixing the last point was simply a matter of adding old->new ID address to fd->libmap…

So, patch in D1485 seems to work OK - from quick tests. Would be nice if some user with complex lib-using file could stress-test it a bit…

Hehe, actually, some pause was useful here - fixing the last point was simply a matter of adding old->new ID address to fd->libmap… So, patch in [D1485](https://archive.blender.org/developer/D1485) seems to work OK - **from quick tests**. Would be nice if some user with complex lib-using file could stress-test it a bit…

This issue was referenced by 07332dd2bb

This issue was referenced by 07332dd2bbe62506bef89ffad22ad01766922c8e

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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 project
No Assignees
7 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#34446
No description provided.