Blender V4.3
view3d_gizmo_light.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#include "BLI_math_matrix.h"
11#include "BLI_math_vector.h"
12#include "BLI_utildefines.h"
13
14#include "BKE_context.hh"
15#include "BKE_layer.hh"
16
17#include "DEG_depsgraph.hh"
18
19#include "DNA_light_types.h"
20#include "DNA_object_types.h"
21
22#include "ED_gizmo_library.hh"
23
24#include "UI_resources.hh"
25
26#include "MEM_guardedalloc.h"
27
28#include "RNA_access.hh"
29#include "RNA_prototypes.hh"
30
31#include "WM_api.hh"
32#include "WM_types.hh"
33
34#include "view3d_intern.hh" /* own include */
35
36/* -------------------------------------------------------------------- */
39/* NOTE: scaling from `overlay_extra.cc`. */
40#define CONE_SCALE 10.0f
41#define INV_CONE_SCALE 0.1f
42
48
49static void gizmo_spot_blend_prop_matrix_get(const wmGizmo * /*gz*/,
50 wmGizmoProperty *gz_prop,
51 void *value_p)
52{
53 BLI_assert(gz_prop->type->array_length == 16);
54 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
55
56 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
57 ViewLayer *view_layer = CTX_data_view_layer(C);
59 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
60
61 float a = cosf(la->spotsize * 0.5f);
62 float b = la->spotblend;
63 /* Cosine of the angle where spot attenuation == 1. */
64 float c = (1.0f - a) * b + a;
65 /* Tangent. */
66 float t = sqrtf(1.0f - c * c) / c;
67
68 matrix[0][0] = 2.0f * CONE_SCALE * t * a;
69 matrix[1][1] = 2.0f * CONE_SCALE * t * a;
70}
71
72static void gizmo_spot_blend_prop_matrix_set(const wmGizmo * /*gz*/,
73 wmGizmoProperty *gz_prop,
74 const void *value_p)
75{
76 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
77 BLI_assert(gz_prop->type->array_length == 16);
78
79 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
80 Scene *scene = CTX_data_scene(C);
81 ViewLayer *view_layer = CTX_data_view_layer(C);
82 BKE_view_layer_synced_ensure(scene, view_layer);
83 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
84
85 float a = cosf(la->spotsize * 0.5f);
86 float t = matrix[0][0] * 0.5f * INV_CONE_SCALE / a;
87 float c = 1.0f / sqrt(t * t + 1.0f);
88
89 float spot_blend = safe_divide(clamp_f(c - a, 0.0f, 1.0f - a), 1.0f - a);
90
91 PointerRNA light_ptr = RNA_pointer_create(&la->id, &RNA_Light, la);
92 PropertyRNA *spot_blend_prop = RNA_struct_find_property(&light_ptr, "spot_blend");
93 RNA_property_float_set(&light_ptr, spot_blend_prop, spot_blend);
94
95 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, spot_blend_prop);
96}
97
98/* Used by spot light and point light. */
100 wmGizmoProperty *gz_prop,
101 void *value_p)
102{
103 BLI_assert(gz_prop->type->array_length == 16);
104 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
105
106 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
107 ViewLayer *view_layer = CTX_data_view_layer(C);
109 const Light *la = static_cast<const Light *>(BKE_view_layer_active_object_get(view_layer)->data);
110
111 const float diameter = 2.0f * la->radius;
112 matrix[0][0] = diameter;
113 matrix[1][1] = diameter;
114}
115
117 wmGizmoProperty *gz_prop,
118 const void *value_p)
119{
120 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
121 BLI_assert(gz_prop->type->array_length == 16);
122
123 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
124 Scene *scene = CTX_data_scene(C);
125 ViewLayer *view_layer = CTX_data_view_layer(C);
126 BKE_view_layer_synced_ensure(scene, view_layer);
127 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
128
129 const float radius = 0.5f * len_v3(matrix[0]);
130
131 PointerRNA light_ptr = RNA_pointer_create(&la->id, &RNA_Light, la);
132 PropertyRNA *radius_prop = RNA_struct_find_property(&light_ptr, "shadow_soft_size");
133 RNA_property_float_set(&light_ptr, radius_prop, radius);
134
135 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, radius_prop);
136}
137
139{
140 View3D *v3d = CTX_wm_view3d(C);
142 return false;
143 }
145 return false;
146 }
147
148 const Scene *scene = CTX_data_scene(C);
149 ViewLayer *view_layer = CTX_data_view_layer(C);
150 BKE_view_layer_synced_ensure(scene, view_layer);
151 Base *base = BKE_view_layer_active_base_get(view_layer);
152 if (base && BASE_SELECTABLE(v3d, base)) {
153 Object *ob = base->object;
154 if (ob->type == OB_LAMP) {
155 Light *la = static_cast<Light *>(ob->data);
156 return (la->type == LA_SPOT);
157 }
158 }
159 return false;
160}
161
163{
164 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(
165 MEM_mallocN(sizeof(LightSpotWidgetGroup), __func__));
166
167 gzgroup->customdata = ls_gzgroup;
168
169 /* Spot angle gizmo. */
170 {
171 ls_gzgroup->spot_angle = WM_gizmo_new("GIZMO_GT_arrow_3d", gzgroup, nullptr);
172 wmGizmo *gz = ls_gzgroup->spot_angle;
176 }
177
178 /* Spot blend gizmo. */
179 {
180 ls_gzgroup->spot_blend = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
181 wmGizmo *gz = ls_gzgroup->spot_blend;
182 RNA_enum_set(gz->ptr,
183 "transform",
189
193 params.range_get_fn = nullptr;
194 params.user_data = (void *)C;
196 }
197
198 /* Spot radius gizmo. */
199 {
200 ls_gzgroup->spot_radius = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
201 wmGizmo *gz = ls_gzgroup->spot_radius;
202 RNA_enum_set(gz->ptr,
203 "transform",
209
213 params.range_get_fn = nullptr;
214 params.user_data = (void *)C;
216 }
217
218 /* All gizmos must perform undo. */
219 LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
221 }
222}
223
225{
226 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
227 const Scene *scene = CTX_data_scene(C);
228 ViewLayer *view_layer = CTX_data_view_layer(C);
229 BKE_view_layer_synced_ensure(scene, view_layer);
231 Light *la = static_cast<Light *>(ob->data);
232
233 /* Spot angle gizmo. */
234 {
235 PointerRNA lamp_ptr = RNA_pointer_create(&la->id, &RNA_Light, la);
236
237 wmGizmo *gz = ls_gzgroup->spot_angle;
238 float dir[3];
239 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
241 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
242
243 const char *propname = "spot_size";
244 WM_gizmo_target_property_def_rna(gz, "offset", &lamp_ptr, propname, -1);
245 }
246
247 /* Spot blend gizmo. */
248 {
249 wmGizmo *gz = ls_gzgroup->spot_blend;
250
251 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
252
253 /* Move center to the cone base plane. */
254 float dir[3];
255 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
256 mul_v3_fl(dir, CONE_SCALE * cosf(0.5f * la->spotsize));
257 add_v3_v3(gz->matrix_basis[3], dir);
258 }
259}
260
262{
263 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
264 ViewLayer *view_layer = CTX_data_view_layer(C);
267
268 /* Spot radius gizmo. */
269 wmGizmo *gz = ls_gzgroup->spot_radius;
270
271 /* Draw circle in the screen space. */
272 RegionView3D *rv3d = static_cast<RegionView3D *>(CTX_wm_region(C)->regiondata);
274
275 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
276}
277
291
294/* -------------------------------------------------------------------- */
299{
300 const View3D *v3d = CTX_wm_view3d(C);
302 return false;
303 }
305 return false;
306 }
307
308 const Scene *scene = CTX_data_scene(C);
309 ViewLayer *view_layer = CTX_data_view_layer(C);
310 BKE_view_layer_synced_ensure(scene, view_layer);
311 const Base *base = BKE_view_layer_active_base_get(view_layer);
312 if (base && BASE_SELECTABLE(v3d, base)) {
313 const Object *ob = base->object;
314 if (ob->type == OB_LAMP) {
315 const Light *la = static_cast<const Light *>(ob->data);
316 return (la->type == LA_LOCAL);
317 }
318 }
319 return false;
320}
321
323{
324 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(
325 MEM_mallocN(sizeof(wmGizmoWrapper), __func__));
326 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
327 /* Point radius gizmo. */
328 wmGizmo *gz = wwrapper->gizmo;
329 gzgroup->customdata = wwrapper;
330
331 RNA_enum_set(gz->ptr,
332 "transform",
338
342 params.range_get_fn = nullptr;
343 params.user_data = (void *)C;
345
346 /* All gizmos must perform undo. */
347 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
349 }
350}
351
353{
354 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
355 ViewLayer *view_layer = CTX_data_view_layer(C);
357 const Object *ob = BKE_view_layer_active_object_get(view_layer);
358
359 /* Point radius gizmo. */
360 wmGizmo *gz = wwrapper->gizmo;
361
362 /* Draw circle in the screen space. */
363 const RegionView3D *rv3d = static_cast<const RegionView3D *>(CTX_wm_region(C)->regiondata);
365
366 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
367}
368
381
384/* -------------------------------------------------------------------- */
388/* scale callbacks */
389static void gizmo_area_light_prop_matrix_get(const wmGizmo * /*gz*/,
390 wmGizmoProperty *gz_prop,
391 void *value_p)
392{
393 BLI_assert(gz_prop->type->array_length == 16);
394 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
395 const Light *la = static_cast<const Light *>(gz_prop->custom_func.user_data);
396
397 matrix[0][0] = la->area_size;
398 matrix[1][1] = ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE) ? la->area_sizey :
399 la->area_size;
400}
401
402static void gizmo_area_light_prop_matrix_set(const wmGizmo * /*gz*/,
403 wmGizmoProperty *gz_prop,
404 const void *value_p)
405{
406 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
407 BLI_assert(gz_prop->type->array_length == 16);
408 Light *la = static_cast<Light *>(gz_prop->custom_func.user_data);
409
411 la->area_size = len_v3(matrix[0]);
412 la->area_sizey = len_v3(matrix[1]);
413 }
414 else {
415 la->area_size = len_v3(matrix[0]);
416 }
417
420}
421
423{
424 View3D *v3d = CTX_wm_view3d(C);
426 return false;
427 }
429 return false;
430 }
431
432 const Scene *scene = CTX_data_scene(C);
433 ViewLayer *view_layer = CTX_data_view_layer(C);
434 BKE_view_layer_synced_ensure(scene, view_layer);
435 Base *base = BKE_view_layer_active_base_get(view_layer);
436 if (base && BASE_SELECTABLE(v3d, base)) {
437 Object *ob = base->object;
438 if (ob->type == OB_LAMP) {
439 Light *la = static_cast<Light *>(ob->data);
440 return (la->type == LA_AREA);
441 }
442 }
443 return false;
444}
445
446static void WIDGETGROUP_light_area_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
447{
448 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(
449 MEM_mallocN(sizeof(wmGizmoWrapper), __func__));
450 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
451 wmGizmo *gz = wwrapper->gizmo;
453
454 gzgroup->customdata = wwrapper;
455
457
460
461 /* All gizmos must perform undo. */
462 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
464 }
465}
466
468{
469 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
470 const Scene *scene = CTX_data_scene(C);
471 ViewLayer *view_layer = CTX_data_view_layer(C);
472 BKE_view_layer_synced_ensure(scene, view_layer);
474 Light *la = static_cast<Light *>(ob->data);
475 wmGizmo *gz = wwrapper->gizmo;
476
477 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
478
482 }
483 RNA_enum_set(gz->ptr, "transform", flag);
484
485 /* need to set property here for undo. TODO: would prefer to do this in _init. */
489 params.range_get_fn = nullptr;
490 params.user_data = la;
492}
493
506
509/* -------------------------------------------------------------------- */
514{
515 View3D *v3d = CTX_wm_view3d(C);
517 return false;
518 }
520 return false;
521 }
522
523 const Scene *scene = CTX_data_scene(C);
524 ViewLayer *view_layer = CTX_data_view_layer(C);
525 BKE_view_layer_synced_ensure(scene, view_layer);
526 Base *base = BKE_view_layer_active_base_get(view_layer);
527 if (base && BASE_SELECTABLE(v3d, base)) {
528 Object *ob = base->object;
529 if (ob->type == OB_LAMP) {
530 Light *la = static_cast<Light *>(ob->data);
531 return ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA);
532 }
533#if 0
534 else if (ob->type == OB_CAMERA) {
535 return true;
536 }
537#endif
538 }
539 return false;
540}
541
542static void WIDGETGROUP_light_target_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
543{
544 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(
545 MEM_mallocN(sizeof(wmGizmoWrapper), __func__));
546 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, nullptr);
547 wmGizmo *gz = wwrapper->gizmo;
548
549 gzgroup->customdata = wwrapper;
550
553
554 gz->scale_basis = 0.06f;
555
556 wmOperatorType *ot = WM_operatortype_find("OBJECT_OT_transform_axis_target", true);
557
560
561 WM_gizmo_operator_set(gz, 0, ot, nullptr);
562
563 /* The operator handles undo, no need to set #WM_GIZMO_NEEDS_UNDO. */
564}
565
567{
568 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
569 const Scene *scene = CTX_data_scene(C);
570 ViewLayer *view_layer = CTX_data_view_layer(C);
571 BKE_view_layer_synced_ensure(scene, view_layer);
573 wmGizmo *gz = wwrapper->gizmo;
574
575 normalize_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
577
578 if (ob->type == OB_LAMP) {
579 Light *la = static_cast<Light *>(ob->data);
580 if (la->type == LA_SPOT) {
581 /* Draw just past the light size angle gizmo. */
582 madd_v3_v3fl(gz->matrix_basis[3], gz->matrix_basis[2], -la->spotsize);
583 }
584 }
585 gz->matrix_offset[3][2] -= 23.0;
587}
588
590{
591 gzgt->name = "Target Light Widgets";
592 gzgt->idname = "VIEW3D_GGT_light_target";
593
595
600}
601
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
Base * BKE_view_layer_active_base_get(ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
#define BLI_assert(a)
Definition BLI_assert.h:50
sqrt(x)+1/max(0
#define LISTBASE_FOREACH(type, var, list)
MINLINE float clamp_f(float value, float min, float max)
MINLINE float safe_divide(float a, float b)
void normalize_m4_m4(float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
void unit_m4(float m[4][4])
Definition rct.c:1127
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define ELEM(...)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_PARAMETERS
Definition DNA_ID.h:1105
@ LA_AREA
@ LA_LOCAL
@ LA_SPOT
@ LA_SUN
@ LA_AREA_ELLIPSE
@ LA_AREA_SQUARE
@ LA_AREA_RECT
@ LA_AREA_DISK
Object is a sort of wrapper for general info.
@ OB_CAMERA
@ OB_LAMP
#define BASE_SELECTABLE(v3d, base)
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL
@ ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW
@ ED_GIZMO_CAGE2D_STYLE_CIRCLE
@ ED_GIZMO_ARROW_XFORM_FLAG_INVERTED
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE_UNIFORM
Read Guarded memory(de)allocation.
void UI_GetThemeColor3fv(int colorid, float col[3])
@ TH_GIZMO_HI
@ TH_GIZMO_PRIMARY
@ TH_GIZMO_SECONDARY
@ WM_GIZMO_NEEDS_UNDO
@ WM_GIZMO_DRAW_HOVER
@ WM_GIZMO_DRAW_OFFSET_SCALE
@ WM_GIZMOGROUPTYPE_DEPTH_3D
@ WM_GIZMOGROUPTYPE_3D
@ WM_GIZMOGROUPTYPE_PERSISTENT
#define ND_LIGHTING_DRAW
Definition WM_types.hh:451
#define NC_LAMP
Definition WM_types.hh:349
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, const float range_fac)
local_group_size(16, 16) .push_constant(Type b
#define cosf(x)
#define sqrtf(x)
draw_view in_light_buf[] float
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
void * regiondata
struct Object * object
float area_sizey
short area_shape
float spotblend
float spotsize
float radius
float area_size
short type
float viewinv[4][4]
char gizmo_show_light
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
wmGizmoGroupFnDrawPrepare draw_prepare
const wmGizmoPropertyType * type
struct wmGizmoProperty::@1373 custom_func
float matrix_basis[4][4]
float matrix_offset[4][4]
float color_hi[4]
float color[4]
PointerRNA * ptr
float scale_basis
static void WIDGETGROUP_light_spot_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_light_target_poll(const bContext *C, wmGizmoGroupType *)
static void gizmo_light_radius_prop_matrix_set(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
static void WIDGETGROUP_light_target_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
void VIEW3D_GGT_light_spot(wmGizmoGroupType *gzgt)
static void gizmo_area_light_prop_matrix_get(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
static void WIDGETGROUP_light_point_setup(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_spot_blend_prop_matrix_set(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
static bool WIDGETGROUP_light_area_poll(const bContext *C, wmGizmoGroupType *)
static void WIDGETGROUP_light_area_setup(const bContext *, wmGizmoGroup *gzgroup)
static void gizmo_spot_blend_prop_matrix_get(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
static void WIDGETGROUP_light_area_refresh(const bContext *C, wmGizmoGroup *gzgroup)
void VIEW3D_GGT_light_area(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_light_spot_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_light_spot_poll(const bContext *C, wmGizmoGroupType *)
#define CONE_SCALE
static void WIDGETGROUP_light_spot_setup(const bContext *C, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_light_point_poll(const bContext *C, wmGizmoGroupType *)
static void WIDGETGROUP_light_target_setup(const bContext *, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_light_point_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
void VIEW3D_GGT_light_point(wmGizmoGroupType *gzgt)
static void gizmo_area_light_prop_matrix_set(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
#define INV_CONE_SCALE
static void gizmo_light_radius_prop_matrix_get(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
void VIEW3D_GGT_light_target(wmGizmoGroupType *gzgt)
void WM_main_add_notifier(uint type, void *reference)
wmOperatorType * ot
Definition wm_files.cc:4125
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:94
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition wm_gizmo.cc:283
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition wm_gizmo.cc:303
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
Definition wm_gizmo.cc:273
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
Definition wm_gizmo.cc:203
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *, wmKeyConfig *kc)
void WM_gizmo_target_property_def_rna(wmGizmo *gz, const char *idname, PointerRNA *ptr, const char *propname, int index)
void WM_gizmo_target_property_def_func(wmGizmo *gz, const char *idname, const wmGizmoPropertyFnParams *params)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
uint8_t flag
Definition wm_window.cc:138