Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-08-02 19:49:20 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-08-02 19:49:20 +0400
commit64aa98643d9de3879898c7120ecd5cb72f61c4b7 (patch)
treec353f7d2ed361b9c6f256194920efccf1a544074
parentdc67840db6c3cf0e73b93d36649219a85751a4f3 (diff)
Fix #31753: GLSL not updated after deleting lights in multiple-scene setting
-rw-r--r--source/blender/editors/object/object_add.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 21eab5bd4dc..d90735ca5ac 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -105,6 +105,8 @@
#include "UI_interface.h"
#include "UI_resources.h"
+#include "GPU_material.h"
+
#include "object_intern.h"
/* this is an exact copy of the define in rna_lamp.c
@@ -893,12 +895,24 @@ void OBJECT_OT_group_instance_add(wmOperatorType *ot)
/**************************** Delete Object *************************/
+static void object_delete_check_glsl_update(Object *ob)
+{
+ /* some objects could affect on GLSL shading, make sure GLSL settings
+ * are being tagged to be updated when object is removing from scene
+ */
+ if (ob->type == OB_LAMP) {
+ if (ob->gpulamp.first)
+ GPU_lamp_free(ob);
+ }
+}
+
/* remove base from a specific scene */
/* note: now unlinks constraints as well */
void ED_base_object_free_and_unlink(Main *bmain, Scene *scene, Base *base)
{
DAG_id_type_tag(bmain, ID_OB);
BLI_remlink(&scene->base, base);
+ object_delete_check_glsl_update(base->object);
BKE_libblock_free_us(&bmain->object, base->object);
if (scene->basact == base) scene->basact = NULL;
MEM_freeN(base);