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:
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c57
1 files changed, 18 insertions, 39 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 9574c886ccc..a5bf39d895c 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -243,39 +241,26 @@ Mesh *copy_mesh(Mesh *me)
return men;
}
-static void make_local_tface(Main *bmain, Mesh *me)
+static void expand_local_mesh(Mesh *me)
{
- MTFace *tface;
- Image *ima;
- int a, i;
-
- for(i=0; i<me->fdata.totlayer; i++) {
- if(me->fdata.layers[i].type == CD_MTFACE) {
- tface= (MTFace*)me->fdata.layers[i].data;
-
- for(a=0; a<me->totface; a++, tface++) {
- /* special case: ima always local immediately */
- if(tface->tpage) {
- ima= tface->tpage;
- if(ima->id.lib) {
- ima->id.lib= NULL;
- ima->id.flag= LIB_LOCAL;
- new_id(&bmain->image, (ID *)ima, NULL);
+ id_lib_extern((ID *)me->texcomesh);
+
+ if(me->mtface) {
+ MTFace *tface;
+ int a, i;
+
+ for(i=0; i<me->fdata.totlayer; i++) {
+ if(me->fdata.layers[i].type == CD_MTFACE) {
+ tface= (MTFace*)me->fdata.layers[i].data;
+
+ for(a=0; a<me->totface; a++, tface++) {
+ if(tface->tpage) {
+ id_lib_extern((ID *)tface->tpage);
}
}
}
}
}
-}
-
-static void expand_local_mesh(Main *bmain, Mesh *me)
-{
- id_lib_extern((ID *)me->texcomesh);
-
- if(me->mtface) {
- /* why is this an exception? - should not really make local when extern'ing - campbell */
- make_local_tface(bmain, me);
- }
if(me->mat) {
extern_local_matarar(me->mat, me->totcol);
@@ -295,11 +280,8 @@ void make_local_mesh(Mesh *me)
if(me->id.lib==NULL) return;
if(me->id.us==1) {
- me->id.lib= NULL;
- me->id.flag= LIB_LOCAL;
-
- new_id(&bmain->mesh, (ID *)me, NULL);
- expand_local_mesh(bmain, me);
+ id_clear_lib_data(&bmain->mesh, (ID *)me);
+ expand_local_mesh(me);
return;
}
@@ -311,11 +293,8 @@ void make_local_mesh(Mesh *me)
}
if(local && lib==0) {
- me->id.lib= NULL;
- me->id.flag= LIB_LOCAL;
-
- new_id(&bmain->mesh, (ID *)me, NULL);
- expand_local_mesh(bmain, me);
+ id_clear_lib_data(&bmain->mesh, (ID *)me);
+ expand_local_mesh(me);
}
else if(local && lib) {
Mesh *men= copy_mesh(me);