[Bf-blender-cvs] [44b691d] master: RNA Main API: set remove's do_unlink default value to true.

Bastien Montagne noreply at git.blender.org
Tue Nov 15 17:16:07 CET 2016


Commit: 44b691dc658db9d4ae0993546abe559223146b67
Author: Bastien Montagne
Date:   Tue Nov 15 17:12:18 2016 +0100
Branches: master
https://developer.blender.org/rB44b691dc658db9d4ae0993546abe559223146b67

RNA Main API: set remove's do_unlink default value to true.

On second and third thoughts, this should have been done that way since
the begining, cases were you just delete a few data-blocks without any
serious knowledge of their usages are much, much more frequent than
cases where you are deleting thousands of data-blocks and are sure they
are not used anywhere anymore...

Own fault, but really frustrated that this topic was only raised the day
after 2.78a was released. :(

===================================================================

M	source/blender/makesrna/intern/rna_main_api.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index cc290ea..594c175 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -585,7 +585,7 @@ void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this camera before deleting it "
 	                "(WARNING: will also delete objects instancing that camera data)");
 
@@ -624,7 +624,7 @@ void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this scene before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -665,7 +665,7 @@ void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this object before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -702,7 +702,7 @@ void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this material before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -746,7 +746,7 @@ void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this node tree before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -805,7 +805,7 @@ void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this mesh before deleting it "
 	                "(WARNING: will also delete objects instancing that mesh data)");
 
@@ -845,7 +845,7 @@ void RNA_def_main_lamps(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "lamp", "Lamp", "", "Lamp to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this lamp before deleting it "
 	                "(WARNING: will also delete objects instancing that lamp data)");
 
@@ -963,7 +963,7 @@ void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this image before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1000,7 +1000,7 @@ void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this lattice before deleting it "
 	                "(WARNING: will also delete objects instancing that lattice data)");
 
@@ -1040,7 +1040,7 @@ void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this curve before deleting it "
 	                "(WARNING: will also delete objects instancing that curve data)");
 
@@ -1078,7 +1078,7 @@ void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this metaball before deleting it "
 	                "(WARNING: will also delete objects instancing that metaball data)");
 
@@ -1118,7 +1118,7 @@ void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this font before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1156,7 +1156,7 @@ void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this texture before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1193,7 +1193,7 @@ void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this brush before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1230,7 +1230,7 @@ void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this world before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1267,7 +1267,7 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "group", "Group", "", "Group to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "", "Unlink all usages of this group before deleting it");
+	RNA_def_boolean(func, "do_unlink", true, "", "Unlink all usages of this group before deleting it");
 
 	func = RNA_def_function(srna, "tag", "rna_Main_groups_tag");
 	parm = RNA_def_boolean(func, "value", 0, "Value", "");
@@ -1304,7 +1304,7 @@ void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
 	parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
 	RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR);
 	RNA_def_property_clear_flag(parm, PROP_THICK_WRAP);
-	RNA_def_boolean(func, "do_unlink", false, "",
+	RNA_def_boolean(func, "do_unlink", true, "",
 	                "Unlink all usages of this speaker before deleting it "
 	                "(W

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list