Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-10-05 16:54:03 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2022-10-17 16:21:07 +0300
commitcb2fb570f1303e2262de4ce97f50bd87f8ae27b4 (patch)
tree30967b7312f9f609bdd6aef0a482f4aa335af88e
parenta18b8ba1be6b0128548ed3a70075f45b63c0c4d9 (diff)
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.
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c2
1 files changed, 2 insertions, 0 deletions
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);