Fix object-dupli selection w/ COW
authorCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jun 2018 13:19:16 +0000 (15:19 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jun 2018 13:24:27 +0000 (15:24 +0200)
source/blender/draw/intern/draw_manager.c

index d2554443d7b0ee6e4f6551a65afd3fe3f2b759cc..63631dd4a182fd399388553fe49f1e125bead146 100644 (file)
@@ -1698,8 +1698,11 @@ void DRW_draw_select_loop(
                                DEG_ITER_OBJECT_FLAG_DUPLI)
                        {
                                if ((ob->base_flag & BASE_SELECTABLED) != 0) {
-                                       Object *ob_orig = DEG_get_original_object(ob);
-                                       DRW_select_load_id(ob_orig->select_color);
+                                       /* This relies on dupli instances being after their instancing object. */
+                                       if ((ob->base_flag & BASE_FROMDUPLI) == 0) {
+                                               Object *ob_orig = DEG_get_original_object(ob);
+                                               DRW_select_load_id(ob_orig->select_color);
+                                       }
                                        drw_engines_cache_populate(ob);
                                }
                        }