diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-06 03:52:30 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-06 03:52:30 +0300 |
commit | 60063d538389d4ad2e4a268da2ba058baf768807 (patch) | |
tree | 78c1ec1098f701a8e61cf55bc4f145a680b72a3a /source/blender/python | |
parent | 2f366d1544ecc5618d7190b779ccc75f2f144d0a (diff) |
- converted path cleaning on file load to use bPath Iterator functions - image & font and sequence paths were being cleaned but not multires, voxel & sound paths.
- skip fixing file paths on undo.
- simplify bpath alloc and free functions, also pass Main structure so as not to rely on G.main, (needed for file load).
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 2c4ccaa1509..770640f577d 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -37,6 +37,7 @@ #include "BLI_bpath.h" #include "BKE_utildefines.h" +#include "BKE_global.h" /* XXX, G.main only */ #include "MEM_guardedalloc.h" @@ -92,11 +93,9 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec if (!PyArg_ParseTupleAndKeywords(args, kw, "|i:blend_paths", (char **)kwlist, &absolute)) return NULL; - BLI_bpathIterator_alloc(&bpi); - list= PyList_New(0); - for(BLI_bpathIterator_init(bpi, NULL); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) { + for(BLI_bpathIterator_init(&bpi, G.main, NULL); !BLI_bpathIterator_isDone(bpi); BLI_bpathIterator_step(bpi)) { /* build the list */ if (absolute) { BLI_bpathIterator_getPathExpanded(bpi, filepath_expanded); @@ -117,7 +116,6 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec } BLI_bpathIterator_free(bpi); - MEM_freeN((void *)bpi); return list; } |