Blender  V2.93
view3d_gizmo_camera.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #include "BLI_blenlib.h"
22 #include "BLI_math.h"
23 #include "BLI_utildefines.h"
24 
25 #include "BKE_camera.h"
26 #include "BKE_context.h"
27 #include "BKE_layer.h"
28 
29 #include "DNA_camera_types.h"
30 #include "DNA_object_types.h"
31 
32 #include "ED_armature.h"
33 #include "ED_gizmo_library.h"
34 #include "ED_screen.h"
35 
36 #include "UI_resources.h"
37 
38 #include "MEM_guardedalloc.h"
39 
40 #include "RNA_access.h"
41 
42 #include "WM_api.h"
43 #include "WM_message.h"
44 #include "WM_types.h"
45 
46 #include "DEG_depsgraph.h"
47 
48 #include "view3d_intern.h" /* own include */
49 
50 /* -------------------------------------------------------------------- */
58 };
59 
61 {
62  View3D *v3d = CTX_wm_view3d(C);
64  return false;
65  }
68  return false;
69  }
70 
71  ViewLayer *view_layer = CTX_data_view_layer(C);
72  Base *base = BASACT(view_layer);
73  if (base && BASE_SELECTABLE(v3d, base)) {
74  Object *ob = base->object;
75  if (ob->type == OB_CAMERA) {
76  Camera *camera = ob->data;
77  /* TODO: support overrides. */
78  if (camera->id.lib == NULL) {
79  return true;
80  }
81  }
82  }
83  return false;
84 }
85 
86 static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
87 {
88  ViewLayer *view_layer = CTX_data_view_layer(C);
89  Object *ob = OBACT(view_layer);
90  float dir[3];
91 
92  const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
93 
94  struct CameraWidgetGroup *cagzgroup = MEM_callocN(sizeof(struct CameraWidgetGroup), __func__);
95  gzgroup->customdata = cagzgroup;
96 
97  negate_v3_v3(dir, ob->obmat[2]);
98 
99  /* dof distance */
100  {
101  wmGizmo *gz;
102  gz = cagzgroup->dop_dist = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
103  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CROSS);
105 
108  }
109 
110  /* focal length
111  * - logic/calculations are similar to BKE_camera_view_frame_ex, better keep in sync */
112  {
113  wmGizmo *gz;
114  gz = cagzgroup->focal_len = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
116  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
118 
121 
122  gz = cagzgroup->ortho_scale = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
124  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
126 
129  }
130 }
131 
132 static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup)
133 {
134  if (!gzgroup->customdata) {
135  return;
136  }
137 
138  struct CameraWidgetGroup *cagzgroup = gzgroup->customdata;
139  View3D *v3d = CTX_wm_view3d(C);
140  ViewLayer *view_layer = CTX_data_view_layer(C);
141  Object *ob = OBACT(view_layer);
142  Camera *ca = ob->data;
143  PointerRNA camera_ptr;
144  float dir[3];
145 
146  RNA_pointer_create(&ca->id, &RNA_Camera, ca, &camera_ptr);
147 
148  negate_v3_v3(dir, ob->obmat[2]);
149 
151  WM_gizmo_set_matrix_location(cagzgroup->dop_dist, ob->obmat[3]);
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;
158  RNA_pointer_create(&ca->id, &RNA_CameraDOFSettings, &ca->dof, &camera_dof_ptr);
160  cagzgroup->dop_dist, "offset", &camera_dof_ptr, "focus_distance", -1);
161  }
162  else {
163  WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, true);
164  }
165 
166  /* TODO - make focal length/ortho ob_scale_inv widget optional */
167  const Scene *scene = CTX_data_scene(C);
168  const float aspx = (float)scene->r.xsch * scene->r.xasp;
169  const float aspy = (float)scene->r.ysch * scene->r.yasp;
170  const bool is_ortho = (ca->type == CAM_ORTHO);
171  const int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, aspx, aspy);
172  /* Important to use camera value, not calculated fit since 'AUTO' uses width always. */
173  const float sensor_size = BKE_camera_sensor_size(ca->sensor_fit, ca->sensor_x, ca->sensor_y);
174  wmGizmo *widget = is_ortho ? cagzgroup->ortho_scale : cagzgroup->focal_len;
175  float scale_matrix;
176  if (true) {
177  float offset[3];
178  float aspect[2];
179 
180  WM_gizmo_set_flag(widget, WM_GIZMO_HIDDEN, false);
182  is_ortho ? cagzgroup->focal_len : cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
183 
184  /* account for lens shifting */
185  offset[0] = ((ob->scale[0] > 0.0f) ? -2.0f : 2.0f) * ca->shiftx;
186  offset[1] = 2.0f * ca->shifty;
187  offset[2] = 0.0f;
188 
189  /* get aspect */
190  aspect[0] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? 1.0f : aspx / aspy;
191  aspect[1] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? aspy / aspx : 1.0f;
192 
193  unit_m4(widget->matrix_basis);
194  WM_gizmo_set_matrix_location(widget, ob->obmat[3]);
196 
197  if (is_ortho) {
198  scale_matrix = ca->ortho_scale * 0.5f;
199  }
200  else {
201  const float ob_scale_inv[3] = {
202  1.0f / len_v3(ob->obmat[0]),
203  1.0f / len_v3(ob->obmat[1]),
204  1.0f / len_v3(ob->obmat[2]),
205  };
206  const float ob_scale_uniform_inv = (ob_scale_inv[0] + ob_scale_inv[1] + ob_scale_inv[2]) /
207  3.0f;
208  scale_matrix = (ca->drawsize * 0.5f) / ob_scale_uniform_inv;
209  }
210  mul_v3_fl(widget->matrix_basis[0], scale_matrix);
211  mul_v3_fl(widget->matrix_basis[1], scale_matrix);
212 
213  RNA_float_set_array(widget->ptr, "aspect", aspect);
214 
215  WM_gizmo_set_matrix_offset_location(widget, offset);
216  }
217 
218  /* define & update properties */
219  {
220  const char *propname = is_ortho ? "ortho_scale" : "lens";
221  PropertyRNA *prop = RNA_struct_find_property(&camera_ptr, propname);
222  const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(widget->type,
223  "offset");
224 
225  WM_gizmo_target_property_clear_rna_ptr(widget, gz_prop_type);
226 
227  float min, max, range;
228  float step, precision;
229 
230  /* get property range */
231  RNA_property_float_ui_range(&camera_ptr, prop, &min, &max, &step, &precision);
232  range = max - min;
233 
235  widget,
236  is_ortho ?
237  ((range / ca->ortho_scale) * ca->drawsize) :
238  (scale_matrix * range /
239  /* Half sensor, intentionally use sensor from camera and not calculated above. */
240  (0.5f * sensor_size)));
241 
242  WM_gizmo_target_property_def_rna_ptr(widget, gz_prop_type, &camera_ptr, prop, -1);
243  }
244 
245  /* This could be handled more elegantly (split into two gizmo groups). */
246  if ((v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_LENS) == 0) {
247  WM_gizmo_set_flag(cagzgroup->focal_len, WM_GIZMO_HIDDEN, true);
248  WM_gizmo_set_flag(cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
249  }
250 }
251 
253  wmGizmoGroup *gzgroup,
254  struct wmMsgBus *mbus)
255 {
256  ARegion *region = CTX_wm_region(C);
257  ViewLayer *view_layer = CTX_data_view_layer(C);
258  Object *ob = OBACT(view_layer);
259  Camera *ca = ob->data;
260 
261  wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = {
262  .owner = region,
263  .user_data = gzgroup->parent_gzmap,
265  };
266 
267  {
268  extern PropertyRNA rna_CameraDOFSettings_focus_distance;
269  extern PropertyRNA rna_Camera_display_size;
270  extern PropertyRNA rna_Camera_ortho_scale;
271  extern PropertyRNA rna_Camera_sensor_fit;
272  extern PropertyRNA rna_Camera_sensor_width;
273  extern PropertyRNA rna_Camera_sensor_height;
274  extern PropertyRNA rna_Camera_shift_x;
275  extern PropertyRNA rna_Camera_shift_y;
276  extern PropertyRNA rna_Camera_type;
277  extern PropertyRNA rna_Camera_lens;
278  const PropertyRNA *props[] = {
279  &rna_CameraDOFSettings_focus_distance,
280  &rna_Camera_display_size,
281  &rna_Camera_ortho_scale,
282  &rna_Camera_sensor_fit,
283  &rna_Camera_sensor_width,
284  &rna_Camera_sensor_height,
285  &rna_Camera_shift_x,
286  &rna_Camera_shift_y,
287  &rna_Camera_type,
288  &rna_Camera_lens,
289  };
290 
291  PointerRNA idptr;
292  RNA_id_pointer_create(&ca->id, &idptr);
293 
294  for (int i = 0; i < ARRAY_SIZE(props); i++) {
295  WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
296  }
297  }
298 
299  /* Subscribe to render settings */
300  {
302  mbus, RenderSettings, resolution_x, &msg_sub_value_gz_tag_refresh);
304  mbus, RenderSettings, resolution_y, &msg_sub_value_gz_tag_refresh);
306  mbus, RenderSettings, pixel_aspect_x, &msg_sub_value_gz_tag_refresh);
308  mbus, RenderSettings, pixel_aspect_y, &msg_sub_value_gz_tag_refresh);
309  }
310 }
311 
313 {
314  gzgt->name = "Camera Widgets";
315  gzgt->idname = "VIEW3D_GGT_camera";
316 
318 
324 }
325 
328 /* -------------------------------------------------------------------- */
334  bool is_camera;
335 
337 
338  struct {
341  } state;
342 };
343 
344 /* scale callbacks */
346  wmGizmoProperty *gz_prop,
347  void *value_p)
348 {
349  float(*matrix)[4] = value_p;
350  BLI_assert(gz_prop->type->array_length == 16);
351  struct CameraViewWidgetGroup *viewgroup = gz_prop->custom_func.user_data;
352  const rctf *border = viewgroup->state.edit_border;
353 
354  unit_m4(matrix);
355  matrix[0][0] = BLI_rctf_size_x(border);
356  matrix[1][1] = BLI_rctf_size_y(border);
357  matrix[3][0] = BLI_rctf_cent_x(border);
358  matrix[3][1] = BLI_rctf_cent_y(border);
359 }
360 
362  wmGizmoProperty *gz_prop,
363  const void *value_p)
364 {
365  const float(*matrix)[4] = value_p;
366  struct CameraViewWidgetGroup *viewgroup = gz_prop->custom_func.user_data;
367  rctf *border = viewgroup->state.edit_border;
368  BLI_assert(gz_prop->type->array_length == 16);
369 
370  BLI_rctf_resize(border, len_v3(matrix[0]), len_v3(matrix[1]));
371  BLI_rctf_recenter(border, matrix[3][0], matrix[3][1]);
373  &(rctf){
374  .xmin = 0,
375  .ymin = 0,
376  .xmax = 1,
377  .ymax = 1,
378  },
379  border,
380  border);
381 
382  if (viewgroup->is_camera) {
384  }
385 }
386 
388 {
390 
391  /* This is just so the border isn't always in the way,
392  * stealing mouse clicks from regular usage.
393  * We could change the rules for when to show. */
394  {
395  ViewLayer *view_layer = CTX_data_view_layer(C);
396  if (scene->camera != OBACT(view_layer)) {
397  return false;
398  }
399  }
400 
401  View3D *v3d = CTX_wm_view3d(C);
403  return false;
404  }
405 
406  ARegion *region = CTX_wm_region(C);
407  RegionView3D *rv3d = region->regiondata;
408  if (rv3d->persp == RV3D_CAMOB) {
409  if (scene->r.mode & R_BORDER) {
410  /* TODO: support overrides. */
411  if (scene->id.lib == NULL) {
412  return true;
413  }
414  }
415  }
416  else if (v3d->flag2 & V3D_RENDER_BORDER) {
417  return true;
418  }
419  return false;
420 }
421 
423 {
424  struct CameraViewWidgetGroup *viewgroup = MEM_mallocN(sizeof(struct CameraViewWidgetGroup),
425  __func__);
426 
427  viewgroup->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, NULL);
428 
429  RNA_enum_set(viewgroup->border->ptr,
430  "transform",
432  /* Box style is more subtle in this case. */
433  RNA_enum_set(viewgroup->border->ptr, "draw_style", ED_GIZMO_CAGE2D_STYLE_BOX);
434 
435  WM_gizmo_set_scale(viewgroup->border, 10.0f / 0.15f);
436 
437  gzgroup->customdata = viewgroup;
438 }
439 
441 {
442  struct CameraViewWidgetGroup *viewgroup = gzgroup->customdata;
443 
444  ARegion *region = CTX_wm_region(C);
445  /* Drawing code should happen with fully evaluated graph. */
447  RegionView3D *rv3d = region->regiondata;
448  if (rv3d->persp == RV3D_CAMOB) {
450  View3D *v3d = CTX_wm_view3d(C);
452  scene, depsgraph, region, v3d, rv3d, &viewgroup->state.view_border, false);
453  }
454  else {
455  viewgroup->state.view_border = (rctf){
456  .xmin = 0,
457  .ymin = 0,
458  .xmax = region->winx,
459  .ymax = region->winy,
460  };
461  }
462 
463  wmGizmo *gz = viewgroup->border;
464  unit_m4(gz->matrix_space);
467  gz->matrix_space[3][0] = viewgroup->state.view_border.xmin;
468  gz->matrix_space[3][1] = viewgroup->state.view_border.ymin;
469 }
470 
472 {
473  struct CameraViewWidgetGroup *viewgroup = gzgroup->customdata;
474 
475  View3D *v3d = CTX_wm_view3d(C);
476  ARegion *region = CTX_wm_region(C);
477  RegionView3D *rv3d = region->regiondata;
479 
480  viewgroup->scene = scene;
481 
482  {
483  wmGizmo *gz = viewgroup->border;
485 
486  RNA_enum_set(viewgroup->border->ptr,
487  "transform",
489 
490  if (rv3d->persp == RV3D_CAMOB) {
491  viewgroup->state.edit_border = &scene->r.border;
492  viewgroup->is_camera = true;
493  }
494  else {
495  viewgroup->state.edit_border = &v3d->render_border;
496  viewgroup->is_camera = false;
497  }
498 
500  "matrix",
501  &(const struct wmGizmoPropertyFnParams){
502  .value_get_fn = gizmo_render_border_prop_matrix_get,
503  .value_set_fn = gizmo_render_border_prop_matrix_set,
504  .range_get_fn = NULL,
505  .user_data = viewgroup,
506  });
507  }
508 }
509 
511 {
512  gzgt->name = "Camera View Widgets";
513  gzgt->idname = "VIEW3D_GGT_camera_view";
514 
516 
521 }
522 
typedef float(TangentPoint)[2]
Camera data-block and utility functions.
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
Definition: camera.c:242
int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
Definition: camera.c:252
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
Definition: context.c:1415
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
#define BLI_assert(a)
Definition: BLI_assert.h:58
void unit_m4(float m[4][4])
Definition: rct.c:1140
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:148
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:144
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition: rct.c:618
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:161
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition: rct.c:674
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:165
#define ARRAY_SIZE(arr)
#define UNUSED(x)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:654
@ CAM_SHOWLIMITS
@ CAM_ORTHO
@ CAMERA_SENSOR_FIT_HOR
@ BASE_SELECTABLE
Object is a sort of wrapper for general info.
@ OB_CAMERA
#define R_BORDER
#define BASACT(_view_layer)
#define OBACT(_view_layer)
struct rctf rctf
#define RV3D_CAMOB
#define V3D_RENDER_BORDER
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
@ ED_GIZMO_CAGE2D_STYLE_BOX
@ ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED
@ ED_GIZMO_ARROW_STYLE_CROSS
@ ED_GIZMO_ARROW_STYLE_CONE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE
void ED_view3d_calc_camera_border(const struct Scene *scene, struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const struct RegionView3D *rv3d, struct rctf *r_viewborder, const bool no_shift)
Read Guarded memory(de)allocation.
StructRNA RNA_Camera
StructRNA RNA_CameraDOFSettings
#define C
Definition: RandGen.cpp:39
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1191
@ TH_GIZMO_HI
Definition: UI_resources.h:320
@ TH_GIZMO_A
Definition: UI_resources.h:324
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:321
@ WM_GIZMO_DRAW_NO_SCALE
@ WM_GIZMO_HIDDEN
@ 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)
Scene scene
const Depsgraph * depsgraph
IconTextureDrawCall border
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:47
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:146
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:122
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
Definition: rna_access.c:1466
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:866
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:6413
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:6390
#define min(a, b)
Definition: sort.c:51
void * regiondata
struct Object * object
struct CameraViewWidgetGroup::@546 state
char sensor_fit
float sensor_y
float shiftx
float sensor_x
float shifty
float drawsize
struct CameraDOFSettings dof
float ortho_scale
struct Library * lib
Definition: DNA_ID.h:277
float scale[3]
float obmat[4][4]
void * data
struct RenderData r
struct Object * camera
rctf render_border
char gizmo_show_camera
char gizmo_flag
float xmin
Definition: DNA_vec_types.h:85
float ymin
Definition: DNA_vec_types.h:86
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnMsgBusSubscribe message_subscribe
wmGizmoGroupFnRefresh refresh
wmGizmoGroupFnInit setup
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnPoll poll
const char * name
wmGizmoGroupFnDrawPrepare draw_prepare
struct wmGizmoMap * parent_gzmap
struct wmGizmoProperty::@1149 custom_func
const struct wmGizmoPropertyType * type
float matrix_basis[4][4]
float color_hi[4]
float color[4]
struct PointerRNA * ptr
float matrix_space[4][4]
eWM_GizmoFlag flag
const struct wmGizmoType * type
float max
static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_camera_message_subscribe(const bContext *C, wmGizmoGroup *gzgroup, struct wmMsgBus *mbus)
static void WIDGETGROUP_camera_view_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
void VIEW3D_GGT_camera(wmGizmoGroupType *gzgt)
static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
static void gizmo_render_border_prop_matrix_get(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, void *value_p)
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 gizmo_render_border_prop_matrix_set(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, const void *value_p)
static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED(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.c:334
void WM_gizmo_set_matrix_rotation_from_yz_axis(wmGizmo *gz, const float y_axis[3], const float z_axis[3])
Definition: wm_gizmo.c:310
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:96
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition: wm_gizmo.c:349
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:316
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:339
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:114
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *UNUSED(gzgt), wmKeyConfig *kc)
void WM_gizmo_do_msg_notify_tag_refresh(bContext *UNUSED(C), wmMsgSubscribeKey *UNUSED(msg_key), wmMsgSubscribeValue *msg_val)
void WM_gizmo_target_property_clear_rna_ptr(wmGizmo *gz, const wmGizmoPropertyType *gz_prop_type)
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 wmGizmoPropertyType * WM_gizmotype_target_property_find(const wmGizmoType *gzt, const char *idname)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)
Definition: wm_gizmo_type.c:58
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value)
void WM_msg_subscribe_rna(struct wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)