Merged changes in the trunk up to revision 54802.
[blender.git] / source / blender / blenkernel / intern / object.c
index 95b1809bbae003946772420fa10c3493bfbeb0f9..5cea2c9fe0e4779b7ce0debf7436e66ae0cf0b47 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!) */
 
@@ -672,6 +676,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;