Cleanup: rename BKE_main_id_{clear_newpoins => newptr_and_tag_clear}
It wasn't obvious this function cleared the tag as well.
This commit is contained in:
parent
9200e73136
commit
5721c89ba8
|
@ -273,7 +273,7 @@ void BKE_main_id_tag_all(struct Main *mainvar, const int tag, const bool value);
|
|||
void BKE_main_id_flag_listbase(struct ListBase *lb, const int flag, const bool value);
|
||||
void BKE_main_id_flag_all(struct Main *bmain, const int flag, const bool value);
|
||||
|
||||
void BKE_main_id_clear_newpoins(struct Main *bmain);
|
||||
void BKE_main_id_newptr_and_tag_clear(struct Main *bmain);
|
||||
|
||||
void BKE_main_id_refcount_recompute(struct Main *bmain, const bool do_linked_only);
|
||||
|
||||
|
|
|
@ -694,7 +694,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
|
|||
const bool is_subprocess = (duplicate_options & LIB_ID_DUPLICATE_IS_SUBPROCESS) != 0;
|
||||
|
||||
if (!is_subprocess) {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
/* In case root duplicated ID is linked, assume we want to get a local copy of it and duplicate
|
||||
* all expected linked data. */
|
||||
if (ID_IS_LINKED(collection)) {
|
||||
|
@ -725,7 +725,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
|
|||
#endif
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
BKE_main_collection_sync(bmain);
|
||||
}
|
||||
|
|
|
@ -1754,7 +1754,7 @@ bool BKE_id_new_name_validate(ListBase *lb, ID *id, const char *tname)
|
|||
}
|
||||
|
||||
/* next to indirect usage in read/writefile also in editobject.c scene.c */
|
||||
void BKE_main_id_clear_newpoins(Main *bmain)
|
||||
void BKE_main_id_newptr_and_tag_clear(Main *bmain)
|
||||
{
|
||||
ID *id;
|
||||
|
||||
|
@ -2168,7 +2168,7 @@ void BKE_library_make_local(Main *bmain,
|
|||
TIMEIT_VALUE_PRINT(make_local);
|
||||
#endif
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
BLI_memarena_free(linklist_mem);
|
||||
|
||||
#ifdef DEBUG_TIME
|
||||
|
|
|
@ -845,7 +845,7 @@ bool BKE_lib_override_library_create(
|
|||
bmain, scene, view_layer, id_root, id_reference, NULL, false);
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
|
||||
|
||||
/* We need to rebuild some of the deleted override rules (for UI feedback purpose). */
|
||||
|
@ -1271,7 +1271,7 @@ bool BKE_lib_override_library_resync(Main *bmain,
|
|||
}
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); /* That one should not be needed in fact. */
|
||||
|
||||
return success;
|
||||
|
|
|
@ -2622,8 +2622,8 @@ void BKE_object_transform_copy(Object *ob_tar, const Object *ob_src)
|
|||
*
|
||||
* \note This function does not do any remapping to new IDs, caller must do it
|
||||
* (\a #BKE_libblock_relink_to_newid()).
|
||||
* \note Caller MUST free \a newid pointers itself (#BKE_main_id_clear_newpoins()) and call updates
|
||||
* of DEG too (#DAG_relations_tag_update()).
|
||||
* \note Caller MUST free \a newid pointers itself (#BKE_main_id_newptr_and_tag_clear()) and call
|
||||
* updates of DEG too (#DAG_relations_tag_update()).
|
||||
*/
|
||||
Object *BKE_object_duplicate(Main *bmain,
|
||||
Object *ob,
|
||||
|
@ -2633,7 +2633,7 @@ Object *BKE_object_duplicate(Main *bmain,
|
|||
const bool is_subprocess = (duplicate_options & LIB_ID_DUPLICATE_IS_SUBPROCESS) != 0;
|
||||
|
||||
if (!is_subprocess) {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
/* In case root duplicated ID is linked, assume we want to get a local copy of it and duplicate
|
||||
* all expected linked data. */
|
||||
if (ID_IS_LINKED(ob)) {
|
||||
|
@ -2772,7 +2772,7 @@ Object *BKE_object_duplicate(Main *bmain,
|
|||
#endif
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
}
|
||||
|
||||
if (obn->type == OB_ARMATURE) {
|
||||
|
|
|
@ -1985,7 +1985,7 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
|
|||
const bool is_subprocess = false;
|
||||
|
||||
if (!is_subprocess) {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
/* In case root duplicated ID is linked, assume we want to get a local copy of it and
|
||||
* duplicate all expected linked data. */
|
||||
if (ID_IS_LINKED(sce)) {
|
||||
|
@ -2026,7 +2026,7 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
|
|||
#endif
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
BKE_main_collection_sync(bmain);
|
||||
}
|
||||
|
|
|
@ -653,7 +653,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
|
|||
/* Only remap that specific ID usage to overriding local data-block. */
|
||||
ID *override_id = BKE_lib_override_library_create_from_id(bmain, id, false);
|
||||
if (override_id != NULL) {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
if (GS(override_id->name) == ID_OB) {
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
@ -672,7 +672,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
|
|||
}
|
||||
else {
|
||||
if (BKE_lib_id_make_local(bmain, id, false, 0)) {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
/* reassign to get get proper updates/notifiers */
|
||||
idptr = RNA_property_pointer_get(&template_ui->ptr, template_ui->prop);
|
||||
|
|
|
@ -2148,7 +2148,7 @@ static void copy_object_set_idnew(bContext *C)
|
|||
FOREACH_MAIN_ID_END;
|
||||
#endif
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@ -2469,7 +2469,7 @@ static void make_object_duplilist_real(bContext *C,
|
|||
|
||||
free_object_duplilist(lb_duplis);
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
base->object->transflag &= ~OB_DUPLI;
|
||||
DEG_id_tag_update(&base->object->id, ID_RECALC_COPY_ON_WRITE);
|
||||
|
@ -2484,7 +2484,7 @@ static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
|
|||
const bool use_base_parent = RNA_boolean_get(op->ptr, "use_base_parent");
|
||||
const bool use_hierarchy = RNA_boolean_get(op->ptr, "use_hierarchy");
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
|
||||
make_object_duplilist_real(C, depsgraph, scene, base, use_base_parent, use_hierarchy);
|
||||
|
@ -3369,7 +3369,7 @@ Base *ED_object_add_duplicate(
|
|||
DEG_id_tag_update_ex(bmain, (ID *)ob->data, ID_RECALC_EDITORS);
|
||||
}
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
return basen;
|
||||
}
|
||||
|
@ -3385,7 +3385,7 @@ static int duplicate_exec(bContext *C, wmOperator *op)
|
|||
|
||||
/* We need to handle that here ourselves, because we may duplicate several objects, in which case
|
||||
* we also want to remap pointers between those... */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
|
||||
Base *basen = object_add_duplicate_internal(
|
||||
|
|
|
@ -1944,7 +1944,7 @@ void ED_object_single_user(Main *bmain, Scene *scene, Object *ob)
|
|||
ob->flag |= OB_DONE;
|
||||
|
||||
single_object_users(bmain, scene, NULL, OB_DONE, false);
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
}
|
||||
|
||||
static void single_obdata_users(
|
||||
|
@ -2644,7 +2644,7 @@ static int make_single_user_exec(bContext *C, wmOperator *op)
|
|||
single_object_action_users(bmain, scene, view_layer, v3d, flag);
|
||||
}
|
||||
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
|
||||
WM_event_add_notifier(C, NC_WINDOW, NULL);
|
||||
|
||||
|
|
|
@ -740,7 +740,7 @@ static void id_local_fn(bContext *C,
|
|||
BKE_lib_id_clear_library_data(bmain, tselem->id);
|
||||
}
|
||||
else {
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
}
|
||||
}
|
||||
else if (ID_IS_OVERRIDE_LIBRARY_REAL(tselem->id)) {
|
||||
|
@ -852,7 +852,7 @@ static void id_override_library_create_fn(bContext *C,
|
|||
success = BKE_lib_override_library_create_from_id(bmain, id_root, true) != NULL;
|
||||
|
||||
/* Cleanup. */
|
||||
BKE_main_id_clear_newpoins(bmain);
|
||||
BKE_main_id_newptr_and_tag_clear(bmain);
|
||||
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -1925,5 +1925,5 @@ void outliner_build_tree(Main *mainvar,
|
|||
outliner_filter_tree(space_outliner, view_layer);
|
||||
outliner_restore_scrolling_position(space_outliner, region, &focus);
|
||||
|
||||
BKE_main_id_clear_newpoins(mainvar);
|
||||
BKE_main_id_newptr_and_tag_clear(mainvar);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue