Fix T59133: Area light size not updating from viewport gizmo.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 12 Dec 2018 09:43:21 +0000 (10:43 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 12 Dec 2018 09:44:39 +0000 (10:44 +0100)
When we are directly affecting DNA, we need to handle update ourself...

source/blender/editors/space_view3d/view3d_gizmo_lamp.c

index 3eaddce582b898d1fa9fcae6830e5b4152fcb5ff..b50f69950fb4cef585db5ed3514e11d4faef48dd 100644 (file)
@@ -30,6 +30,8 @@
 #include "BKE_context.h"
 #include "BKE_object.h"
 
+#include "DEG_depsgraph.h"
+
 #include "DNA_object_types.h"
 #include "DNA_lamp_types.h"
 
@@ -154,6 +156,9 @@ static void gizmo_area_lamp_prop_matrix_set(
        else {
                la->area_size = len_v3(matrix[0]);
        }
+
+       DEG_id_tag_update(&la->id, ID_RECALC_COPY_ON_WRITE);
+       WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la);
 }
 
 static bool WIDGETGROUP_lamp_area_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))