Blender V4.3
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_math_matrix.h"
10#include "BLI_math_vector.h"
11#include "BLI_utildefines.h"
12
13#include "BKE_camera.h"
14#include "BKE_context.hh"
15#include "BKE_layer.hh"
16#include "BKE_lib_id.hh"
17
18#include "DNA_camera_types.h"
19#include "DNA_object_types.h"
20
21#include "ED_gizmo_library.hh"
22#include "ED_screen.hh"
23
24#include "UI_resources.hh"
25
26#include "MEM_guardedalloc.h"
27
28#include "RNA_access.hh"
29
30#include "WM_message.hh"
31#include "WM_types.hh"
32
33#include "DEG_depsgraph.hh"
34
35#include "view3d_intern.hh" /* own include */
36
37/* -------------------------------------------------------------------- */
40
46
47static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType * /*gzgt*/)
48{
49 View3D *v3d = CTX_wm_view3d(C);
51 return false;
52 }
55 {
56 return false;
57 }
58
59 const Scene *scene = CTX_data_scene(C);
60 ViewLayer *view_layer = CTX_data_view_layer(C);
61 BKE_view_layer_synced_ensure(scene, view_layer);
62 Base *base = BKE_view_layer_active_base_get(view_layer);
63 if (base && BASE_SELECTABLE(v3d, base)) {
64 Object *ob = base->object;
65 if (ob->type == OB_CAMERA) {
66 const Camera *camera = static_cast<Camera *>(ob->data);
67 /* TODO: support overrides. */
69 return true;
70 }
71 }
72 }
73 return false;
74}
75
76static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
77{
78 const Scene *scene = CTX_data_scene(C);
79 ViewLayer *view_layer = CTX_data_view_layer(C);
80 BKE_view_layer_synced_ensure(scene, view_layer);
82 float dir[3];
83
84 const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
85
86 CameraWidgetGroup *cagzgroup = static_cast<CameraWidgetGroup *>(
87 MEM_callocN(sizeof(CameraWidgetGroup), __func__));
88 gzgroup->customdata = cagzgroup;
89
90 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
91
92 /* dof distance */
93 {
94 wmGizmo *gz;
95 gz = cagzgroup->dop_dist = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
98
101 }
102
103 /* focal length
104 * - logic/calculations are similar to BKE_camera_view_frame_ex, better keep in sync */
105 {
106 wmGizmo *gz;
107 gz = cagzgroup->focal_len = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
109 RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
111
114
115 gz = cagzgroup->ortho_scale = WM_gizmo_new_ptr(gzt_arrow, gzgroup, nullptr);
117 RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
119
122 }
123
124 /* All gizmos must perform undo. */
125 LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
127 }
128}
129
131{
132 if (!gzgroup->customdata) {
133 return;
134 }
135
136 CameraWidgetGroup *cagzgroup = static_cast<CameraWidgetGroup *>(gzgroup->customdata);
137 View3D *v3d = CTX_wm_view3d(C);
138 const Scene *scene = CTX_data_scene(C);
139 ViewLayer *view_layer = CTX_data_view_layer(C);
140 BKE_view_layer_synced_ensure(scene, view_layer);
142 Camera *ca = static_cast<Camera *>(ob->data);
143 float dir[3];
144
145 PointerRNA camera_ptr = RNA_pointer_create(&ca->id, &RNA_Camera, ca);
146
147 negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
148
150 WM_gizmo_set_matrix_location(cagzgroup->dop_dist, ob->object_to_world().location());
152 cagzgroup->dop_dist, ob->object_to_world().ptr()[1], dir);
153 WM_gizmo_set_scale(cagzgroup->dop_dist, ca->drawsize);
154 WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, false);
155
156 /* Need to set property here for undo. TODO: would prefer to do this in _init. */
157 PointerRNA camera_dof_ptr = RNA_pointer_create(&ca->id, &RNA_CameraDOFSettings, &ca->dof);
159 cagzgroup->dop_dist, "offset", &camera_dof_ptr, "focus_distance", -1);
160 }
161 else {
162 WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, true);
163 }
164
165 /* TODO: make focal length/ortho ob_scale_inv widget optional. */
166 const float aspx = float(scene->r.xsch) * scene->r.xasp;
167 const float aspy = float(scene->r.ysch) * scene->r.yasp;
168 const bool is_ortho = (ca->type == CAM_ORTHO);
169 const int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, aspx, aspy);
170 /* Important to use camera value, not calculated fit since 'AUTO' uses width always. */
171 const float sensor_size = BKE_camera_sensor_size(ca->sensor_fit, ca->sensor_x, ca->sensor_y);
172 wmGizmo *widget = is_ortho ? cagzgroup->ortho_scale : cagzgroup->focal_len;
173 float scale_matrix;
174 if (true) {
175 float offset[3];
176 float aspect[2];
177
178 WM_gizmo_set_flag(widget, WM_GIZMO_HIDDEN, false);
180 is_ortho ? cagzgroup->focal_len : cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
181
182 /* account for lens shifting */
183 offset[0] = ((ob->scale[0] > 0.0f) ? -2.0f : 2.0f) * ca->shiftx;
184 offset[1] = 2.0f * ca->shifty;
185 offset[2] = 0.0f;
186
187 /* get aspect */
188 aspect[0] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? 1.0f : aspx / aspy;
189 aspect[1] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? aspy / aspx : 1.0f;
190
191 unit_m4(widget->matrix_basis);
192 WM_gizmo_set_matrix_location(widget, ob->object_to_world().location());
193 WM_gizmo_set_matrix_rotation_from_yz_axis(widget, ob->object_to_world().ptr()[1], dir);
194
195 if (is_ortho) {
196 scale_matrix = ca->ortho_scale * 0.5f;
197 }
198 else {
199 const float ob_scale_inv[3] = {
200 1.0f / len_v3(ob->object_to_world().ptr()[0]),
201 1.0f / len_v3(ob->object_to_world().ptr()[1]),
202 1.0f / len_v3(ob->object_to_world().ptr()[2]),
203 };
204 const float ob_scale_uniform_inv = (ob_scale_inv[0] + ob_scale_inv[1] + ob_scale_inv[2]) /
205 3.0f;
206 scale_matrix = (ca->drawsize * 0.5f) / ob_scale_uniform_inv;
207 }
208 mul_v3_fl(widget->matrix_basis[0], scale_matrix);
209 mul_v3_fl(widget->matrix_basis[1], scale_matrix);
210
211 RNA_float_set_array(widget->ptr, "aspect", aspect);
212
214 }
215
216 /* define & update properties */
217 {
218 const char *propname = is_ortho ? "ortho_scale" : "lens";
219 PropertyRNA *prop = RNA_struct_find_property(&camera_ptr, propname);
220 const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(widget->type,
221 "offset");
222
223 WM_gizmo_target_property_clear_rna_ptr(widget, gz_prop_type);
224
225 float min, max, range;
226 float step, precision;
227
228 /* get property range */
229 RNA_property_float_ui_range(&camera_ptr, prop, &min, &max, &step, &precision);
230 range = max - min;
231
233 widget,
234 is_ortho ?
235 ((range / ca->ortho_scale) * ca->drawsize) :
236 (scale_matrix * range /
237 /* Half sensor, intentionally use sensor from camera and not calculated above. */
238 (0.5f * sensor_size)));
239
240 WM_gizmo_target_property_def_rna_ptr(widget, gz_prop_type, &camera_ptr, prop, -1);
241 }
242
243 /* This could be handled more elegantly (split into two gizmo groups). */
247 }
248}
249
251 wmGizmoGroup *gzgroup,
252 wmMsgBus *mbus)
253{
254 ARegion *region = CTX_wm_region(C);
255 const Scene *scene = CTX_data_scene(C);
256 ViewLayer *view_layer = CTX_data_view_layer(C);
257 BKE_view_layer_synced_ensure(scene, view_layer);
259 Camera *ca = static_cast<Camera *>(ob->data);
260
261 wmMsgSubscribeValue msg_sub_value_gz_tag_refresh{};
262 msg_sub_value_gz_tag_refresh.owner = region;
263 msg_sub_value_gz_tag_refresh.user_data = gzgroup->parent_gzmap;
264 msg_sub_value_gz_tag_refresh.notify = WM_gizmo_do_msg_notify_tag_refresh;
265
266 {
267 const PropertyRNA *props[] = {
268 &rna_CameraDOFSettings_focus_distance,
269 &rna_Camera_display_size,
270 &rna_Camera_ortho_scale,
271 &rna_Camera_sensor_fit,
272 &rna_Camera_sensor_width,
273 &rna_Camera_sensor_height,
274 &rna_Camera_shift_x,
275 &rna_Camera_shift_y,
276 &rna_Camera_type,
277 &rna_Camera_lens,
278 };
279
280 PointerRNA idptr = RNA_id_pointer_create(&ca->id);
281
282 for (int i = 0; i < ARRAY_SIZE(props); i++) {
283 WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
284 }
285 }
286
287 /* Subscribe to render settings */
288 {
290 mbus, RenderSettings, resolution_x, &msg_sub_value_gz_tag_refresh);
292 mbus, RenderSettings, resolution_y, &msg_sub_value_gz_tag_refresh);
294 mbus, RenderSettings, pixel_aspect_x, &msg_sub_value_gz_tag_refresh);
296 mbus, RenderSettings, pixel_aspect_y, &msg_sub_value_gz_tag_refresh);
297 }
298}
299
313
315
316/* -------------------------------------------------------------------- */
319
331
332/* scale callbacks */
334 wmGizmoProperty *gz_prop,
335 void *value_p)
336{
337 float(*matrix)[4] = static_cast<float(*)[4]>(value_p);
338 BLI_assert(gz_prop->type->array_length == 16);
339 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(
340 gz_prop->custom_func.user_data);
341 const rctf *border = viewgroup->state.edit_border;
342
343 unit_m4(matrix);
344 matrix[0][0] = BLI_rctf_size_x(border);
345 matrix[1][1] = BLI_rctf_size_y(border);
346 matrix[3][0] = BLI_rctf_cent_x(border);
347 matrix[3][1] = BLI_rctf_cent_y(border);
348}
349
351 wmGizmoProperty *gz_prop,
352 const void *value_p)
353{
354 const float(*matrix)[4] = static_cast<const float(*)[4]>(value_p);
355 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(
356 gz_prop->custom_func.user_data);
357 rctf *border = viewgroup->state.edit_border;
358 BLI_assert(gz_prop->type->array_length == 16);
359
360 rctf rect{};
361 rect.xmin = 0;
362 rect.ymin = 0;
363 rect.xmax = 1;
364 rect.ymax = 1;
365 BLI_rctf_resize(border, len_v3(matrix[0]), len_v3(matrix[1]));
366 BLI_rctf_recenter(border, matrix[3][0], matrix[3][1]);
367 BLI_rctf_isect(&rect, border, border);
368
369 if (viewgroup->is_camera) {
371 }
372}
373
375{
376 Scene *scene = CTX_data_scene(C);
377
378 /* This is just so the border isn't always in the way,
379 * stealing mouse clicks from regular usage.
380 * We could change the rules for when to show. */
381 {
382 ViewLayer *view_layer = CTX_data_view_layer(C);
383 BKE_view_layer_synced_ensure(scene, view_layer);
384 if (scene->camera != BKE_view_layer_active_object_get(view_layer)) {
385 return false;
386 }
387 }
388
389 View3D *v3d = CTX_wm_view3d(C);
391 return false;
392 }
393
394 ARegion *region = CTX_wm_region(C);
395 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
396 if (rv3d->persp == RV3D_CAMOB) {
397 if (scene->r.mode & R_BORDER) {
398 /* TODO: support overrides. */
399 if (BKE_id_is_editable(CTX_data_main(C), &scene->id)) {
400 return true;
401 }
402 }
403 }
404 else if (v3d->flag2 & V3D_RENDER_BORDER) {
405 return true;
406 }
407 return false;
408}
409
410static void WIDGETGROUP_camera_view_setup(const bContext * /*C*/, wmGizmoGroup *gzgroup)
411{
412 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(
413 MEM_mallocN(sizeof(CameraViewWidgetGroup), __func__));
414
415 viewgroup->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
416
417 RNA_enum_set(viewgroup->border->ptr,
418 "transform",
420 /* Box style is more subtle in this case. */
421 RNA_enum_set(viewgroup->border->ptr, "draw_style", ED_GIZMO_CAGE2D_STYLE_BOX);
422
423 WM_gizmo_set_scale(viewgroup->border, 10.0f / 0.15f);
424
425 gzgroup->customdata = viewgroup;
426
427 /* NOTE: #WM_GIZMO_NEEDS_UNDO is set on refresh and depends on modifying a camera object. */
428}
429
431{
432 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(gzgroup->customdata);
433
434 ARegion *region = CTX_wm_region(C);
435 /* Drawing code should happen with fully evaluated graph. */
437 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
438 if (rv3d->persp == RV3D_CAMOB) {
439 Scene *scene = CTX_data_scene(C);
440 View3D *v3d = CTX_wm_view3d(C);
442 scene, depsgraph, region, v3d, rv3d, false, &viewgroup->state.view_border);
443 }
444 else {
445 rctf rect{};
446 rect.xmin = 0;
447 rect.ymin = 0;
448 rect.xmax = region->winx;
449 rect.ymax = region->winy;
450 viewgroup->state.view_border = rect;
451 }
452
453 wmGizmo *gz = viewgroup->border;
457 gz->matrix_space[3][0] = viewgroup->state.view_border.xmin;
458 gz->matrix_space[3][1] = viewgroup->state.view_border.ymin;
459}
460
462{
463 CameraViewWidgetGroup *viewgroup = static_cast<CameraViewWidgetGroup *>(gzgroup->customdata);
464
465 View3D *v3d = CTX_wm_view3d(C);
466 ARegion *region = CTX_wm_region(C);
467 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
468 Scene *scene = CTX_data_scene(C);
469
470 viewgroup->scene = scene;
471
472 {
473 wmGizmo *gz = viewgroup->border;
475
476 RNA_enum_set(viewgroup->border->ptr,
477 "transform",
479
480 if (rv3d->persp == RV3D_CAMOB) {
481 viewgroup->state.edit_border = &scene->r.border;
482 viewgroup->is_camera = true;
483 }
484 else {
485 viewgroup->state.edit_border = &v3d->render_border;
486 viewgroup->is_camera = false;
487 }
488
492 params.range_get_fn = nullptr;
493 params.user_data = viewgroup;
495
497 }
498}
499
501{
502 gzgt->name = "Camera View Widgets";
503 gzgt->idname = "VIEW3D_GGT_camera_view";
504
506
511}
512
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:2456
#define BLI_assert(a)
Definition BLI_assert.h:50
#define LISTBASE_FOREACH(type, var, list)
void unit_m4(float m[4][4])
Definition rct.c:1127
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:184
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:180
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition rct.c:596
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition BLI_rect.h:197
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition rct.c:651
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition BLI_rect.h:201
#define ARRAY_SIZE(arr)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1085
@ 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_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ V3D_RENDER_BORDER
@ RV3D_CAMOB
@ ED_GIZMO_CAGE_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_STYLE_BOX
@ ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED
@ ED_GIZMO_ARROW_STYLE_CROSS
@ ED_GIZMO_ARROW_STYLE_CONE
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.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
#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
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
void *(* MEM_callocN)(size_t len, const char *str)
Definition mallocn.cc:42
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(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
#define min(a, b)
Definition sort.c:32
void * regiondata
struct Object * object
struct CameraViewWidgetGroup::@135173052262151231023304341302170362241265146003 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::@117015166124357113140055046164066116264326071147 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
float max
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:298
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:94
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:277
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition wm_gizmo.cc:81
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition wm_gizmo.cc:313
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
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 char *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)