diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-03-07 17:58:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-03-07 17:58:29 +0300 |
commit | 9e2081a5fc078bf8bb040f0befe62156b9592436 (patch) | |
tree | beb3f6e50c696e1d464659afd50adf802110bd11 /source/blender/python/api2_2x/sceneSequence.c | |
parent | c5a15828013f39b476742f3ef1389aba68a3cbd5 (diff) |
made alloc_sequence accept a linkedList so it can be used from Python.
the start/end points for new strips were not set properly.
Diffstat (limited to 'source/blender/python/api2_2x/sceneSequence.c')
-rw-r--r-- | source/blender/python/api2_2x/sceneSequence.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/source/blender/python/api2_2x/sceneSequence.c b/source/blender/python/api2_2x/sceneSequence.c index 7868ba364fc..71d2566aed9 100644 --- a/source/blender/python/api2_2x/sceneSequence.c +++ b/source/blender/python/api2_2x/sceneSequence.c @@ -106,37 +106,24 @@ static PyMethodDef BPy_SceneSeq_methods[] = { {NULL, NULL, 0, NULL} }; - -static Sequence *alloc_sequence_internal(ListBase *lb) -{ - Sequence *seq; - seq= MEM_callocN( sizeof(Sequence), "addseq"); - BLI_addtail(lb, seq); - *( (short *)seq->name )= ID_SEQ; - seq->name[2]= 0; - seq->flag= SELECT; - seq->mul= 1.0; /*start and machine must be set later */ - - return seq; -} - - /* use to add a sequence to a scene or its listbase */ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) { PyObject *py_data = NULL; - Sequence *seq = alloc_sequence_internal(seqbase); + Sequence *seq; int a; Strip *strip; StripElem *se; - + int start, machine; - if( !PyArg_ParseTuple( args, "Oii", &py_data, &seq->start, &seq->machine ) ) + if( !PyArg_ParseTuple( args, "Oii", &py_data, &start, &machine ) ) return EXPP_ReturnPyObjError( PyExc_ValueError, "expects a string for chan/bone name and an int for the frame where to put the new key" ); - if (PyTuple_Check(py_data)) { + seq = alloc_sequence(seqbase, start, machine); /* warning, this sets last */ + + if (PyList_Check(py_data)) { /* Image */ PyObject *list; char *name; @@ -227,6 +214,7 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) seq->type= SEQ_MOVIE; } + intern_pos_update(seq); return Sequence_CreatePyObject(seq, NULL, sce); } |