added function BKE_library_filepath_set which sync's the libraries absolute path when setting to a relative value, before this you could never be sure if a libraries absolute path was valid or not because the user might have changed the relative library path in the outliner, now setting from the outliner and py/rna syncs the absolute path.

This commit is contained in:
Campbell Barton
2011-10-24 04:52:43 +00:00
parent c49cdf5eec
commit 809131bc80
2 changed files with 2 additions and 15 deletions

View File

@@ -59,7 +59,6 @@ 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);

View File

@@ -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,7 +108,6 @@
#include "BKE_gpencil.h"
#include "BKE_fcurve.h"
#include "BKE_speaker.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
@@ -195,8 +194,7 @@ int id_make_local(ID *id, int test)
if(!test) make_local_texture((Tex*)id);
return 1;
case ID_IM:
if(!test) make_local_image((Image*)id);
return 1;
return 0; /* not implemented */
case ID_LT:
if(!test) {
make_local_lattice((Lattice*)id);
@@ -1248,16 +1246,6 @@ 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)
{