Revision: 39050 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39050 Author: nazgul Date: 2011-08-05 06:47:37 +0000 (Fri, 05 Aug 2011) Log Message: ----------- Merging r39029 through r39049 from trunk into soc-2011-tomato
Revision Links: -------------- http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39029 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39049 Modified Paths: -------------- branches/soc-2011-tomato/source/blender/blenloader/BLO_readfile.h branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c branches/soc-2011-tomato/source/blender/editors/space_file/file_ops.c branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c branches/soc-2011-tomato/source/blender/python/intern/bpy_library.c branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_operators.c branches/soc-2011-tomato/source/gameengine/Converter/KX_BlenderSceneConverter.cpp Property Changed: ---------------- branches/soc-2011-tomato/ Property changes on: branches/soc-2011-tomato ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/blender:36831-39028 + /trunk/blender:36831-39049 Modified: branches/soc-2011-tomato/source/blender/blenloader/BLO_readfile.h =================================================================== --- branches/soc-2011-tomato/source/blender/blenloader/BLO_readfile.h 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/blenloader/BLO_readfile.h 2011-08-05 06:47:37 UTC (rev 39050) @@ -211,9 +211,18 @@ */ int BLO_is_a_library(const char *path, char *dir, char *group); -struct Main* BLO_library_append_begin(const struct bContext *C, BlendHandle** bh, const char *filepath); +/** + * Initialize the BlendHandle for appending or linking library data. + * + * @param mainvar The current main database eg G.main or CTX_data_main(C). + * @param bh A blender file handle as returned by BLO_blendhandle_from_file or BLO_blendhandle_from_memory. + * @param filepath Used for relative linking, copied to the lib->name + * @return the library Main, to be passed to BLO_library_append_named_part as mainl. + */ +struct Main* BLO_library_append_begin(struct Main *mainvar, BlendHandle** bh, const char *filepath); + /** * Link/Append a named datablock from an external blend file. * @@ -243,11 +252,6 @@ void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname); -/* deprecated */ -#if 1 -void BLO_script_library_append(BlendHandle **bh, char *dir, char *name, int idcode, short flag, struct Main *mainvar, struct Scene *scene, struct ReportList *reports); -#endif - BlendFileData* blo_read_blendafterruntime(int file, char *name, int actualsize, struct ReportList *reports); #ifdef __cplusplus Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c =================================================================== --- branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -13126,9 +13126,8 @@ /* common routine to append/link something from a library */ -static Main* library_append_begin(const bContext *C, FileData **fd, const char *filepath) +static Main* library_append_begin(Main *mainvar, FileData **fd, const char *filepath) { - Main *mainvar= CTX_data_main(C); Main *mainl; /* make mains */ @@ -13144,10 +13143,10 @@ return mainl; } -Main* BLO_library_append_begin(const bContext *C, BlendHandle** bh, const char *filepath) +Main* BLO_library_append_begin(Main *mainvar, BlendHandle** bh, const char *filepath) { FileData *fd= (FileData*)(*bh); - return library_append_begin(C, &fd, filepath); + return library_append_begin(mainvar, &fd, filepath); } Modified: branches/soc-2011-tomato/source/blender/editors/space_file/file_ops.c =================================================================== --- branches/soc-2011-tomato/source/blender/editors/space_file/file_ops.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/editors/space_file/file_ops.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -64,6 +64,7 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> +#include <ctype.h> /* for events */ #define NOTACTIVEFILE 0 @@ -1079,8 +1080,18 @@ } #ifdef WIN32 - if (sfile->params->dir[0] == '\0') + if (sfile->params->dir[0] == '\0') { get_default_root(sfile->params->dir); + } + /* change "C:" --> "C:\", [#28102] */ + else if ( (isalpha(sfile->params->dir[0]) && + (sfile->params->dir[1] == ':')) && + (sfile->params->dir[2] == '\0') + + ) { + sfile->params->dir[2]= '\\'; + sfile->params->dir[3]= '\0'; + } #endif } } Modified: branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c =================================================================== --- branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_edit.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -1785,7 +1785,7 @@ se = give_stripelem(seq, cfra); seq_new= seq_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME); - BLI_addtail(&ed->seqbase, seq_new); + BLI_addtail(ed->seqbasep, seq_new); seq_new->start= start_ofs; seq_new->type= SEQ_IMAGE; @@ -1839,7 +1839,6 @@ ot->description="On image sequences strips, it return a strip for each image"; /* api callbacks */ - ot->invoke= WM_operator_props_popup; ot->exec= sequencer_separate_images_exec; ot->poll= sequencer_edit_poll; Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c =================================================================== --- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_access.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -4007,10 +4007,13 @@ { PropertyRNA *prop= RNA_struct_find_property(ptr, name); - if(prop) + if(prop) { RNA_property_string_get(ptr, prop, value); - else + } + else { printf("RNA_string_get: %s.%s not found.\n", ptr->type->identifier, name); + value[0]= '\0'; + } } char *RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen) Modified: branches/soc-2011-tomato/source/blender/python/intern/bpy_library.c =================================================================== --- branches/soc-2011-tomato/source/blender/python/intern/bpy_library.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/python/intern/bpy_library.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -39,6 +39,7 @@ #include "BKE_library.h" #include "BKE_idcode.h" #include "BKE_report.h" +#include "BKE_context.h" #include "BLI_utildefines.h" #include "BLI_string.h" @@ -317,7 +318,7 @@ flag_all_listbases_ids(LIB_PRE_EXISTING, 1); /* here appending/linking starts */ - mainl= BLO_library_append_begin(BPy_GetContext(), &(self->blo_handle), self->relpath); + mainl= BLO_library_append_begin(CTX_data_main(BPy_GetContext()), &(self->blo_handle), self->relpath); { int i= 0, code; Modified: branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_operators.c =================================================================== --- branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_operators.c 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/blender/windowmanager/intern/wm_operators.c 2011-08-05 06:47:37 UTC (rev 39050) @@ -1621,7 +1621,6 @@ int idcode, totfiles=0; short flag; - name[0] = '\0'; RNA_string_get(op->ptr, "filename", name); RNA_string_get(op->ptr, "directory", dir); @@ -1690,7 +1689,7 @@ flag_all_listbases_ids(LIB_PRE_EXISTING, 1); /* here appending/linking starts */ - mainl = BLO_library_append_begin(C, &bh, libname); + mainl = BLO_library_append_begin(bmain, &bh, libname); if(totfiles == 0) { BLO_library_append_named_part_ex(C, mainl, &bh, name, idcode, flag); } Modified: branches/soc-2011-tomato/source/gameengine/Converter/KX_BlenderSceneConverter.cpp =================================================================== --- branches/soc-2011-tomato/source/gameengine/Converter/KX_BlenderSceneConverter.cpp 2011-08-05 06:43:20 UTC (rev 39049) +++ branches/soc-2011-tomato/source/gameengine/Converter/KX_BlenderSceneConverter.cpp 2011-08-05 06:47:37 UTC (rev 39050) @@ -950,7 +950,6 @@ 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 @@ } 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 @@ } 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 @@ } 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 */ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs