Blender V4.5
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
8
9#include "BLI_listbase.h"
10#include "BLI_math_base_safe.h"
11#include "BLI_math_matrix.h"
12#include "BLI_math_vector.h"
13#include "BLI_utildefines.h"
14
15#include "BKE_context.hh"
16#include "BKE_layer.hh"
17#include "BKE_lib_id.hh"
18
19#include "DEG_depsgraph.hh"
20
21#include "DNA_light_types.h"
22#include "DNA_object_types.h"
23
24#include "ED_gizmo_library.hh"
25
26#include "UI_resources.hh"
27
28#include "MEM_guardedalloc.h"
29
30#include "RNA_access.hh"
31#include "RNA_prototypes.hh"
32
33#include "WM_api.hh"
34#include "WM_types.hh"
35
36#include "view3d_intern.hh" /* own include */
37
38/* -------------------------------------------------------------------- */
41/* NOTE: scaling from `overlay_extra.cc`. */
42#define CONE_SCALE 10.0f
43#define INV_CONE_SCALE 0.1f
44
50
51static void gizmo_spot_blend_prop_matrix_get(const wmGizmo * /*gz*/,
52 wmGizmoProperty *gz_prop,
53 void *value_p)
54{
55 BLI_assert(gz_prop->type->array_length == 16);
56 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
57
58 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
59 ViewLayer *view_layer = CTX_data_view_layer(C);
61 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
62
63 float a = cosf(la->spotsize * 0.5f);
64 float b = la->spotblend;
65 /* Cosine of the angle where spot attenuation == 1. */
66 float c = (1.0f - a) * b + a;
67 /* Tangent. */
68 float t = sqrtf(1.0f - c * c) / c;
69
70 matrix[0][0] = 2.0f * CONE_SCALE * t * a;
71 matrix[1][1] = 2.0f * CONE_SCALE * t * a;
72}
73
74static void gizmo_spot_blend_prop_matrix_set(const wmGizmo * /*gz*/,
75 wmGizmoProperty *gz_prop,
76 const void *value_p)
77{
78 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
79 BLI_assert(gz_prop->type->array_length == 16);
80
81 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
82 Scene *scene = CTX_data_scene(C);
83 ViewLayer *view_layer = CTX_data_view_layer(C);
84 BKE_view_layer_synced_ensure(scene, view_layer);
85 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
86
87 float a = cosf(la->spotsize * 0.5f);
88 float t = matrix[0][0] * 0.5f * INV_CONE_SCALE / a;
89 float c = 1.0f / sqrt(t * t + 1.0f);
90
91 float spot_blend = safe_divide(clamp_f(c - a, 0.0f, 1.0f - a), 1.0f - a);
92
93 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
94 PropertyRNA *spot_blend_prop = RNA_struct_find_property(&light_ptr, "spot_blend");
95 RNA_property_float_set(&light_ptr, spot_blend_prop, spot_blend);
96
97 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, spot_blend_prop);
98}
99
100/* Used by spot light and point light. */
102 wmGizmoProperty *gz_prop,
103 void *value_p)
104{
105 BLI_assert(gz_prop->type->array_length == 16);
106 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
107
108 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
109 ViewLayer *view_layer = CTX_data_view_layer(C);
111 const Light *la = static_cast<const Light *>(BKE_view_layer_active_object_get(view_layer)->data);
112
113 const float diameter = 2.0f * la->radius;
114 matrix[0][0] = diameter;
115 matrix[1][1] = diameter;
116}
117
119 wmGizmoProperty *gz_prop,
120 const void *value_p)
121{
122 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
123 BLI_assert(gz_prop->type->array_length == 16);
124
125 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
126 Scene *scene = CTX_data_scene(C);
127 ViewLayer *view_layer = CTX_data_view_layer(C);
128 BKE_view_layer_synced_ensure(scene, view_layer);
129 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
130
131 const float radius = 0.5f * len_v3(matrix[0]);
132
133 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
134 PropertyRNA *radius_prop = RNA_struct_find_property(&light_ptr, "shadow_soft_size");
135 RNA_property_float_set(&light_ptr, radius_prop, radius);
136
137 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, radius_prop);
138}
139
141{
142 View3D *v3d = CTX_wm_view3d(C);
144 return false;
145 }
147 return false;
148 }
149
150 const Scene *scene = CTX_data_scene(C);
151 ViewLayer *view_layer = CTX_data_view_layer(C);
152 BKE_view_layer_synced_ensure(scene, view_layer);
153 Base *base = BKE_view_layer_active_base_get(view_layer);
154 if (base && BASE_SELECTABLE(v3d, base)) {
155 const Object *ob = base->object;
156 if (ob->type == OB_LAMP) {
157 const Light *la = static_cast<Light *>(ob->data);
158 if (la->type == LA_SPOT) {
159 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
160 return true;
161 }
162 }
163 }
164 }
165 return false;
166}
167
169{
171
172 gzgroup->customdata = ls_gzgroup;
173
174 /* Spot angle gizmo. */
175 {
176 ls_gzgroup->spot_angle = WM_gizmo_new("GIZMO_GT_arrow_3d", gzgroup, nullptr);
177 wmGizmo *gz = ls_gzgroup->spot_angle;
181 }
182
183 /* Spot blend gizmo. */
184 {
185 ls_gzgroup->spot_blend = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
186 wmGizmo *gz = ls_gzgroup->spot_blend;
187 RNA_enum_set(gz->ptr,
188 "transform",
194
198 params.range_get_fn = nullptr;
199 params.user_data = (void *)C;
201 }
202
203 /* Spot radius gizmo. */
204 {
205 ls_gzgroup->spot_radius = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
206 wmGizmo *gz = ls_gzgroup->spot_radius;
207 RNA_enum_set(gz->ptr,
208 "transform",
214
218 params.range_get_fn = nullptr;
219 params.user_data = (void *)C;
221 }
222
223 /* All gizmos must perform undo. */
224 LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
226 }
227}
228
230{
231 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
232 const Scene *scene = CTX_data_scene(C);
233 ViewLayer *view_layer = CTX_data_view_layer(C);
234 BKE_view_layer_synced_ensure(scene, view_layer);
236 Light *la = static_cast<Light *>(ob->data);
237
238 /* Spot angle gizmo. */
239 {
240 PointerRNA lamp_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
241
242 wmGizmo *gz = ls_gzgroup->spot_angle;
243 float dir[3];
244 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
246 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
247
248 const char *propname = "spot_size";
249 WM_gizmo_target_property_def_rna(gz, "offset", &lamp_ptr, propname, -1);
250 }
251
252 /* Spot blend gizmo. */
253 {
254 wmGizmo *gz = ls_gzgroup->spot_blend;
255
256 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
257
258 /* Move center to the cone base plane. */
259 float dir[3];
260 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
261 mul_v3_fl(dir, CONE_SCALE * cosf(0.5f * la->spotsize));
262 add_v3_v3(gz->matrix_basis[3], dir);
263 }
264}
265
267{
268 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
269 ViewLayer *view_layer = CTX_data_view_layer(C);
272
273 /* Spot radius gizmo. */
274 wmGizmo *gz = ls_gzgroup->spot_radius;
275
276 /* Draw circle in the screen space. */
277 RegionView3D *rv3d = static_cast<RegionView3D *>(CTX_wm_region(C)->regiondata);
279
280 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
281}
282
296
298
299/* -------------------------------------------------------------------- */
302
304{
305 const View3D *v3d = CTX_wm_view3d(C);
307 return false;
308 }
310 return false;
311 }
312
313 const Scene *scene = CTX_data_scene(C);
314 ViewLayer *view_layer = CTX_data_view_layer(C);
315 BKE_view_layer_synced_ensure(scene, view_layer);
316 const Base *base = BKE_view_layer_active_base_get(view_layer);
317 if (base && BASE_SELECTABLE(v3d, base)) {
318 const Object *ob = base->object;
319 if (ob->type == OB_LAMP) {
320 const Light *la = static_cast<const Light *>(ob->data);
321 if (la->type == LA_LOCAL) {
322 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
323 return true;
324 }
325 }
326 }
327 }
328 return false;
329}
330
332{
333 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
334 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
335 /* Point radius gizmo. */
336 wmGizmo *gz = wwrapper->gizmo;
337 gzgroup->customdata = wwrapper;
338
339 RNA_enum_set(gz->ptr,
340 "transform",
346
350 params.range_get_fn = nullptr;
351 params.user_data = (void *)C;
353
354 /* All gizmos must perform undo. */
355 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
357 }
358}
359
361{
362 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
363 ViewLayer *view_layer = CTX_data_view_layer(C);
365 const Object *ob = BKE_view_layer_active_object_get(view_layer);
366
367 /* Point radius gizmo. */
368 wmGizmo *gz = wwrapper->gizmo;
369
370 /* Draw circle in the screen space. */
371 const RegionView3D *rv3d = static_cast<const RegionView3D *>(CTX_wm_region(C)->regiondata);
373
374 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
375}
376
389
391
392/* -------------------------------------------------------------------- */
395
396/* scale callbacks */
397static void gizmo_area_light_prop_matrix_get(const wmGizmo * /*gz*/,
398 wmGizmoProperty *gz_prop,
399 void *value_p)
400{
401 BLI_assert(gz_prop->type->array_length == 16);
402 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
403 const Light *la = static_cast<const Light *>(gz_prop->custom_func.user_data);
404
405 matrix[0][0] = la->area_size;
406 matrix[1][1] = ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE) ? la->area_sizey :
407 la->area_size;
408}
409
410static void gizmo_area_light_prop_matrix_set(const wmGizmo * /*gz*/,
411 wmGizmoProperty *gz_prop,
412 const void *value_p)
413{
414 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
415 BLI_assert(gz_prop->type->array_length == 16);
416 Light *la = static_cast<Light *>(gz_prop->custom_func.user_data);
417
419 la->area_size = len_v3(matrix[0]);
420 la->area_sizey = len_v3(matrix[1]);
421 }
422 else {
423 la->area_size = len_v3(matrix[0]);
424 }
425
428}
429
431{
432 View3D *v3d = CTX_wm_view3d(C);
434 return false;
435 }
437 return false;
438 }
439
440 const Scene *scene = CTX_data_scene(C);
441 ViewLayer *view_layer = CTX_data_view_layer(C);
442 BKE_view_layer_synced_ensure(scene, view_layer);
443 Base *base = BKE_view_layer_active_base_get(view_layer);
444 if (base && BASE_SELECTABLE(v3d, base)) {
445 const Object *ob = base->object;
446 if (ob->type == OB_LAMP) {
447 const Light *la = static_cast<Light *>(ob->data);
448 if (la->type == LA_AREA) {
449 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
450 return true;
451 }
452 }
453 }
454 }
455 return false;
456}
457
458static void WIDGETGROUP_light_area_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
459{
460 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
461 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
462 wmGizmo *gz = wwrapper->gizmo;
464
465 gzgroup->customdata = wwrapper;
466
468
471
472 /* All gizmos must perform undo. */
473 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
475 }
476}
477
479{
480 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
481 const Scene *scene = CTX_data_scene(C);
482 ViewLayer *view_layer = CTX_data_view_layer(C);
483 BKE_view_layer_synced_ensure(scene, view_layer);
485 Light *la = static_cast<Light *>(ob->data);
486 wmGizmo *gz = wwrapper->gizmo;
487
488 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
489
493 }
494 RNA_enum_set(gz->ptr, "transform", flag);
495
496 /* need to set property here for undo. TODO: would prefer to do this in _init. */
500 params.range_get_fn = nullptr;
501 params.user_data = la;
503}
504
517
519
520/* -------------------------------------------------------------------- */
523
525{
526 View3D *v3d = CTX_wm_view3d(C);
528 return false;
529 }
531 return false;
532 }
533
534 const Scene *scene = CTX_data_scene(C);
535 ViewLayer *view_layer = CTX_data_view_layer(C);
536 BKE_view_layer_synced_ensure(scene, view_layer);
537 Base *base = BKE_view_layer_active_base_get(view_layer);
538 if (base && BASE_SELECTABLE(v3d, base)) {
539 const Object *ob = base->object;
540 if (BKE_id_is_editable(CTX_data_main(C), &ob->id)) {
541 if (ob->type == OB_LAMP) {
542 /* No need to check the light is editable, only the object is transformed. */
543 const Light *la = static_cast<Light *>(ob->data);
544 if (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA)) {
545 return true;
546 }
547 }
548#if 0
549 else if (ob->type == OB_CAMERA) {
550 return true;
551 }
552#endif
553 }
554 }
555 return false;
556}
557
558static void WIDGETGROUP_light_target_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
559{
560 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
561 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, nullptr);
562 wmGizmo *gz = wwrapper->gizmo;
563
564 gzgroup->customdata = wwrapper;
565
568
569 gz->scale_basis = 0.06f;
570
571 wmOperatorType *ot = WM_operatortype_find("OBJECT_OT_transform_axis_target", true);
572
575
576 WM_gizmo_operator_set(gz, 0, ot, nullptr);
577
578 /* The operator handles undo, no need to set #WM_GIZMO_NEEDS_UNDO. */
579}
580
582{
583 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
584 const Scene *scene = CTX_data_scene(C);
585 ViewLayer *view_layer = CTX_data_view_layer(C);
586 BKE_view_layer_synced_ensure(scene, view_layer);
588 wmGizmo *gz = wwrapper->gizmo;
589
590 normalize_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
592
593 if (ob->type == OB_LAMP) {
594 Light *la = static_cast<Light *>(ob->data);
595 if (la->type == LA_SPOT) {
596 /* Draw just past the light size angle gizmo. */
597 madd_v3_v3fl(gz->matrix_basis[3], gz->matrix_basis[2], -la->spotsize);
598 }
599 }
600 gz->matrix_offset[3][2] -= 23.0;
602}
603
605{
606 gzgt->name = "Target Light Widgets";
607 gzgt->idname = "VIEW3D_GGT_light_target";
608
610
615}
616
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)
bool BKE_id_is_editable(const Main *bmain, const ID *id)
Definition lib_id.cc:2503
#define BLI_assert(a)
Definition BLI_assert.h:46
#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 copy_m4_m4(float m1[4][4], const float m2[4][4])
void unit_m4(float m[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:1046
@ 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_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE_UNIFORM
@ ED_GIZMO_ARROW_XFORM_FLAG_INVERTED
@ ED_GIZMO_CAGE2D_STYLE_CIRCLE
@ ED_GIZMO_MOVE_DRAW_FLAG_FILL
@ ED_GIZMO_MOVE_DRAW_FLAG_ALIGN_VIEW
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
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:481
#define NC_LAMP
Definition WM_types.hh:379
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, const float range_fac)
#define cosf(x)
#define sqrtf(x)
#define sqrt
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
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_discrete(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
struct wmGizmoProperty::@046017364211037167053011312355256221126135017103 custom_func
const wmGizmoPropertyType * type
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:4225
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition wm_gizmo.cc:286
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition wm_gizmo.cc:306
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
Definition wm_gizmo.cc:276
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
Definition wm_gizmo.cc:203
wmGizmo * WM_gizmo_new(const StringRef idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:98
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:139