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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-01-03 03:10:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-03 03:10:14 +0400
commit1a7638fa94fbe9c6244d054d20efa3405153747f (patch)
tree21a57b893f653ffdae29b9e4f4a4add9b90f8395 /source
parenta4a3ed00186e0e73e20d1c85e90ea639e36653d1 (diff)
add id property clear function (matching the same python function for dicts/lists)
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_idprop.h2
-rw-r--r--source/blender/blenkernel/intern/idprop.c7
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/python/generic/idprop_py_api.c7
4 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index a9f6a61a655..ad3e4bb2251 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -315,6 +315,8 @@ __attribute__((nonnull))
* the actual struct IDProperty struct either.*/
void IDP_FreeProperty(struct IDProperty *prop);
+void IDP_ClearProperty(IDProperty *prop);
+
/** Unlinks any struct IDProperty<->ID linkage that might be going on.*/
void IDP_UnlinkProperty(struct IDProperty *prop);
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 5dd0f08dc71..3be47668fb5 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -815,6 +815,13 @@ void IDP_FreeProperty(IDProperty *prop)
}
}
+void IDP_ClearProperty(IDProperty *prop)
+{
+ IDP_FreeProperty(prop);
+ prop->data.pointer = NULL;
+ prop->len = prop->totallen = 0;
+}
+
/* Unlinks any IDProperty<->ID linkage that might be going on.
* note: currently unused.*/
void IDP_UnlinkProperty(IDProperty *prop)
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 409f655bb79..892f0a3f489 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -925,7 +925,7 @@ static void set_filter_seq(Scene *scene)
if (seq->type == SEQ_TYPE_MOVIE) {
seq->flag |= SEQ_FILTERY;
reload_sequence_new_file(scene, seq, FALSE);
- calc_sequence(scene, seq);
+ BKE_sequence_calc(scene, seq);
}
}
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 53112d46098..10ca7a943cb 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -836,6 +836,11 @@ static PyObject *BPy_IDGroup_to_dict(BPy_IDProperty *self)
return BPy_IDGroup_MapDataToPy(self->prop);
}
+static PyObject *BPy_IDGroup_clear(BPy_IDProperty *self)
+{
+ IDP_ClearProperty(self->prop);
+ Py_RETURN_NONE;
+}
/* Matches python dict.get(key, [default]) */
static PyObject *BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
@@ -875,6 +880,8 @@ static struct PyMethodDef BPy_IDGroup_methods[] = {
"idprop.get(k[,d]) -> idprop[k] if k in idprop, else d. d defaults to None"},
{"to_dict", (PyCFunction)BPy_IDGroup_to_dict, METH_NOARGS,
"return a purely python version of the group"},
+ {"clear", (PyCFunction)BPy_IDGroup_clear, METH_NOARGS,
+ "clear all members from this group"},
{NULL, NULL, 0, NULL}
};