Merging trunk up to r39145.
This commit is contained in:
@@ -950,7 +950,6 @@ bool KX_BlenderSceneConverter::LinkBlendFilePath(const char *path, char *group,
|
||||
|
||||
bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
|
||||
{
|
||||
bContext *C;
|
||||
Main *main_newlib; /* stored as a dynamic 'main' until we free it */
|
||||
Main *main_tmp= NULL; /* created only for linking, then freed */
|
||||
LinkNode *names = NULL;
|
||||
@@ -981,12 +980,10 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
|
||||
main_newlib= (Main *)MEM_callocN( sizeof(Main), "BgeMain");
|
||||
C= CTX_create();
|
||||
CTX_data_main_set(C, main_newlib);
|
||||
BKE_reports_init(&reports, RPT_STORE);
|
||||
|
||||
/* here appending/linking starts */
|
||||
main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
|
||||
main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
|
||||
|
||||
int totnames_dummy;
|
||||
names = BLO_blendhandle_get_datablock_names( bpy_openlib, idcode, &totnames_dummy);
|
||||
@@ -1000,11 +997,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
BLI_linklist_free(names, free); /* free linklist *and* each node's data */
|
||||
|
||||
BLO_library_append_end(C, main_tmp, &bpy_openlib, idcode, flag);
|
||||
BLO_library_append_end(NULL, main_tmp, &bpy_openlib, idcode, flag);
|
||||
|
||||
/* now do another round of linking for Scenes so all actions are properly loaded */
|
||||
if (idcode==ID_SCE && options & LIB_LOAD_LOAD_ACTIONS) {
|
||||
main_tmp = BLO_library_append_begin(C, &bpy_openlib, (char *)path);
|
||||
main_tmp = BLO_library_append_begin(main_newlib, &bpy_openlib, (char *)path);
|
||||
|
||||
int totnames_dummy;
|
||||
names = BLO_blendhandle_get_datablock_names( bpy_openlib, ID_AC, &totnames_dummy);
|
||||
@@ -1018,12 +1015,11 @@ bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const cha
|
||||
}
|
||||
BLI_linklist_free(names, free); /* free linklist *and* each node's data */
|
||||
|
||||
BLO_library_append_end(C, main_tmp, &bpy_openlib, ID_AC, flag);
|
||||
BLO_library_append_end(NULL, main_tmp, &bpy_openlib, ID_AC, flag);
|
||||
}
|
||||
|
||||
BLO_blendhandle_close(bpy_openlib);
|
||||
|
||||
CTX_free(C);
|
||||
|
||||
BKE_reports_clear(&reports);
|
||||
/* done linking */
|
||||
|
||||
|
Reference in New Issue
Block a user