Eevee: Fix crash when using lamps in dupli groups.
authorClément Foucault <foucault.clem@gmail.com>
Wed, 19 Jul 2017 16:15:27 +0000 (18:15 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 19 Jul 2017 16:17:56 +0000 (18:17 +0200)
source/blender/draw/engines/eevee/eevee_engine.c

index fe802e6d6273b97af82cf648e064847bfb801b86..480bb1b12ad7cbd7eba132fd16a800bf514f516b 100644 (file)
@@ -108,10 +108,20 @@ static void EEVEE_cache_populate(void *vedata, Object *ob)
                }
        }
        else if (ob->type == OB_LIGHTPROBE) {
-               EEVEE_lightprobes_cache_add(sldata, ob);
+               if ((ob->base_flag & BASE_FROMDUPLI) != 0) {
+                       /* TODO: Special case for dupli objects because we cannot save the object pointer. */
+               }
+               else {
+                       EEVEE_lightprobes_cache_add(sldata, ob);
+               }
        }
        else if (ob->type == OB_LAMP) {
-               EEVEE_lights_cache_add(sldata, ob);
+               if ((ob->base_flag & BASE_FROMDUPLI) != 0) {
+                       /* TODO: Special case for dupli objects because we cannot save the object pointer. */
+               }
+               else {
+                       EEVEE_lights_cache_add(sldata, ob);
+               }
        }
 }