[Bf-blender-cvs] [7dae8e5] master: Fix wrong proxy pointer hanging around after making all local

Sergey Sharybin noreply at git.blender.org
Thu Jun 11 23:47:43 CEST 2015


Commit: 7dae8e54cc6d3783ff78f2f4f9674bd4219f652c
Author: Sergey Sharybin
Date:   Thu Jun 11 23:47:00 2015 +0200
Branches: master
https://developer.blender.org/rB7dae8e54cc6d3783ff78f2f4f9674bd4219f652c

Fix wrong proxy pointer hanging around after making all local

The issue was caused because of the following circumstances:

- Making All Local will just iterate all IDs and clear linked flags
- It will not do anything with objects which are already local (and
  since proxy rig is local nothing will be changing it).

This commit makes it so id_clear_lib_data() takes care of clearing
all related proxy pointers, avoiding situations when proxy rig will
point to a local armature.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1276

===================================================================

M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/object.c

===================================================================

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index bf6f7a5..39bcf51 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1421,6 +1421,15 @@ void id_clear_lib_data(Main *bmain, ID *id)
 	if (ntree) {
 		ntree->id.lib = NULL;
 	}
+
+	if (GS(id->name) == ID_OB) {
+		Object *object = (Object*)id;
+		if (object->proxy_from != NULL) {
+			object->proxy_from->proxy = NULL;
+			object->proxy_from->proxy_group = NULL;
+		}
+		object->proxy = object->proxy_from = object->proxy_group = NULL;
+	}
 }
 
 /* next to indirect usage in read/writefile also in editobject.c scene.c */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a11f838..647aadf 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1609,7 +1609,7 @@ void BKE_object_make_local(Object *ob)
 
 	if (ob->id.lib == NULL) return;
 	
-	ob->proxy = ob->proxy_from = NULL;
+	ob->proxy = ob->proxy_from  = ob->proxy_group = NULL;
 	
 	if (ob->id.us == 1) {
 		id_clear_lib_data(bmain, &ob->id);




More information about the Bf-blender-cvs mailing list