Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lib_id.c
| Show First 20 Lines • Show All 1,258 Lines • ▼ Show 20 Lines | void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int orig_flag) | ||||
| /* We do not want any handling of usercount in code duplicating the data here, we do that all | /* We do not want any handling of usercount in code duplicating the data here, we do that all | ||||
| * at once in id_copy_libmanagement_cb() at the end. */ | * at once in id_copy_libmanagement_cb() at the end. */ | ||||
| const int copy_data_flag = orig_flag | LIB_ID_CREATE_NO_USER_REFCOUNT; | const int copy_data_flag = orig_flag | LIB_ID_CREATE_NO_USER_REFCOUNT; | ||||
| if (id->properties) { | if (id->properties) { | ||||
| new_id->properties = IDP_CopyProperty_ex(id->properties, copy_data_flag); | new_id->properties = IDP_CopyProperty_ex(id->properties, copy_data_flag); | ||||
| } | } | ||||
| /* We may need our own flag to control that at some point, but for now 'no main' one should be | if ((orig_flag & LIB_ID_COPY_NO_LIB_OVERRIDE) == 0) { | ||||
| * good enough. */ | |||||
| if ((orig_flag & LIB_ID_CREATE_NO_MAIN) == 0) { | |||||
| if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) { | if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) { | ||||
| /* We do not want to copy existing override rules here, as they would break the proper | /* We do not want to copy existing override rules here, as they would break the proper | ||||
| * remapping between IDs. Proper overrides rules will be re-generated anyway. */ | * remapping between IDs. Proper overrides rules will be re-generated anyway. */ | ||||
| BKE_lib_override_library_copy(new_id, id, false); | BKE_lib_override_library_copy(new_id, id, false); | ||||
| } | } | ||||
| else if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id)) { | else if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id)) { | ||||
| /* Just ensure virtual overrides do get properly tagged, there is not actual override data to | /* Just ensure virtual overrides do get properly tagged, there is not actual override data to | ||||
| * copy here. */ | * copy here. */ | ||||
| ▲ Show 20 Lines • Show All 1,138 Lines • Show Last 20 Lines | |||||