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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-23 21:14:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-23 21:14:27 +0400
commit74c6c91ba65d40b103234feb2f3ef254b0335193 (patch)
tree1927b26ca8881ee2344d95e475381d89da2b8ac4 /source/blender/makesrna/intern/rna_object.c
parentf850e76e0438c5e0e1ed1b8606fee93ea0775747 (diff)
parenta91bd43d382b857abb4440fe5a2353a4fac0519d (diff)
svn merge ^/trunk/blender -r42080:42095
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index df2b2881c03..2a384329360 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1157,6 +1157,16 @@ static void rna_Object_constraints_remove(Object *object, ReportList *reports, b
WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object);
}
+static void rna_Object_constraints_clear(Object *object)
+{
+ free_constraints(&object->constraints);
+
+ ED_object_constraint_update(object);
+ ED_object_constraint_set_active(object, NULL);
+
+ WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object);
+}
+
static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, const char *name, int type)
{
return ED_object_modifier_add(reports, CTX_data_main(C), CTX_data_scene(C), object, name, type);
@@ -1165,6 +1175,15 @@ static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, Report
static void rna_Object_modifier_remove(Object *object, bContext *C, ReportList *reports, ModifierData *md)
{
ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md);
+
+ WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object);
+}
+
+static void rna_Object_modifier_clear(Object *object, bContext *C)
+{
+ ED_object_modifier_clear(CTX_data_main(C), CTX_data_scene(C), object);
+
+ WM_main_add_notifier(NC_OBJECT|ND_MODIFIER|NA_REMOVED, object);
}
static void rna_Object_boundbox_get(PointerRNA *ptr, float *values)
@@ -1196,6 +1215,13 @@ static void rna_Object_vgroup_remove(Object *ob, bDeformGroup *defgroup)
WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
}
+static void rna_Object_vgroup_clear(Object *ob)
+{
+ ED_vgroup_clear(ob);
+
+ WM_main_add_notifier(NC_OBJECT|ND_DRAW, ob);
+}
+
static void rna_VertexGroup_vertex_add(ID *id, bDeformGroup *def, ReportList *reports, int index_len,
int *index, float weight, int assignmode)
{
@@ -1637,6 +1663,9 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop)
/* constraint to remove */
parm= RNA_def_pointer(func, "constraint", "Constraint", "", "Removed constraint");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ func= RNA_def_function(srna, "clear", "rna_Object_constraints_clear");
+ RNA_def_function_ui_description(func, "Remove all constraint from this object");
}
/* object.modifiers */
@@ -1685,6 +1714,11 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
/* target to remove*/
parm= RNA_def_pointer(func, "modifier", "Modifier", "", "Modifier to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ /* clear all modifiers */
+ func= RNA_def_function(srna, "clear", "rna_Object_modifier_clear");
+ RNA_def_function_flag(func, FUNC_USE_CONTEXT);
+ RNA_def_function_ui_description(func, "Remove all modifiers from the object");
}
/* object.particle_systems */
@@ -1759,6 +1793,9 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_ui_description(func, "Delete vertex group from object");
parm= RNA_def_pointer(func, "group", "VertexGroup", "", "Vertex group to remove");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
+
+ func= RNA_def_function(srna, "clear", "rna_Object_vgroup_clear");
+ RNA_def_function_ui_description(func, "Delete all vertex groups from object");
}