[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42953] branches/bmesh/blender/source/ blender/blenkernel/intern/mesh.c: this missed merging from trunk somehow ( mesh make local edits)
Campbell Barton
ideasman42 at gmail.com
Wed Dec 28 23:47:56 CET 2011
Revision: 42953
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42953
Author: campbellbarton
Date: 2011-12-28 22:47:55 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
this missed merging from trunk somehow (mesh make local edits)
Modified Paths:
--------------
branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c
Modified: branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c 2011-12-28 22:46:10 UTC (rev 42952)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/mesh.c 2011-12-28 22:47:55 UTC (rev 42953)
@@ -590,7 +590,7 @@
{
Main *bmain= G.main;
Object *ob;
- int local=0, lib=0;
+ int is_local= FALSE, is_lib= FALSE;
/* - only lib users: do nothing
* - only local users: set flag
@@ -599,32 +599,28 @@
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);
+ id_clear_lib_data(bmain, &me->id);
expand_local_mesh(me);
return;
}
- for(ob= bmain->object.first; ob && ELEM(0, lib, local); ob= ob->id.next) {
+ for(ob= bmain->object.first; ob && ELEM(0, is_lib, is_local); ob= ob->id.next) {
if(me == ob->data) {
- if(ob->id.lib) lib= 1;
- else local= 1;
+ if(ob->id.lib) is_lib= TRUE;
+ else is_local= TRUE;
}
}
- if(local && lib==0) {
- me->id.lib= NULL;
- me->id.flag= LIB_LOCAL;
-
- new_id(&bmain->mesh, (ID *)me, NULL);
+ if(is_local && is_lib == FALSE) {
+ id_clear_lib_data(bmain, &me->id);
expand_local_mesh(me);
}
- else if(local && lib) {
+ else if(is_local && is_lib) {
Mesh *me_new= copy_mesh(me);
me_new->id.us= 0;
+
+ /* Remap paths of new ID using old library as base. */
BKE_id_lib_local_paths(bmain, me->id.lib, &me_new->id);
for(ob= bmain->object.first; ob; ob= ob->id.next) {
More information about the Bf-blender-cvs
mailing list