Blender V5.0
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
75 wmGizmoProperty *gz_prop,
76 const blender::FunctionRef<void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
77{
78 bContext *C = static_cast<bContext *>(gz_prop->custom_func.user_data);
79 Scene *scene = CTX_data_scene(C);
80 ViewLayer *view_layer = CTX_data_view_layer(C);
81 BKE_view_layer_synced_ensure(scene, view_layer);
82 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
83 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
84 PropertyRNA *spot_blend_prop = RNA_struct_find_property(&light_ptr, "spot_blend");
85
86 callback(light_ptr, spot_blend_prop, 0);
87}
88
89static void gizmo_spot_blend_prop_matrix_set(const wmGizmo * /*gz*/,
90 wmGizmoProperty *gz_prop,
91 const void *value_p)
92{
93 const float (*matrix)[4] = static_cast<const float (*)[4]>(value_p);
94 BLI_assert(gz_prop->type->array_length == 16);
95
96 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
97 Scene *scene = CTX_data_scene(C);
98 ViewLayer *view_layer = CTX_data_view_layer(C);
99 BKE_view_layer_synced_ensure(scene, view_layer);
100 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
101
102 float a = cosf(la->spotsize * 0.5f);
103 float t = matrix[0][0] * 0.5f * INV_CONE_SCALE / a;
104 float c = 1.0f / sqrt(t * t + 1.0f);
105
106 float spot_blend = safe_divide(clamp_f(c - a, 0.0f, 1.0f - a), 1.0f - a);
107
108 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
109 PropertyRNA *spot_blend_prop = RNA_struct_find_property(&light_ptr, "spot_blend");
110 RNA_property_float_set(&light_ptr, spot_blend_prop, spot_blend);
111
112 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, spot_blend_prop);
113}
114
115/* Used by spot light and point light. */
117 wmGizmoProperty *gz_prop,
118 const blender::FunctionRef<void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
119{
120 bContext *C = static_cast<bContext *>(gz_prop->custom_func.user_data);
121 Scene *scene = CTX_data_scene(C);
122 ViewLayer *view_layer = CTX_data_view_layer(C);
123 BKE_view_layer_synced_ensure(scene, view_layer);
124 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
125 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
126 PropertyRNA *radius_prop = RNA_struct_find_property(&light_ptr, "shadow_soft_size");
127
128 callback(light_ptr, radius_prop, 0);
129}
130
132 wmGizmoProperty *gz_prop,
133 void *value_p)
134{
135 BLI_assert(gz_prop->type->array_length == 16);
136 float (*matrix)[4] = static_cast<float (*)[4]>(value_p);
137
138 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
139 ViewLayer *view_layer = CTX_data_view_layer(C);
141 const Light *la = static_cast<const Light *>(BKE_view_layer_active_object_get(view_layer)->data);
142
143 const float diameter = 2.0f * la->radius;
144 matrix[0][0] = diameter;
145 matrix[1][1] = diameter;
146}
147
149 wmGizmoProperty *gz_prop,
150 const void *value_p)
151{
152 const float (*matrix)[4] = static_cast<const float (*)[4]>(value_p);
153 BLI_assert(gz_prop->type->array_length == 16);
154
155 const bContext *C = static_cast<const bContext *>(gz_prop->custom_func.user_data);
156 Scene *scene = CTX_data_scene(C);
157 ViewLayer *view_layer = CTX_data_view_layer(C);
158 BKE_view_layer_synced_ensure(scene, view_layer);
159 Light *la = static_cast<Light *>(BKE_view_layer_active_object_get(view_layer)->data);
160
161 const float radius = 0.5f * len_v3(matrix[0]);
162
163 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
164 PropertyRNA *radius_prop = RNA_struct_find_property(&light_ptr, "shadow_soft_size");
165 RNA_property_float_set(&light_ptr, radius_prop, radius);
166
167 RNA_property_update_main(CTX_data_main(C), scene, &light_ptr, radius_prop);
168}
169
171{
172 View3D *v3d = CTX_wm_view3d(C);
174 return false;
175 }
177 return false;
178 }
179
180 const Scene *scene = CTX_data_scene(C);
181 ViewLayer *view_layer = CTX_data_view_layer(C);
182 BKE_view_layer_synced_ensure(scene, view_layer);
183 Base *base = BKE_view_layer_active_base_get(view_layer);
184 if (base && BASE_SELECTABLE(v3d, base)) {
185 const Object *ob = base->object;
186 if (ob->type == OB_LAMP) {
187 const Light *la = static_cast<Light *>(ob->data);
188 if (la->type == LA_SPOT) {
189 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
190 return true;
191 }
192 }
193 }
194 }
195 return false;
196}
197
199{
201
202 gzgroup->customdata = ls_gzgroup;
203
204 /* Spot angle gizmo. */
205 {
206 ls_gzgroup->spot_angle = WM_gizmo_new("GIZMO_GT_arrow_3d", gzgroup, nullptr);
207 wmGizmo *gz = ls_gzgroup->spot_angle;
211 }
212
213 /* Spot blend gizmo. */
214 {
215 ls_gzgroup->spot_blend = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
216 wmGizmo *gz = ls_gzgroup->spot_blend;
217 RNA_enum_set(gz->ptr,
218 "transform",
224
228 params.range_get_fn = nullptr;
229 params.foreach_rna_prop_fn = gizmo_spot_blend_foreach_rna_prop;
230 params.user_data = (void *)C;
232 }
233
234 /* Spot radius gizmo. */
235 {
236 ls_gzgroup->spot_radius = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
237 wmGizmo *gz = ls_gzgroup->spot_radius;
238 RNA_enum_set(gz->ptr,
239 "transform",
245
249 params.range_get_fn = nullptr;
250 params.foreach_rna_prop_fn = gizmo_light_radius_foreach_rna_prop;
251 params.user_data = (void *)C;
253 }
254
255 /* All gizmos must perform undo. */
256 LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
258 }
259}
260
262{
263 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
264 const Scene *scene = CTX_data_scene(C);
265 ViewLayer *view_layer = CTX_data_view_layer(C);
266 BKE_view_layer_synced_ensure(scene, view_layer);
268 Light *la = static_cast<Light *>(ob->data);
269
270 /* Spot angle gizmo. */
271 {
272 PointerRNA lamp_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
273
274 wmGizmo *gz = ls_gzgroup->spot_angle;
275 float dir[3];
276 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
278 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
279
280 const char *propname = "spot_size";
281 WM_gizmo_target_property_def_rna(gz, "offset", &lamp_ptr, propname, -1);
282 }
283
284 /* Spot blend gizmo. */
285 {
286 wmGizmo *gz = ls_gzgroup->spot_blend;
287
288 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
289
290 /* Move center to the cone base plane. */
291 float dir[3];
292 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
293 mul_v3_fl(dir, CONE_SCALE * cosf(0.5f * la->spotsize));
294 add_v3_v3(gz->matrix_basis[3], dir);
295 }
296}
297
299{
300 LightSpotWidgetGroup *ls_gzgroup = static_cast<LightSpotWidgetGroup *>(gzgroup->customdata);
301 ViewLayer *view_layer = CTX_data_view_layer(C);
304
305 /* Spot radius gizmo. */
306 wmGizmo *gz = ls_gzgroup->spot_radius;
307
308 /* Draw circle in the screen space. */
309 RegionView3D *rv3d = static_cast<RegionView3D *>(CTX_wm_region(C)->regiondata);
311
312 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
313}
314
328
330
331/* -------------------------------------------------------------------- */
334
336{
337 const View3D *v3d = CTX_wm_view3d(C);
339 return false;
340 }
342 return false;
343 }
344
345 const Scene *scene = CTX_data_scene(C);
346 ViewLayer *view_layer = CTX_data_view_layer(C);
347 BKE_view_layer_synced_ensure(scene, view_layer);
348 const Base *base = BKE_view_layer_active_base_get(view_layer);
349 if (base && BASE_SELECTABLE(v3d, base)) {
350 const Object *ob = base->object;
351 if (ob->type == OB_LAMP) {
352 const Light *la = static_cast<const Light *>(ob->data);
353 if (la->type == LA_LOCAL) {
354 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
355 return true;
356 }
357 }
358 }
359 }
360 return false;
361}
362
364{
365 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
366 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
367 /* Point radius gizmo. */
368 wmGizmo *gz = wwrapper->gizmo;
369 gzgroup->customdata = wwrapper;
370
371 RNA_enum_set(gz->ptr,
372 "transform",
378
382 params.range_get_fn = nullptr;
383 params.foreach_rna_prop_fn = gizmo_light_radius_foreach_rna_prop;
384 params.user_data = (void *)C;
386
387 /* All gizmos must perform undo. */
388 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
390 }
391}
392
394{
395 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
396 ViewLayer *view_layer = CTX_data_view_layer(C);
398 const Object *ob = BKE_view_layer_active_object_get(view_layer);
399
400 /* Point radius gizmo. */
401 wmGizmo *gz = wwrapper->gizmo;
402
403 /* Draw circle in the screen space. */
404 const RegionView3D *rv3d = static_cast<const RegionView3D *>(CTX_wm_region(C)->regiondata);
406
407 WM_gizmo_set_matrix_location(gz, ob->object_to_world().location());
408}
409
422
424
425/* -------------------------------------------------------------------- */
428
429/* scale callbacks */
430
432 wmGizmoProperty *gz_prop,
433 const blender::FunctionRef<void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
434{
435 Light *la = static_cast<Light *>(gz_prop->custom_func.user_data);
436 PointerRNA light_ptr = RNA_pointer_create_discrete(&la->id, &RNA_Light, la);
437
438 PropertyRNA *area_size_prop = RNA_struct_find_property(&light_ptr, "size");
439 callback(light_ptr, area_size_prop, 0);
440
442 area_size_prop = RNA_struct_find_property(&light_ptr, "size_y");
443 callback(light_ptr, area_size_prop, 0);
444 }
445}
446
447static void gizmo_area_light_prop_matrix_get(const wmGizmo * /*gz*/,
448 wmGizmoProperty *gz_prop,
449 void *value_p)
450{
451 BLI_assert(gz_prop->type->array_length == 16);
452 float (*matrix)[4] = static_cast<float (*)[4]>(value_p);
453 const Light *la = static_cast<const Light *>(gz_prop->custom_func.user_data);
454
455 matrix[0][0] = la->area_size;
456 matrix[1][1] = ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE) ? la->area_sizey :
457 la->area_size;
458}
459
460static void gizmo_area_light_prop_matrix_set(const wmGizmo * /*gz*/,
461 wmGizmoProperty *gz_prop,
462 const void *value_p)
463{
464 const float (*matrix)[4] = static_cast<const float (*)[4]>(value_p);
465 BLI_assert(gz_prop->type->array_length == 16);
466 Light *la = static_cast<Light *>(gz_prop->custom_func.user_data);
467
469 la->area_size = len_v3(matrix[0]);
470 la->area_sizey = len_v3(matrix[1]);
471 }
472 else {
473 la->area_size = len_v3(matrix[0]);
474 }
475
478}
479
481{
482 View3D *v3d = CTX_wm_view3d(C);
484 return false;
485 }
487 return false;
488 }
489
490 const Scene *scene = CTX_data_scene(C);
491 ViewLayer *view_layer = CTX_data_view_layer(C);
492 BKE_view_layer_synced_ensure(scene, view_layer);
493 Base *base = BKE_view_layer_active_base_get(view_layer);
494 if (base && BASE_SELECTABLE(v3d, base)) {
495 const Object *ob = base->object;
496 if (ob->type == OB_LAMP) {
497 const Light *la = static_cast<Light *>(ob->data);
498 if (la->type == LA_AREA) {
499 if (BKE_id_is_editable(CTX_data_main(C), &la->id)) {
500 return true;
501 }
502 }
503 }
504 }
505 return false;
506}
507
508static void WIDGETGROUP_light_area_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
509{
510 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
511 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
512 wmGizmo *gz = wwrapper->gizmo;
514
515 gzgroup->customdata = wwrapper;
516
518
521
522 /* All gizmos must perform undo. */
523 LISTBASE_FOREACH (wmGizmo *, gz_iter, &gzgroup->gizmos) {
525 }
526}
527
529{
530 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
531 const Scene *scene = CTX_data_scene(C);
532 ViewLayer *view_layer = CTX_data_view_layer(C);
533 BKE_view_layer_synced_ensure(scene, view_layer);
535 Light *la = static_cast<Light *>(ob->data);
536 wmGizmo *gz = wwrapper->gizmo;
537
538 copy_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
539
543 }
544 RNA_enum_set(gz->ptr, "transform", flag);
545
546 /* need to set property here for undo. TODO: would prefer to do this in _init. */
550 params.range_get_fn = nullptr;
551 params.foreach_rna_prop_fn = gizmo_area_light_foreach_rna_prop;
552 params.user_data = la;
554}
555
568
570
571/* -------------------------------------------------------------------- */
574
576{
577 View3D *v3d = CTX_wm_view3d(C);
579 return false;
580 }
582 return false;
583 }
584
585 const Scene *scene = CTX_data_scene(C);
586 ViewLayer *view_layer = CTX_data_view_layer(C);
587 BKE_view_layer_synced_ensure(scene, view_layer);
588 Base *base = BKE_view_layer_active_base_get(view_layer);
589 if (base && BASE_SELECTABLE(v3d, base)) {
590 const Object *ob = base->object;
591 if (BKE_id_is_editable(CTX_data_main(C), &ob->id)) {
592 if (ob->type == OB_LAMP) {
593 /* No need to check the light is editable, only the object is transformed. */
594 const Light *la = static_cast<Light *>(ob->data);
595 if (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA)) {
596 return true;
597 }
598 }
599#if 0
600 else if (ob->type == OB_CAMERA) {
601 return true;
602 }
603#endif
604 }
605 }
606 return false;
607}
608
609static void WIDGETGROUP_light_target_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
610{
611 wmGizmoWrapper *wwrapper = MEM_mallocN<wmGizmoWrapper>(__func__);
612 wwrapper->gizmo = WM_gizmo_new("GIZMO_GT_move_3d", gzgroup, nullptr);
613 wmGizmo *gz = wwrapper->gizmo;
614
615 gzgroup->customdata = wwrapper;
616
619
620 gz->scale_basis = 0.06f;
621
622 wmOperatorType *ot = WM_operatortype_find("OBJECT_OT_transform_axis_target", true);
623
626
627 WM_gizmo_operator_set(gz, 0, ot, nullptr);
628
629 /* The operator handles undo, no need to set #WM_GIZMO_NEEDS_UNDO. */
630}
631
633{
634 wmGizmoWrapper *wwrapper = static_cast<wmGizmoWrapper *>(gzgroup->customdata);
635 const Scene *scene = CTX_data_scene(C);
636 ViewLayer *view_layer = CTX_data_view_layer(C);
637 BKE_view_layer_synced_ensure(scene, view_layer);
639 wmGizmo *gz = wwrapper->gizmo;
640
641 normalize_m4_m4(gz->matrix_basis, ob->object_to_world().ptr());
643
644 if (ob->type == OB_LAMP) {
645 Light *la = static_cast<Light *>(ob->data);
646 if (la->type == LA_SPOT) {
647 /* Draw just past the light size angle gizmo. */
648 madd_v3_v3fl(gz->matrix_basis[3], gz->matrix_basis[2], -la->spotsize);
649 }
650 }
651 gz->matrix_offset[3][2] -= 23.0;
653}
654
656{
657 gzgt->name = "Target Light Widgets";
658 gzgt->idname = "VIEW3D_GGT_light_target";
659
661
666}
667
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:2523
#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:1138
@ 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_CAGE2D_STYLE_CIRCLE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE_UNIFORM
@ ED_GIZMO_ARROW_XFORM_FLAG_INVERTED
@ 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:484
#define NC_LAMP
Definition WM_types.hh:382
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, const float range_fac)
nullptr float
#define sqrt
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
#define sqrtf
#define cosf
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
const wmGizmoPropertyType * type
struct wmGizmoProperty::@331027022007232055216276241130041346111314317052 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 void gizmo_light_radius_foreach_rna_prop(wmGizmoProperty *gz_prop, const blender::FunctionRef< void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
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 gizmo_area_light_foreach_rna_prop(wmGizmoProperty *gz_prop, const blender::FunctionRef< void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
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)
static void gizmo_spot_blend_foreach_rna_prop(wmGizmoProperty *gz_prop, const blender::FunctionRef< void(PointerRNA &ptr, PropertyRNA *prop, int index)> callback)
#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)
PointerRNA * ptr
Definition wm_files.cc:4238
wmOperatorType * ot
Definition wm_files.cc:4237
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition wm_gizmo.cc:287
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition wm_gizmo.cc:307
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
Definition wm_gizmo.cc:277
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:145