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 2,839 Lines • ▼ Show 20 Lines | else { | ||||
| /* Evaluations for the current state that have not been performed yet | /* Evaluations for the current state that have not been performed yet | ||||
| * by the time we are performing this undo step. */ | * by the time we are performing this undo step. */ | ||||
| recalc |= id_current->recalc; | recalc |= id_current->recalc; | ||||
| /* Tags that were set between the target state and the current state, | /* Tags that were set between the target state and the current state, | ||||
| * that we need to perform again. */ | * that we need to perform again. */ | ||||
| if (fd->undo_direction < 0) { | if (fd->undo_direction < 0) { | ||||
| /* Undo: tags from target to the current state. */ | /* Undo: tags from target to the current state. */ | ||||
| recalc |= id_current->recalc_undo_accumulated; | recalc |= id_current->recalc_up_to_undo_push; | ||||
| } | } | ||||
| else { | else { | ||||
| /* Redo: tags from current to the target state. */ | /* Redo: tags from current to the target state. */ | ||||
| recalc |= id_target->recalc_undo_accumulated; | recalc |= id_target->recalc_up_to_undo_push; | ||||
| } | } | ||||
| } | } | ||||
| return recalc; | return recalc; | ||||
| } | } | ||||
| static void direct_link_id_common(FileData *fd, ID *id, ID *id_old, const int tag) | static void direct_link_id_common(FileData *fd, ID *id, ID *id_old, const int tag) | ||||
| { | { | ||||
| Show All 14 Lines | static void direct_link_id_common(FileData *fd, ID *id, ID *id_old, const int tag) | ||||
| * that animation is to be evaluated on undo/redo. If this is not enforced by the recalc | * 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., | * 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. | * which conflicts with undo/redo of changes to animation data itself. | ||||
| * | * | ||||
| * But for regular file load we clear the flag, since the flags might have been changed since | * But for regular file load we clear the flag, since the flags might have been changed since | ||||
| * the version the file has been saved with. */ | * the version the file has been saved with. */ | ||||
| if (fd->memfile == NULL) { | if (fd->memfile == NULL) { | ||||
| id->recalc = 0; | id->recalc = 0; | ||||
| id->recalc_undo_accumulated = 0; | id->recalc_after_undo_push = 0; | ||||
| } | } | ||||
| else if ((fd->skip_flags & BLO_READ_SKIP_UNDO_OLD_MAIN) == 0) { | else if ((fd->skip_flags & BLO_READ_SKIP_UNDO_OLD_MAIN) == 0) { | ||||
| id->recalc = direct_link_id_restore_recalc(fd, id, id_old, false); | id->recalc = direct_link_id_restore_recalc(fd, id, id_old, false); | ||||
| id->recalc_undo_accumulated = 0; | id->recalc_after_undo_push = 0; | ||||
| } | } | ||||
| /* Link direct data of overrides. */ | /* Link direct data of overrides. */ | ||||
| if (id->override_library) { | if (id->override_library) { | ||||
| id->override_library = newdataadr(fd, id->override_library); | id->override_library = newdataadr(fd, id->override_library); | ||||
| link_list_ex(fd, &id->override_library->properties, direct_link_id_override_property_cb); | link_list_ex(fd, &id->override_library->properties, direct_link_id_override_property_cb); | ||||
| id->override_library->runtime = NULL; | id->override_library->runtime = NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 6,654 Lines • ▼ Show 20 Lines | static void read_libblock_undo_restore_identical( | ||||
| Main *old_bmain = fd->old_mainlist->first; | Main *old_bmain = fd->old_mainlist->first; | ||||
| ListBase *old_lb = which_libbase(old_bmain, idcode); | ListBase *old_lb = which_libbase(old_bmain, idcode); | ||||
| ListBase *new_lb = which_libbase(main, idcode); | ListBase *new_lb = which_libbase(main, idcode); | ||||
| BLI_remlink(old_lb, id_old); | BLI_remlink(old_lb, id_old); | ||||
| BLI_addtail(new_lb, id_old); | BLI_addtail(new_lb, id_old); | ||||
| /* Recalc flags, mostly these just remain as they are. */ | /* Recalc flags, mostly these just remain as they are. */ | ||||
| id_old->recalc |= direct_link_id_restore_recalc_exceptions(id_old); | id_old->recalc |= direct_link_id_restore_recalc_exceptions(id_old); | ||||
| id_old->recalc_undo_accumulated = 0; | id_old->recalc_after_undo_push = 0; | ||||
| /* As usual, proxies require some special love... | /* As usual, proxies require some special love... | ||||
| * In `blo_clear_proxy_pointers_from_lib()` we clear all `proxy_from` pointers to local IDs, for | * In `blo_clear_proxy_pointers_from_lib()` we clear all `proxy_from` pointers to local IDs, for | ||||
| * undo. This is required since we do not re-read linked data in that case, so we also do not | * undo. This is required since we do not re-read linked data in that case, so we also do not | ||||
| * re-'lib_link' their pointers. | * re-'lib_link' their pointers. | ||||
| * Those `proxy_from` pointers are then re-defined properly when lib_linking the newly read local | * Those `proxy_from` pointers are then re-defined properly when lib_linking the newly read local | ||||
| * object. However, in case of re-used data 'as-is', we never lib_link it again, so we have to | * object. However, in case of re-used data 'as-is', we never lib_link it again, so we have to | ||||
| * fix those backward pointers here. */ | * fix those backward pointers here. */ | ||||
| ▲ Show 20 Lines • Show All 2,952 Lines • Show Last 20 Lines | |||||