Blender V5.0
view3d_gizmo_camera.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_matrix.h"
11#include "BLI_math_vector.h"
12#include "BLI_rect.h"
13#include "BLI_utildefines.h"
14
15#include "BKE_camera.h"
16#include "BKE_context.hh"
17#include "BKE_layer.hh"
18#include "BKE_lib_id.hh"
19
20#include "DNA_camera_types.h"
21#include "DNA_object_types.h"
22
23#include "ED_gizmo_library.hh"
24#include "ED_screen.hh"
25
26#include "UI_resources.hh"
27
28#include "MEM_guardedalloc.h"
29
30#include "RNA_access.hh"
31
32#include "WM_message.hh"
33#include "WM_types.hh"
34
35#include "DEG_depsgraph.hh"
36
37#include "view3d_intern.hh" /* own include */
38
39/* -------------------------------------------------------------------- */
42
48
49static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType * /*gzgt*/)
50{
51 View3D *v3d = CTX_wm_view3d(C);
53 return false;
54 }
57 {
58 return false;
59 }
60
61 const Scene *scene = CTX_data_scene(C);
62 ViewLayer *view_layer = CTX_data_view_layer(C);
63 BKE_view_layer_synced_ensure(scene, view_layer);
64 Base *base = BKE_view_layer_active_base_get(view_layer);
65 if (base && BASE_SELECTABLE(v3d, base)) {
66 Object *ob = base->object;
67 if (ob->type == OB_CAMERA) {
68 const Camera *camera = static_cast<Camera *>(ob->data);
69 /* TODO: support overrides. */
70 if (BKE_id_is_editable(CTX_data_main(C), &camera->id)) {
71 return true;
72 }
73 }
74 }
75 return false;
76}
77
78static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
79{
80 const Scene *scene = CTX_data_scene(C);
81 ViewLayer *view_layer = CTX_data_view_layer(C);
82 BKE_view_layer_synced_ensure(scene, view_layer);
84 float dir[3];
85
86 const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
87
89 gzgroup->customdata = cagzgroup;
90
91 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
92
93 /* dof distance */
94 {
95 wmGizmo *gz;
96 gz = cagzgroup->dop_dist = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
99
102 }
103
104 /* focal length
105 * - logic/calculations are similar to BKE_camera_view_frame_ex, better keep in sync */
106 {
107 wmGizmo *gz;
108 gz = cagzgroup->focal_len = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
110 RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
112
115
116 gz = cagzgroup->ortho_scale = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
118 RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
120
123 }
124
125 /* All gizmos must perform undo. */
126 LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
128 }
129}
130
132{
133 if (!gzgroup->customdata) {
134 return;
135 }
136
137 CameraWidgetGroup *cagzgroup = static_cast<CameraWidgetGroup *>(gzgroup->customdata);
138 View3D *v3d = CTX_wm_view3d(C);
139 const Scene *scene = CTX_data_scene(C);
140 ViewLayer *view_layer = CTX_data_view_layer(C);
141 BKE_view_layer_synced_ensure(scene, view_layer);
143 Camera *ca = static_cast<Camera *>(ob->data);
144 float dir[3];
145
146 PointerRNA camera_ptr = RNA_pointer_create_discrete(&ca->id, &RNA_Camera, ca);
147
148 const bool is_modal = WM_gizmo_group_is_modal(gzgroup);
149
150 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
151
153 WM_gizmo_set_matrix_location(cagzgroup->dop_dist, ob->object_to_world().location());
155 cagzgroup->dop_dist, ob->object_to_world().ptr()[1], dir);
156 WM_gizmo_set_scale(cagzgroup->dop_dist, ca->drawsize);
157 WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, false);
158
159 /* Need to set property here for undo. TODO: would prefer to do this in _init. */
161 &ca->id, &RNA_CameraDOFSettings, &ca->dof);
163 cagzgroup->dop_dist, "offset", &camera_dof_ptr, "focus_distance", -1);
164 }
165 else {
166 WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, true);
167 }
168
169 /* TODO: make focal length/ortho ob_scale_inv widget optional. */
170 const float aspx = float(scene->r.xsch) * scene->r.xasp;
171 const float aspy = float(scene->r.ysch) * scene->r.yasp;
172 const bool is_ortho = (ca->type == CAM_ORTHO);
173 const int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, aspx, aspy);
174 /* Important to use camera value, not calculated fit since 'AUTO' uses width always. */
175 const float sensor_size = BKE_camera_sensor_size(ca->sensor_fit, ca->sensor_x, ca->sensor_y);
176 wmGizmo *widget = is_ortho ? cagzgroup->ortho_scale : cagzgroup->focal_len;
177 float scale_matrix;
178 if (true) {
179 float offset[3];
180 float aspect[2];
181
182 WM_gizmo_set_flag(widget, WM_GIZMO_HIDDEN, false);
184 is_ortho ? cagzgroup->focal_len : cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
185
186 /* account for lens shifting */
187 offset[0] = ((ob->scale[0] > 0.0f) ? -2.0f : 2.0f) * ca->shiftx;
188 offset[1] = 2.0f * ca->shifty;
189 offset[2] = 0.0f;
190
191 /* get aspect */
192 aspect[0] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? 1.0f : aspx / aspy;
193 aspect[1] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? aspy / aspx : 1.0f;
194
195 unit_m4(widget->matrix_basis);
196 WM_gizmo_set_matrix_location(widget, ob->object_to_world().location());
197 WM_gizmo_set_matrix_rotation_from_yz_axis(widget, ob->object_to_world().ptr()[1], dir);
198
199 if (is_ortho) {
200 scale_matrix = ca->ortho_scale * 0.5f;
201 }
202 else {
203 const float ob_scale_inv[3] = {
204 1.0f / len_v3(ob->object_to_world().ptr()[0]),
205 1.0f / len_v3(ob->object_to_world().ptr()[1]),
206 1.0f / len_v3(ob->object_to_world().ptr()[2]),
207 };
208 const float ob_scale_uniform_inv = (ob_scale_inv[0] + ob_scale_inv[1] + ob_scale_inv[2]) /
209 3.0f;
210 scale_matrix = (ca->drawsize * 0.5f) / ob_scale_uniform_inv;
211 }
212 mul_v3_fl(widget->matrix_basis[0], scale_matrix);
213 mul_v3_fl(widget->matrix_basis[1], scale_matrix);
214
215 RNA_float_set_array(widget->ptr, "aspect", aspect);
216
218 }
219
220 /* Define & update properties.
221 *
222 * Check modal to prevent feedback loop for orthographic cameras,
223 * where the range is based on the scale, see: #141667. */
224 if (!is_modal) {
225 const char *propname = is_ortho ? "ortho_scale" : "lens";
226 PropertyRNA *prop = RNA_struct_find_property(&camera_ptr, propname);
227 const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(widget->type,
228 "offset");
229
230 WM_gizmo_target_property_clear_rna_ptr(widget, gz_prop_type);
231
232 float min, max, range;
233 float step, precision;
234
235 /* get property range */
236 RNA_property_float_ui_range(&camera_ptr, prop, &min, &max, &step, &precision);
237 range = max - min;
238
240 widget,
241 is_ortho ?
242 ((range / ca->ortho_scale) * ca->drawsize) :
243 (scale_matrix * range /
244 /* Half sensor, intentionally use sensor from camera and not calculated above. */
245 (0.5f * sensor_size)));
246
247 WM_gizmo_target_property_def_rna_ptr(widget, gz_prop_type, &camera_ptr, prop, -1);
248 }
249
250 /* This could be handled more elegantly (split into two gizmo groups). */
254 }
255}
256
258 wmGizmoGroup *gzgroup,
259 wmMsgBus *mbus)
260{
261 ARegion *region = CTX_wm_region(C);
262 const Scene *scene = CTX_data_scene(C);
263 ViewLayer *view_layer = CTX_data_view_layer(C);
264 BKE_view_layer_synced_ensure(scene, view_layer);
266 Camera *ca = static_cast<Camera *>(ob->data);
267
268 wmMsgSubscribeValue msg_sub_value_gz_tag_refresh{};
269 msg_sub_value_gz_tag_refresh.owner = region;
270 msg_sub_value_gz_tag_refresh.user_data = gzgroup->parent_gzmap;
271 msg_sub_value_gz_tag_refresh.notify = WM_gizmo_do_msg_notify_tag_refresh;
272
273 {
274 const PropertyRNA *props[] = {
275 &rna_CameraDOFSettings_focus_distance,
276 &rna_Camera_display_size,
277 &rna_Camera_ortho_scale,
278 &rna_Camera_sensor_fit,
279 &rna_Camera_sensor_width,
280 &rna_Camera_sensor_height,
281 &rna_Camera_shift_x,
282 &rna_Camera_shift_y,
283 &rna_Camera_type,
284 &rna_Camera_lens,
285 };
286
287 PointerRNA idptr = RNA_id_pointer_create(&ca->id);
288
289 for (int i = 0; i < ARRAY_SIZE(props); i++) {
290 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
291 }
292 }
293
294 /* Subscribe to render settings */
295 {
297 mbus, RenderSettings, resolution_x, &msg_sub_value_gz_tag_refresh);
299 mbus, RenderSettings, resolution_y, &msg_sub_value_gz_tag_refresh);
301 mbus, RenderSettings, pixel_aspect_x, &msg_sub_value_gz_tag_refresh);
303 mbus, RenderSettings, pixel_aspect_y, &msg_sub_value_gz_tag_refresh);
304 }
305}
306
320
322
323/* -------------------------------------------------------------------- */
326
338
339/* scale callbacks */
341 wmGizmoProperty *gz_prop,
342 void *value_p)
343{
344 float (*matrix)[4] = static_cast<float (*)[4]>(value_p);
345 BLI_assert(gz_prop->type->array_length == 16);
346 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(
347 gz_prop->custom_func.user_data);
348 const rctf *border = viewgroup->state.edit_border;
349
350 unit_m4(matrix);
351 matrix[0][0] = BLI_rctf_size_x(border);
352 matrix[1][1] = BLI_rctf_size_y(border);
353 matrix[3][0] = BLI_rctf_cent_x(border);
354 matrix[3][1] = BLI_rctf_cent_y(border);
355}
356
358 wmGizmoProperty *gz_prop,
359 const void *value_p)
360{
361 const float (*matrix)[4] = static_cast<const float (*)[4]>(value_p);
362 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(
363 gz_prop->custom_func.user_data);
364 rctf *border = viewgroup->state.edit_border;
365 BLI_assert(gz_prop->type->array_length == 16);
366
367 rctf rect{};
368 rect.xmin = 0;
369 rect.ymin = 0;
370 rect.xmax = 1;
371 rect.ymax = 1;
372 BLI_rctf_resize(border, len_v3(matrix[0]), len_v3(matrix[1]));
373 BLI_rctf_recenter(border, matrix[3][0], matrix[3][1]);
374 BLI_rctf_isect(&rect, border, border);
375
376 if (viewgroup->is_camera) {
378 }
379}
380
382{
383 Scene *scene = CTX_data_scene(C);
384
385 /* This is just so the border isn't always in the way,
386 * stealing mouse clicks from regular usage.
387 * We could change the rules for when to show. */
388 {
389 ViewLayer *view_layer = CTX_data_view_layer(C);
390 BKE_view_layer_synced_ensure(scene, view_layer);
391 if (scene->camera != BKE_view_layer_active_object_get(view_layer)) {
392 return false;
393 }
394 }
395
396 View3D *v3d = CTX_wm_view3d(C);
398 return false;
399 }
400
401 ARegion *region = CTX_wm_region(C);
402 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
403 if (rv3d->persp == RV3D_CAMOB) {
404 if (scene->r.mode & R_BORDER) {
405 /* TODO: support overrides. */
406 if (BKE_id_is_editable(CTX_data_main(C), &scene->id)) {
407 return true;
408 }
409 }
410 }
411 else if (v3d->flag2 & V3D_RENDER_BORDER) {
412 return true;
413 }
414 return false;
415}
416
417static void WIDGETGROUP_camera_view_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
418{
420
421 viewgroup->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
422
423 RNA_enum_set(viewgroup->border->ptr,
424 "transform",
426 /* Box style is more subtle in this case. */
427 RNA_enum_set(viewgroup->border->ptr, "draw_style", ED_GIZMO_CAGE2D_STYLE_BOX);
428
429 WM_gizmo_set_scale(viewgroup->border, 10.0f / 0.15f);
430
431 gzgroup->customdata = viewgroup;
432
433 /* NOTE: #WM_GIZMO_NEEDS_UNDO is set on refresh and depends on modifying a camera object. */
434}
435
437{
438 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(gzgroup->customdata);
439
440 ARegion *region = CTX_wm_region(C);
441 /* Drawing code should happen with fully evaluated graph. */
443 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
444 if (rv3d->persp == RV3D_CAMOB) {
445 Scene *scene = CTX_data_scene(C);
446 View3D *v3d = CTX_wm_view3d(C);
448 scene, depsgraph, region, v3d, rv3d, false, &viewgroup->state.view_border);
449 }
450 else {
451 rctf rect{};
452 rect.xmin = 0;
453 rect.ymin = 0;
454 rect.xmax = region->winx;
455 rect.ymax = region->winy;
456 viewgroup->state.view_border = rect;
457 }
458
459 wmGizmo *gz = viewgroup->border;
463 gz->matrix_space[3][0] = viewgroup->state.view_border.xmin;
464 gz->matrix_space[3][1] = viewgroup->state.view_border.ymin;
465}
466
468{
469 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(gzgroup->customdata);
470
471 View3D *v3d = CTX_wm_view3d(C);
472 ARegion *region = CTX_wm_region(C);
473 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
474 Scene *scene = CTX_data_scene(C);
475
476 viewgroup->scene = scene;
477
478 {
479 wmGizmo *gz = viewgroup->border;
481
482 RNA_enum_set(viewgroup->border->ptr,
483 "transform",
485
486 if (rv3d->persp == RV3D_CAMOB) {
487 viewgroup->state.edit_border = &scene->r.border;
488 viewgroup->is_camera = true;
489 }
490 else {
491 viewgroup->state.edit_border = &v3d->render_border;
492 viewgroup->is_camera = false;
493 }
494
498 params.range_get_fn = nullptr;
499 params.user_data = viewgroup;
501
503 }
504}
505
507{
508 gzgt->name = "Camera View Widgets";
509 gzgt->idname = "VIEW3D_GGT_camera_view";
510
512
517}
518
Camera data-block and utility functions.
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
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)
void unit_m4(float m[4][4])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
Definition BLI_rect.h:189
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
Definition BLI_rect.h:185
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition rct.cc:602
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:202
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.cc:657
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:206
#define ARRAY_SIZE(arr)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ CAM_ORTHO
@ CAM_SHOWLIMITS
@ CAMERA_SENSOR_FIT_HOR
Object is a sort of wrapper for general info.
@ OB_CAMERA
@ R_BORDER
#define BASE_SELECTABLE(v3d, base)
@ V3D_RENDER_BORDER
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
@ RV3D_CAMOB
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ ED_GIZMO_CAGE2D_STYLE_BOX
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_ARROW_STYLE_CROSS
@ ED_GIZMO_ARROW_STYLE_CONE
@ ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
Read Guarded memory(de)allocation.
#define C
Definition RandGen.cpp:29
void UI_GetThemeColor3fv(int colorid, float col[3])
@ TH_GIZMO_HI
@ TH_GIZMO_A
@ TH_GIZMO_PRIMARY
@ WM_GIZMO_DRAW_NO_SCALE
@ WM_GIZMO_HIDDEN
@ WM_GIZMO_NEEDS_UNDO
@ WM_GIZMO_DRAW_HOVER
@ WM_GIZMOGROUPTYPE_SCALE
@ WM_GIZMOGROUPTYPE_DEPTH_3D
@ WM_GIZMOGROUPTYPE_3D
@ WM_GIZMOGROUPTYPE_PERSISTENT
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, const float range_fac)
BPy_StructRNA * depsgraph
nullptr float
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
static ulong state[N]
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
#define min(a, b)
Definition sort.cc:36
void * regiondata
struct Object * object
struct CameraViewWidgetGroup::@264171014065300304210162075370033165061372043277 state
char sensor_fit
float sensor_y
float sensor_x
float drawsize
struct CameraDOFSettings dof
float ortho_scale
float scale[3]
struct RenderData r
struct Object * camera
rctf render_border
char gizmo_show_camera
float xmax
float xmin
float ymax
float ymin
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnMsgBusSubscribe message_subscribe
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
wmGizmoGroupFnDrawPrepare draw_prepare
wmGizmoMap * parent_gzmap
const wmGizmoPropertyType * type
struct wmGizmoProperty::@331027022007232055216276241130041346111314317052 custom_func
const wmGizmoType * type
float matrix_basis[4][4]
float color_hi[4]
float color[4]
PointerRNA * ptr
float matrix_space[4][4]
eWM_GizmoFlag flag
i
Definition text_draw.cc:230
max
Definition text_draw.cc:251
static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmGizmoGroupType *)
static void WIDGETGROUP_camera_view_setup(const bContext *, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_render_border_prop_matrix_set(const wmGizmo *, wmGizmoProperty *gz_prop, const void *value_p)
static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *)
static void gizmo_render_border_prop_matrix_get(const wmGizmo *, wmGizmoProperty *gz_prop, void *value_p)
void VIEW3D_GGT_camera(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_camera_message_subscribe(const bContext *C, wmGizmoGroup *gzgroup, wmMsgBus *mbus)
static void WIDGETGROUP_camera_view_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_camera_view_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
void VIEW3D_GGT_camera_view(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup)
void WM_gizmo_set_matrix_offset_location(wmGizmo *gz, const float offset[3])
Definition wm_gizmo.cc:302
void WM_gizmo_set_matrix_rotation_from_yz_axis(wmGizmo *gz, const float y_axis[3], const float z_axis[3])
Definition wm_gizmo.cc:281
bool WM_gizmo_group_is_modal(const wmGizmoGroup *gzgroup)
Definition wm_gizmo.cc:719
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:85
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition wm_gizmo.cc:317
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
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)
const wmGizmoPropertyType * WM_gizmotype_target_property_find(const wmGizmoType *gzt, const char *idname)
void WM_gizmo_target_property_clear_rna_ptr(wmGizmo *gz, const wmGizmoPropertyType *gz_prop_type)
void WM_gizmo_do_msg_notify_tag_refresh(bContext *, wmMsgSubscribeKey *, wmMsgSubscribeValue *msg_val)
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_rna_ptr(wmGizmo *gz, const wmGizmoPropertyType *gz_prop_type, PointerRNA *ptr, PropertyRNA *prop, int index)
void WM_gizmo_target_property_def_func(wmGizmo *gz, const char *idname, const wmGizmoPropertyFnParams *params)
const wmGizmoType * WM_gizmotype_find(const StringRef idname, bool quiet)
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)
void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)