From 6dd2e193e16fcae720b40d18e29c9e395b014833 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 5 Oct 2022 15:54:03 +0200 Subject: Fix T101405: Deleting a baked action results in an error. RNA code to create new actions did not properly remove the extra user set by default, as done in other `new` callbacks of other ID types. NOTE: Mask ID had the same issue, also fixed in this commit. NOTE: At some point this needs to be properly fixed, default super-low level ID creation code should simply not add a 'default' user, this is extremely bad design and forces higher-level code to do all kind of extra work to get rid of it half of the time, in very unclear and confusing ways and places. --- source/blender/makesrna/intern/rna_main_api.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 1f21fa3fab9..35678f2f1dd 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -629,6 +629,7 @@ static bAction *rna_Main_actions_new(Main *bmain, const char *name) bAction *act = BKE_action_add(bmain, safe_name); id_fake_user_clear(&act->id); + id_us_min(&act->id); WM_main_add_notifier(NC_ID | NA_ADDED, NULL); @@ -701,6 +702,7 @@ static Mask *rna_Main_mask_new(Main *bmain, const char *name) rna_idname_validate(name, safe_name); Mask *mask = BKE_mask_new(bmain, safe_name); + id_us_min(&mask->id); WM_main_add_notifier(NC_ID | NA_ADDED, NULL); -- cgit v1.2.3