Merged changes in the trunk up to revision 52191.
[blender.git] / source / blender / blenkernel / intern / object.c
index 47ca502d247c107f41f818c07c9be68b428db557..9ea1c3e8c7455773be7536765a2dac0169c8ed40 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!) */
 
@@ -632,6 +634,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;