diff options
author | Joilnen Leite <joilnen.leite@gmail.com> | 2005-10-25 22:12:27 +0400 |
---|---|---|
committer | Joilnen Leite <joilnen.leite@gmail.com> | 2005-10-25 22:12:27 +0400 |
commit | 557f951ebc5e4fbc190c6b4682b871ab51636b15 (patch) | |
tree | 9b497c2d570aaa73367f7642963c6b8d4747c072 /source/blender/python/api2_2x/sceneTimeLine.c | |
parent | 2efaa059b5be0a53a6c94398083e2d3fa7f884ab (diff) |
getMarked return change to dict
.
Diffstat (limited to 'source/blender/python/api2_2x/sceneTimeLine.c')
-rw-r--r-- | source/blender/python/api2_2x/sceneTimeLine.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/python/api2_2x/sceneTimeLine.c b/source/blender/python/api2_2x/sceneTimeLine.c index d4b1710251a..f1480347e73 100644 --- a/source/blender/python/api2_2x/sceneTimeLine.c +++ b/source/blender/python/api2_2x/sceneTimeLine.c @@ -166,7 +166,7 @@ PyObject *M_TimeLine_Get (PyObject *self, PyObject *args) { static PyObject *TimeLine_getFramesMarked (BPy_TimeLine *self, PyObject *args) { - PyObject *marker_list= PyList_New (0); + PyObject *marker_list= PyDict_New (); TimeMarker *marker_it= NULL; PyObject *tmarker= NULL; @@ -175,23 +175,21 @@ static PyObject *TimeLine_getFramesMarked (BPy_TimeLine *self, PyObject *args) { "expected nothing, or or two ints as arguments."); if (tmarker) { int f; - char *s= NULL; + char s[64]; f = PyInt_AsLong (tmarker); if (PyInt_Check (tmarker) && f != 0) { for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) - if (marker_it->frame==f) PyList_Append (marker_list, PyString_FromString (marker_it->name)); + if (marker_it->frame==f) PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name)); } - else if (PyString_Check (tmarker) && (strcpy (s, PyString_AsString (tmarker))) ) { + else if (PyString_Check (tmarker) && (BLI_strncpy(s, PyString_AsString (tmarker), 64)) ) { for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) - if (!strcmp (marker_it->name, s)) PyList_Append (marker_list, PyInt_FromLong ((long int)marker_it->frame)); + if (!strcmp (marker_it->name, s)) PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name)); } } else - for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) { - PyList_Append (marker_list, PyInt_FromLong ((long int)marker_it->frame)); - PyList_Append (marker_list, PyString_FromString (marker_it->name)); - } + for (marker_it= self->marker_list->first; marker_it; marker_it= marker_it->next) + PyDict_SetItem (marker_list, PyInt_FromLong ((long int)marker_it->frame), PyString_FromString (marker_it->name)); return marker_list; } |