Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lib_id.c
| Show First 20 Lines • Show All 1,116 Lines • ▼ Show 20 Lines | if (id) { | ||||
| id->icon_id = 0; | id->icon_id = 0; | ||||
| *((short *)id->name) = type; | *((short *)id->name) = type; | ||||
| if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) { | if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) { | ||||
| id->us = 1; | id->us = 1; | ||||
| } | } | ||||
| if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { | if ((flag & LIB_ID_CREATE_NO_MAIN) == 0) { | ||||
| /* Note that 2.8x versioning has tested not to cause conflicts. */ | /* Note that 2.8x versioning has tested not to cause conflicts. */ | ||||
| BLI_assert(bmain->is_locked_for_linking == false || ELEM(type, ID_WS, ID_GR)); | BLI_assert(bmain->is_locked_for_linking == false || ELEM(type, ID_WS, ID_GR, ID_NT)); | ||||
| ListBase *lb = which_libbase(bmain, type); | ListBase *lb = which_libbase(bmain, type); | ||||
JacquesLucke: I wonder if `is_locked_for_linking` should already be false when calling… | |||||
Done Inline ActionsThe reasoning makes sense, but the file reading code is not that logical-- it's still set to true in do_versions_after_linking. HooglyBoogly: The reasoning makes sense, but the file reading code is not that logical-- it's still set to… | |||||
Not Done Inline ActionsI think this is wrongly handled currently, this exception makes no sense to me. Created a design task for it (T92333: BMain locking during the 'after liblink' doversion). But for the time being think you will need that hack yes, fixing this is outside the scope of that patch. mont29: I think this is wrongly handled currently, this exception makes no sense to me. Created a… | |||||
| BKE_main_lock(bmain); | BKE_main_lock(bmain); | ||||
| BLI_addtail(lb, id); | BLI_addtail(lb, id); | ||||
| BKE_id_new_name_validate(lb, id, name, false); | BKE_id_new_name_validate(lb, id, name, false); | ||||
| bmain->is_memfile_undo_written = false; | bmain->is_memfile_undo_written = false; | ||||
| /* alphabetic insertion: is in new_id */ | /* alphabetic insertion: is in new_id */ | ||||
| BKE_main_unlock(bmain); | BKE_main_unlock(bmain); | ||||
| /* TODO: to be removed from here! */ | /* TODO: to be removed from here! */ | ||||
| ▲ Show 20 Lines • Show All 1,341 Lines • Show Last 20 Lines | |||||
I wonder if is_locked_for_linking should already be false when calling do_versions_after_linking_300. The after linking suggests that linking is already done at this point. Not sure what kinds of errors one can run into when creating data blocks in versioning code. (I can see that removing them can be an issue though)