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