Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Fraser <alex@phatcore.com>2011-10-26 14:49:21 +0400
committerAlex Fraser <alex@phatcore.com>2011-10-26 14:49:21 +0400
commitf09d36d6bce6f2fb9f618f9bf57a91a3502ba3eb (patch)
tree3f693ae09a7d9352c8621b863ad10150b3d85cbc
parent944b07f5b7339f45bfb0bded22f64458cca3980b (diff)
Fix [#28772] Filepaths are not remmaped after making a library item local
Added a visitor function to simplify processing of file paths that are attached to IDs. This is used for images, and could be used for other ID types in future. Code reviewed by ideasman_42.
-rw-r--r--source/blender/blenkernel/BKE_library.h1
-rw-r--r--source/blender/blenkernel/intern/action.c9
-rw-r--r--source/blender/blenkernel/intern/library.c16
-rw-r--r--source/blender/blenkernel/intern/object.c1
-rw-r--r--source/blender/blenloader/intern/readfile.c17
5 files changed, 18 insertions, 26 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 947eafa9dd3..77ce7a50956 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -59,6 +59,7 @@ int id_copy(struct ID *id, struct ID **newid, int test);
int id_unlink(struct ID *id, int test);
int new_id(struct ListBase *lb, struct ID *id, const char *name);
+void id_clear_lib_data(struct ListBase *lb, struct ID *id);
struct ListBase *which_libbase(struct Main *mainlib, short type);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index e46e2df8353..ac0697ddbf9 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -137,19 +137,14 @@ void make_local_action(bAction *act)
// XXX: double-check this; it used to be just single-user check, but that was when fake-users were still default
if ((act->id.flag & LIB_FAKEUSER) && (act->id.us<=1)) {
- act->id.lib= NULL;
- act->id.flag= LIB_LOCAL;
- new_id(&bmain->action, (ID *)act, NULL);
+ id_clear_lib_data(&bmain->action, (ID *)act);
return;
}
BKE_animdata_main_cb(bmain, make_localact_init_cb, &mlac);
if (mlac.local && mlac.lib==0) {
- act->id.lib= NULL;
- act->id.flag= LIB_LOCAL;
- //make_local_action_channels(act);
- new_id(&bmain->action, (ID *)act, NULL);
+ id_clear_lib_data(&bmain->action, (ID *)act);
}
else if (mlac.local && mlac.lib) {
mlac.actn= copy_action(act);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index c44ccd7aa57..0c2ca4c68b3 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -74,7 +74,7 @@
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
-
+#include "BLI_bpath.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
@@ -108,6 +108,7 @@
#include "BKE_gpencil.h"
#include "BKE_fcurve.h"
#include "BKE_speaker.h"
+#include "BKE_utildefines.h"
#include "RNA_access.h"
@@ -194,7 +195,8 @@ int id_make_local(ID *id, int test)
if(!test) make_local_texture((Tex*)id);
return 1;
case ID_IM:
- return 0; /* not implemented */
+ if(!test) make_local_image((Image*)id);
+ return 1;
case ID_LT:
if(!test) {
make_local_lattice((Lattice*)id);
@@ -1246,6 +1248,16 @@ int new_id(ListBase *lb, ID *id, const char *tname)
return result;
}
+/* Pull an ID out of a library (make it local). Only call this for IDs that
+ don't have other library users. */
+void id_clear_lib_data(ListBase *lb, ID *id)
+{
+ bpath_traverse_id(id, bpath_relocate_visitor, id->lib->filepath);
+ id->lib= NULL;
+ id->flag= LIB_LOCAL;
+ new_id(lb, id, NULL);
+}
+
/* next to indirect usage in read/writefile also in editobject.c scene.c */
void clear_id_newpoins(void)
{
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 6e09aefeea2..1e5b69dc4ee 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1083,7 +1083,6 @@ Object *add_only_object(int type, const char *name)
/* ob->pad3 == Contact Processing Threshold */
ob->m_contactProcessingThreshold = 1.;
ob->obstacleRad = 1.;
- ob->col_group = ob->col_mask = 1;
/* NT fluid sim defaults */
ob->fluidsimFlag = 0;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 45ab4a5cdaf..9ac0fab3b81 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10464,6 +10464,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sce->gm.dome.warptext = sce->r.dometext;
//Stand Alone
+ sce->gm.fullscreen = sce->r.fullscreen;
sce->gm.xplay = sce->r.xplay;
sce->gm.yplay = sce->r.yplay;
sce->gm.freqplay = sce->r.freqplay;
@@ -12190,22 +12191,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
-
- {
- /* Initialize BGE exit key to esc key */
- Scene *scene;
- for(scene= main->scene.first; scene; scene= scene->id.next) {
- if (!scene->gm.exitkey)
- scene->gm.exitkey = 218; //218 is the Blender key code for ESC
- }
- }
-
- {
- /* Initialize default values for collision masks */
- Object *ob;
- for(ob=main->object.first; ob; ob=ob->id.next)
- ob->col_group = ob->col_mask = 1;
- }
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */