Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/readfile.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 9,131 Lines • ▼ Show 20 Lines | if (!id) { | ||||
| return blo_bhead_next(fd, bhead); | return blo_bhead_next(fd, bhead); | ||||
| } | } | ||||
| id->lib = main->curlib; | id->lib = main->curlib; | ||||
| id->us = ID_FAKE_USERS(id); | id->us = ID_FAKE_USERS(id); | ||||
| id->icon_id = 0; | id->icon_id = 0; | ||||
| id->newid = NULL; /* Needed because .blend may have been saved with crap value here... */ | id->newid = NULL; /* Needed because .blend may have been saved with crap value here... */ | ||||
| id->orig_id = NULL; | id->orig_id = NULL; | ||||
| /* NOTE: It is important to not clear the recalc flags for undo/redo. | |||||
| * Preserving recalc flags on redo/undo is the only way to make dependency graph detect | |||||
| * that animation is to be evaluated on undo/redo. If this is not enforced by the recalc | |||||
| * flags dependency graph does not do animation update to avoid loss of unkeyed changes., | |||||
| * which conflicts with undo/redo of changes to animation data itself. | |||||
brecht: Only do this for undo/redo then, and not general file reading.
Recalc flags are not compatible… | |||||
Not Done Inline Actionsif (fd->memfile) { .. } tests for the undo case. brecht: `if (fd->memfile) { .. }` tests for the undo case. | |||||
| * | |||||
| * But for regular file load we clear the flag, since the flags might have been changed sinde | |||||
| * the version the file has been saved with. */ | |||||
| if (!fd->memfile) { | |||||
| id->recalc = 0; | id->recalc = 0; | ||||
| } | |||||
| /* this case cannot be direct_linked: it's just the ID part */ | /* this case cannot be direct_linked: it's just the ID part */ | ||||
| if (bhead->code == ID_LINK_PLACEHOLDER) { | if (bhead->code == ID_LINK_PLACEHOLDER) { | ||||
| /* That way, we know which data-lock needs do_versions (required currently for linking). */ | /* That way, we know which data-lock needs do_versions (required currently for linking). */ | ||||
| id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW; | id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW; | ||||
| return blo_bhead_next(fd, bhead); | return blo_bhead_next(fd, bhead); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,730 Lines • Show Last 20 Lines | |||||
Only do this for undo/redo then, and not general file reading.
Recalc flags are not compatible across versions, and for properly understanding refresh issues and debugging them it seems best not to have leftovers from a previous Blender session.