Page MenuHome

Cleanup: skip reading UI datablocks entirely for undo
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Apr 3 2020, 5:17 PM.

Details

Summary

It should not be possible for other types of datablocks to point to UI
datablocks, so there is also no need to store them in fd->libmap. There
can be pointers in the other direction but that should be ok.

Depends on D7328

Diff Detail

Repository
rB Blender

Event Timeline

It should not be possible for other types of datablocks to point to UI datablocks.

I don't think this is true? What about userdata (IDProperties, but also potentially from scripting) ID pointers? those can link any kind of ID afair?

Ah, I forgot about ID properties.

The current situation seems to be that such pointers to UI datablocks will be restored when the experimental undo speedup up is enabled. They are lost in 2.82 (because the UI datablocks pointed to get removed, in fact I think it will crash). They are also lost when the speedup in 2.83 is disabled (since BKE_main_idmap_lookup_uuid is not called and id_old will be NULL).

I could add code to preserve them, but I think they just shouldn't be supported in the first place and I'd rather such pointers just end up NULL here.

So I would still like to keep this patch as is, but maybe with updated comment.

I don't mind much indeed, but then we should explicitly forbid those in IDProp code imho... Or at the very least, update documentation accordingly indeed.

This revision is now accepted and ready to land.Apr 6 2020, 7:01 PM