29#include "RNA_prototypes.hh"
40#define CONE_SCALE 10.0f
41#define INV_CONE_SCALE 0.1f
54 float(*matrix)[4] =
static_cast<float(*)[4]
>(value_p);
64 float c = (1.0f - a) *
b + a;
66 float t =
sqrtf(1.0f - c * c) / c;
76 const float(*matrix)[4] =
static_cast<const float(*)[4]
>(value_p);
87 float c = 1.0f /
sqrt(t * t + 1.0f);
104 float(*matrix)[4] =
static_cast<float(*)[4]
>(value_p);
111 const float diameter = 2.0f * la->
radius;
112 matrix[0][0] = diameter;
113 matrix[1][1] = diameter;
120 const float(*matrix)[4] =
static_cast<const float(*)[4]
>(value_p);
129 const float radius = 0.5f *
len_v3(matrix[0]);
193 params.range_get_fn =
nullptr;
194 params.user_data = (
void *)C;
213 params.range_get_fn =
nullptr;
214 params.user_data = (
void *)C;
243 const char *propname =
"spot_size";
280 gzgt->
name =
"Spot Light Widgets";
281 gzgt->
idname =
"VIEW3D_GGT_light_spot";
342 params.range_get_fn =
nullptr;
343 params.user_data = (
void *)C;
371 gzgt->
name =
"Point Light Widgets";
372 gzgt->
idname =
"VIEW3D_GGT_light_point";
394 float(*matrix)[4] =
static_cast<float(*)[4]
>(value_p);
406 const float(*matrix)[4] =
static_cast<const float(*)[4]
>(value_p);
489 params.range_get_fn =
nullptr;
496 gzgt->
name =
"Area Light Widgets";
497 gzgt->
idname =
"VIEW3D_GGT_light_area";
591 gzgt->
name =
"Target Light Widgets";
592 gzgt->
idname =
"VIEW3D_GGT_light_target";
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 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])
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
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
#define BASE_SELECTABLE(v3d, base)
@ 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])
@ WM_GIZMO_DRAW_OFFSET_SCALE
@ WM_GIZMOGROUPTYPE_DEPTH_3D
@ WM_GIZMOGROUPTYPE_PERSISTENT
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, const float range_fac)
local_group_size(16, 16) .push_constant(Type b
draw_view in_light_buf[] float
void *(* MEM_mallocN)(size_t len, const char *str)
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)
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnDrawPrepare draw_prepare
const wmGizmoPropertyType * type
struct wmGizmoProperty::@1373 custom_func
float matrix_offset[4][4]
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 *)
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)
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)
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
void WM_gizmo_set_matrix_rotation_from_z_axis(wmGizmo *gz, const float z_axis[3])
PointerRNA * WM_gizmo_operator_set(wmGizmo *gz, int part_index, wmOperatorType *ot, IDProperty *properties)
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)