diff --git a/source/gameengine/Converter/BL_Converter.cpp b/source/gameengine/Converter/BL_Converter.cpp index 080028bc01f8..3f28ae59dff8 100644 --- a/source/gameengine/Converter/BL_Converter.cpp +++ b/source/gameengine/Converter/BL_Converter.cpp @@ -435,6 +435,24 @@ KX_LibLoadStatus *BL_Converter::LinkBlendFile(BlendHandle *blendlib, const char else if (idcode == ID_SCE) { // Merge all new linked in scene into the existing one +#ifdef WITH_PYTHON + // Handle any text datablocks + if (options & LIB_LOAD_LOAD_SCRIPTS) { + addImportMain(main_newlib); + } +#endif + // Now handle all the actions + if (options & LIB_LOAD_LOAD_ACTIONS) { + ID *action; + + for (action = (ID *)main_newlib->action.first; action; action = (ID *)action->next) { + if (options & LIB_LOAD_VERBOSE) { + CM_Debug("action name: " << action->name + 2); + } + scene_merge->GetLogicManager()->RegisterActionName(action->name + 2, action); + } + } + if (options & LIB_LOAD_ASYNC) { std::vector scenes; for (Scene *bscene = (Scene *)main_newlib->scene.first; bscene; bscene = (Scene *)bscene->id.next) { @@ -465,25 +483,6 @@ KX_LibLoadStatus *BL_Converter::LinkBlendFile(BlendHandle *blendlib, const char MergeScene(scene_merge, sceneConverter); } } - -#ifdef WITH_PYTHON - // Handle any text datablocks - if (options & LIB_LOAD_LOAD_SCRIPTS) { - addImportMain(main_newlib); - } -#endif - - // Now handle all the actions - if (options & LIB_LOAD_LOAD_ACTIONS) { - ID *action; - - for (action = (ID *)main_newlib->action.first; action; action = (ID *)action->next) { - if (options & LIB_LOAD_VERBOSE) { - CM_Debug("action name: " << action->name + 2); - } - scene_merge->GetLogicManager()->RegisterActionName(action->name + 2, action); - } - } } if (!(options & LIB_LOAD_ASYNC)) {