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:
authorSimone Barbieri <s.barbieri>2020-06-12 18:51:58 +0300
committerBastien Montagne <bastien@blender.org>2020-06-12 18:52:14 +0300
commit5dca72dfc924ff931ae46b35a6342beec87f9fc4 (patch)
treedfc123cb949c4cf7d085164daabdf8523d2aa8ca /source/blender/makesrna/intern/rna_main_api.c
parent091d801e9fd294d8305142d860d5d16e5d2be22c (diff)
Add ability to remove Library data-blocks through RNA API.
Just uses same code as for all the other ID types. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D7995
Diffstat (limited to 'source/blender/makesrna/intern/rna_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index c5781175d65..093fd8b3bd5 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -1174,6 +1174,22 @@ void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
+
+ func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
+ RNA_def_function_flag(func, FUNC_USE_REPORTS);
+ RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
+ parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
+ RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
+ RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
+ RNA_def_boolean(
+ func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
+ RNA_def_boolean(func,
+ "do_id_user",
+ true,
+ "",
+ "Decrement user counter of all datablocks used by this object");
+ RNA_def_boolean(
+ func, "do_ui_user", true, "", "Make sure interface does not reference this object");
}
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)