Cleanup & rework of BLO_linking code.

This commits does mostly two things:
* Get rid of bContext parameter: I can see no real good reason to pass such a high-level data
  to such low-level code... It also makes it more difficult to call when you do not have
  a context available.
* Cleanup the instantiating part.

Last point is the most risky - previous code was sometimes quite confusing and hard to follow,
from tests nothing behaves differently in new code, but some hidden corner case may show up.

Anyway, no change in behavior is expected from this commit, if it happens please file a bugreport!
This commit is contained in:
2015-10-12 15:07:07 +02:00
parent d24bafa0d5
commit 2e8fcac15d
6 changed files with 104 additions and 129 deletions

View File

@@ -405,7 +405,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args))
}
else {
Library *lib = mainl->curlib; /* newly added lib, assign before append end */
BLO_library_link_end(NULL, mainl, &(self->blo_handle), 0, self->flag);
BLO_library_link_end(mainl, &(self->blo_handle), self->flag, NULL, NULL);
BLO_blendhandle_close(self->blo_handle);
self->blo_handle = NULL;