Merged changes in the trunk up to revision 47977.
[blender.git] / source / blender / blenkernel / intern / object.c
index 1f5ba8ae30517dd5aeb1ff977867d5b9a178f221..1d045d4142d73be237aee506318b5aaca6aafe3a 100644 (file)
 
 #include "GPU_material.h"
 
+#include "FRS_freestyle.h"
+
 /* Local function protos */
 float originmat[3][3];  /* after BKE_object_where_is_calc(), can be used in other functions (bad!) */
 
@@ -613,6 +615,14 @@ void BKE_object_unlink(Object *ob)
                                }
                                SEQ_END
                        }
+
+                       {
+                               SceneRenderLayer *srl;
+
+                               for (srl= sce->r.layers.first; srl; srl= srl->next) {
+                                       FRS_unlink_target_object(&srl->freestyleConfig, ob);
+                               }
+                       }
                }
 
                sce = sce->id.next;