diff options
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 25 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_library.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 6 | ||||
-rw-r--r-- | source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 2 |
5 files changed, 20 insertions, 19 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index c203f651680..51b016a77f8 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -96,10 +96,10 @@ bool BLO_has_bfile_extension(const char *str); bool BLO_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name); struct Main *BLO_library_link_begin(struct Main *mainvar, BlendHandle **bh, const char *filepath); -struct ID *BLO_library_link_named_part(struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode); +struct ID *BLO_library_link_named_part(struct Main *mainl, BlendHandle **bh, const short idcode, const char *name); struct ID *BLO_library_link_named_part_ex( struct Main *mainl, BlendHandle **bh, - const char *idname, const int idcode, const short flag, + const short idcode, const char *name, const short flag, struct Scene *scene, struct View3D *v3d); void BLO_library_link_end(struct Main *mainl, BlendHandle **bh, short flag, struct Scene *scene, struct View3D *v3d); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 470d45f1fea..2e7969637a3 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9617,9 +9617,9 @@ static void give_base_to_groups( /* returns true if the item was found * but it may already have already been appended/linked */ -static ID *link_named_part(Main *mainl, FileData *fd, const char *idname, const short idcode) +static ID *link_named_part(Main *mainl, FileData *fd, const short idcode, const char *name) { - BHead *bhead = find_bhead_from_code_name(fd, idcode, idname); + BHead *bhead = find_bhead_from_code_name(fd, idcode, name); ID *id; if (bhead) { @@ -9679,10 +9679,10 @@ void BLO_library_link_all(Main *mainl, BlendHandle *bh) } static ID *link_named_part_ex( - Main *mainl, FileData *fd, const char *idname, const int idcode, const int flag, + Main *mainl, FileData *fd, const short idcode, const char *name, const short flag, Scene *scene, View3D *v3d) { - ID *id = link_named_part(mainl, fd, idname, idcode); + ID *id = link_named_part(mainl, fd, idcode, name); if (id && (GS(id->name) == ID_OB)) { /* loose object: give a base */ if (scene) { @@ -9726,14 +9726,14 @@ static ID *link_named_part_ex( * * \param mainl The main database to link from (not the active one). * \param bh The blender file handle. - * \param idname The name of the datablock (without the 2 char ID prefix). * \param idcode The kind of datablock to link. - * \return the appended ID when found. + * \param name The name of the datablock (without the 2 char ID prefix). + * \return the linked ID when found. */ -ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const char *idname, const int idcode) +ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const short idcode, const char *name) { FileData *fd = (FileData*)(*bh); - return link_named_part(mainl, fd, idname, idcode); + return link_named_part(mainl, fd, idcode, name); } /** @@ -9742,19 +9742,20 @@ ID *BLO_library_link_named_part(Main *mainl, BlendHandle **bh, const char *idnam * * \param mainl The main database to link from (not the active one). * \param bh The blender file handle. - * \param idname The name of the datablock (without the 2 char ID prefix). * \param idcode The kind of datablock to link. + * \param name The name of the datablock (without the 2 char ID prefix). * \param flag Options for linking, used for instantiating. * \param scene The scene in which to instantiate objects/groups (if NULL, no instantiation is done). * \param v3d The active View3D (only to define active layers for instantiated objects & groups, can be NULL). - * \return the appended ID when found. + * \return the linked ID when found. */ ID *BLO_library_link_named_part_ex( - Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag, + Main *mainl, BlendHandle **bh, + const short idcode, const char *name, const short flag, Scene *scene, View3D *v3d) { FileData *fd = (FileData*)(*bh); - return link_named_part_ex(mainl, fd, idname, idcode, flag, scene, v3d); + return link_named_part_ex(mainl, fd, idcode, name, flag, scene, v3d); } static void link_id_part(FileData *fd, Main *mainvar, ID *id, ID **r_id) diff --git a/source/blender/python/intern/bpy_library.c b/source/blender/python/intern/bpy_library.c index fb9fecb878f..0912ac0b637 100644 --- a/source/blender/python/intern/bpy_library.c +++ b/source/blender/python/intern/bpy_library.c @@ -358,7 +358,7 @@ static PyObject *bpy_lib_exit(BPy_Library *self, PyObject *UNUSED(args)) // printf(" %s\n", item_str); if (item_str) { - ID *id = BLO_library_link_named_part(mainl, &(self->blo_handle), item_str, idcode); + ID *id = BLO_library_link_named_part(mainl, &(self->blo_handle), idcode, item_str); if (id) { #ifdef USE_RNA_DATABLOCKS /* swap name for pointer to the id */ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 1245430f68b..5c2e1f859c8 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2629,7 +2629,7 @@ static short wm_link_append_flag(wmOperator *op) typedef struct WMLinkAppendDataItem { char *name; BLI_bitmap *libraries; /* All libs (from WMLinkAppendData.libraries) to try to load this ID from. */ - int idcode; + short idcode; ID *new_id; void *customdata; @@ -2675,7 +2675,7 @@ static void wm_link_append_data_library_add(WMLinkAppendData *lapp_data, const c } static WMLinkAppendDataItem *wm_link_append_data_item_add( - WMLinkAppendData *lapp_data, const char *idname, const int idcode, void *customdata) + WMLinkAppendData *lapp_data, const char *idname, const short idcode, void *customdata) { WMLinkAppendDataItem *item = BLI_memarena_alloc(lapp_data->memarena, sizeof(*item)); size_t len = strlen(idname) + 1; @@ -2742,7 +2742,7 @@ static void wm_link_do( continue; } - new_id = BLO_library_link_named_part_ex(mainl, &bh, item->name, item->idcode, flag, scene, v3d); + new_id = BLO_library_link_named_part_ex(mainl, &bh, item->idcode, item->name, flag, scene, v3d); if (new_id) { /* If the link is sucessful, clear item's libs 'todo' flags. * This avoids trying to link same item with other libraries to come. */ diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 4adfcb50d61..02c00b2835b 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -861,7 +861,7 @@ static void load_datablocks(Main *main_tmp, BlendHandle *bpy_openlib, const char int i = 0; LinkNode *n = names; while (n) { - BLO_library_link_named_part(main_tmp, &bpy_openlib, (char *)n->link, idcode); + BLO_library_link_named_part(main_tmp, &bpy_openlib, idcode, (char *)n->link); n = (LinkNode *)n->next; i++; } |