diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-12-12 17:20:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-12-12 17:20:12 +0300 |
commit | bf5cc424a8a227e264e4086696c38bceaa22a8ac (patch) | |
tree | 94911ac6492e115315d2e2dffecb927c9a3c5a1a /source/blender/python/api2_2x | |
parent | 29054847a757c79381f7ac4243cf94d5131a2cb7 (diff) |
Patch from ILdar AKHmetgaleev (akhil) - [#7864] correct scale in sequencer's glow
Added py-api write access to sequencer images.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r-- | source/blender/python/api2_2x/sceneSequence.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index 1d5e3058928..5db09b11aee 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -531,7 +531,44 @@ static PyObject *Sequence_getImages( BPy_Sequence * self ) return ret; } - +static int Sequence_setImages( BPy_Sequence * self, PyObject *value ) +{ + Strip *strip; + StripElem *se; + int i; + PyObject *list, *item; + char *basepath, *name; + + if (self->seq->type != SEQ_IMAGE) { + return EXPP_ReturnIntError( PyExc_TypeError, + "Sequence is not an image type" ); + } + + if( !PyArg_ParseTuple + ( value, "sO!", &basepath, &PyList_Type, &list ) ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected string and optional list argument" ); + + strip = self->seq->strip; + se = strip->stripdata; + + /* for now dont support different image list sizes */ + if (PyList_Size(list) != strip->len) { + return EXPP_ReturnIntError( PyExc_TypeError, + "at the moment only image lista with the same number of images as the strip are supported" ); + } + + strncpy(strip->dir, basepath, sizeof(strip->dir)); + + for (i=0; i<strip->len; i++, se++) { + name = PyString_AsString(PyList_GetItem(list, i)); + if (name) { + strncpy(se->name, name, sizeof(se->name)); + } + } + + return 0; +} /* * get floating point attributes @@ -724,7 +761,7 @@ static PyGetSetDef BPy_Sequence_getseters[] = { "Sequence name", NULL}, {"images", - (getter)Sequence_getImages, (setter)NULL, + (getter)Sequence_getImages, (setter)Sequence_setImages, "Sequence scene", NULL}, |