diff --git a/blender/source/blender/python/api2_2x/sceneSequence.c b/blender/source/blender/python/api2_2x/sceneSequence.c index c7daea1..d6b349f 100644 --- a/blender/source/blender/python/api2_2x/sceneSequence.c +++ b/blender/source/blender/python/api2_2x/sceneSequence.c @@ -127,25 +127,22 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) StripElem *se; int start, machine; + /* We're allocating these outside of the image handling stuff + because this way we can also use them for testing to see + whether the data passed in looks like the stuff normally + passed in for an image list */ + PyObject *list; + char *name; + if( !PyArg_ParseTuple( args, "Oii", &py_data, &start, &machine ) ) return EXPP_ReturnPyObjError( PyExc_ValueError, "expect sequence data then 2 ints - (seqdata, start, track)" ); seq = alloc_sequence(seqbase, start, machine); /* warning, this sets last */ - if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 2) { + if ((PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 2) + && PyArg_ParseTuple(py_data, "sO!", &name, &PyList_Type, &list)) { /* Image */ - PyObject *list; - char *name; - - if (!PyArg_ParseTuple( py_data, "sO!", &name, &PyList_Type, &list)) { - BLI_remlink(seqbase, seq); - MEM_freeN(seq); - - return EXPP_ReturnPyObjError( PyExc_ValueError, - "images data needs to be a tuple of a string and a list of images - (path, [filenames...])" ); - } - seq->type= SEQ_IMAGE; seq->len = PyList_Size( list ); @@ -189,20 +186,21 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) strip->us= 1; strip->stripdata= se= MEM_callocN(seq->len*sizeof(StripElem), "stripelem"); - } else if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 4) { + } else if (PyTuple_Check(py_data) && PyTuple_GET_SIZE(py_data) == 2) { // MOVIE or AUDIO_HD - char *filename; - char *dir; char *fullpath; char *type; int totframe; - if (!PyArg_ParseTuple( py_data, "ssss", &filename, &dir, &fullpath, &type )) { + /* clear out the error from testing to see */ + PyErr_Clear(); + + if (!PyArg_ParseTuple(py_data, "ss", &fullpath, &type)) { BLI_remlink(seqbase, seq); MEM_freeN(seq); - return EXPP_ReturnPyObjError( PyExc_ValueError, - "movie/audio hd data needs to be a tuple of a string and a list of images - (filename, dir, fullpath, type)" ); + return EXPP_ReturnPyObjError(PyExc_ValueError, + "movie/audio hd data needs to be a tuple of (fullpath, type)"); } // RFS - Attempting to support Movie and Audio (HD) strips @@ -236,11 +234,7 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); strip->len= totframe; strip->us= 1; - strncpy(strip->dir, dir, FILE_MAXDIR-1); // ???? strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); - - /* name movie in first strip */ - strncpy(se->name, filename, FILE_MAXFILE-1); // ???? } // Audio (HD) strips @@ -273,11 +267,8 @@ static PyObject *NewSeq_internal(ListBase *seqbase, PyObject * args, Scene *sce) seq->strip= strip= MEM_callocN(sizeof(Strip), "strip"); strip->len= totframe; strip->us= 1; - strncpy(strip->dir, dir, FILE_MAXDIR-1); // ???? strip->stripdata= se= MEM_callocN(sizeof(StripElem), "stripelem"); - /* name movie in first strip */ - strncpy(se->name, filename, FILE_MAXFILE-1); // ???? } #endif