Blender  V3.3
view3d_gizmo_camera.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BLI_blenlib.h"
8 #include "BLI_math.h"
9 #include "BLI_utildefines.h"
10 
11 #include "BKE_camera.h"
12 #include "BKE_context.h"
13 #include "BKE_layer.h"
14 #include "BKE_lib_id.h"
15 
16 #include "DNA_camera_types.h"
17 #include "DNA_object_types.h"
18 
19 #include "ED_armature.h"
20 #include "ED_gizmo_library.h"
21 #include "ED_screen.h"
22 
23 #include "UI_resources.h"
24 
25 #include "MEM_guardedalloc.h"
26 
27 #include "RNA_access.h"
28 
29 #include "WM_api.h"
30 #include "WM_message.h"
31 #include "WM_types.h"
32 
33 #include "DEG_depsgraph.h"
34 
35 #include "view3d_intern.h" /* own include */
36 
37 /* -------------------------------------------------------------------- */
45 };
46 
48 {
49  View3D *v3d = CTX_wm_view3d(C);
51  return false;
52  }
55  return false;
56  }
57 
58  ViewLayer *view_layer = CTX_data_view_layer(C);
59  Base *base = BASACT(view_layer);
60  if (base && BASE_SELECTABLE(v3d, base)) {
61  Object *ob = base->object;
62  if (ob->type == OB_CAMERA) {
63  Camera *camera = ob->data;
64  /* TODO: support overrides. */
66  return true;
67  }
68  }
69  }
70  return false;
71 }
72 
73 static void WIDGETGROUP_camera_setup(const bContext *C, wmGizmoGroup *gzgroup)
74 {
75  ViewLayer *view_layer = CTX_data_view_layer(C);
76  Object *ob = OBACT(view_layer);
77  float dir[3];
78 
79  const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true);
80 
81  struct CameraWidgetGroup *cagzgroup = MEM_callocN(sizeof(struct CameraWidgetGroup), __func__);
82  gzgroup->customdata = cagzgroup;
83 
84  negate_v3_v3(dir, ob->obmat[2]);
85 
86  /* dof distance */
87  {
88  wmGizmo *gz;
89  gz = cagzgroup->dop_dist = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
90  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CROSS);
92 
95  }
96 
97  /* focal length
98  * - logic/calculations are similar to BKE_camera_view_frame_ex, better keep in sync */
99  {
100  wmGizmo *gz;
101  gz = cagzgroup->focal_len = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
103  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
105 
108 
109  gz = cagzgroup->ortho_scale = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL);
111  RNA_enum_set(gz->ptr, "draw_style", ED_GIZMO_ARROW_STYLE_CONE);
113 
116  }
117 }
118 
119 static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup)
120 {
121  if (!gzgroup->customdata) {
122  return;
123  }
124 
125  struct CameraWidgetGroup *cagzgroup = gzgroup->customdata;
126  View3D *v3d = CTX_wm_view3d(C);
127  ViewLayer *view_layer = CTX_data_view_layer(C);
128  Object *ob = OBACT(view_layer);
129  Camera *ca = ob->data;
130  PointerRNA camera_ptr;
131  float dir[3];
132 
133  RNA_pointer_create(&ca->id, &RNA_Camera, ca, &camera_ptr);
134 
135  negate_v3_v3(dir, ob->obmat[2]);
136 
138  WM_gizmo_set_matrix_location(cagzgroup->dop_dist, ob->obmat[3]);
140  WM_gizmo_set_scale(cagzgroup->dop_dist, ca->drawsize);
141  WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, false);
142 
143  /* Need to set property here for undo. TODO: would prefer to do this in _init. */
144  PointerRNA camera_dof_ptr;
145  RNA_pointer_create(&ca->id, &RNA_CameraDOFSettings, &ca->dof, &camera_dof_ptr);
147  cagzgroup->dop_dist, "offset", &camera_dof_ptr, "focus_distance", -1);
148  }
149  else {
150  WM_gizmo_set_flag(cagzgroup->dop_dist, WM_GIZMO_HIDDEN, true);
151  }
152 
153  /* TODO: make focal length/ortho ob_scale_inv widget optional. */
154  const Scene *scene = CTX_data_scene(C);
155  const float aspx = (float)scene->r.xsch * scene->r.xasp;
156  const float aspy = (float)scene->r.ysch * scene->r.yasp;
157  const bool is_ortho = (ca->type == CAM_ORTHO);
158  const int sensor_fit = BKE_camera_sensor_fit(ca->sensor_fit, aspx, aspy);
159  /* Important to use camera value, not calculated fit since 'AUTO' uses width always. */
160  const float sensor_size = BKE_camera_sensor_size(ca->sensor_fit, ca->sensor_x, ca->sensor_y);
161  wmGizmo *widget = is_ortho ? cagzgroup->ortho_scale : cagzgroup->focal_len;
162  float scale_matrix;
163  if (true) {
164  float offset[3];
165  float aspect[2];
166 
167  WM_gizmo_set_flag(widget, WM_GIZMO_HIDDEN, false);
169  is_ortho ? cagzgroup->focal_len : cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
170 
171  /* account for lens shifting */
172  offset[0] = ((ob->scale[0] > 0.0f) ? -2.0f : 2.0f) * ca->shiftx;
173  offset[1] = 2.0f * ca->shifty;
174  offset[2] = 0.0f;
175 
176  /* get aspect */
177  aspect[0] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? 1.0f : aspx / aspy;
178  aspect[1] = (sensor_fit == CAMERA_SENSOR_FIT_HOR) ? aspy / aspx : 1.0f;
179 
180  unit_m4(widget->matrix_basis);
181  WM_gizmo_set_matrix_location(widget, ob->obmat[3]);
183 
184  if (is_ortho) {
185  scale_matrix = ca->ortho_scale * 0.5f;
186  }
187  else {
188  const float ob_scale_inv[3] = {
189  1.0f / len_v3(ob->obmat[0]),
190  1.0f / len_v3(ob->obmat[1]),
191  1.0f / len_v3(ob->obmat[2]),
192  };
193  const float ob_scale_uniform_inv = (ob_scale_inv[0] + ob_scale_inv[1] + ob_scale_inv[2]) /
194  3.0f;
195  scale_matrix = (ca->drawsize * 0.5f) / ob_scale_uniform_inv;
196  }
197  mul_v3_fl(widget->matrix_basis[0], scale_matrix);
198  mul_v3_fl(widget->matrix_basis[1], scale_matrix);
199 
200  RNA_float_set_array(widget->ptr, "aspect", aspect);
201 
203  }
204 
205  /* define & update properties */
206  {
207  const char *propname = is_ortho ? "ortho_scale" : "lens";
208  PropertyRNA *prop = RNA_struct_find_property(&camera_ptr, propname);
209  const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(widget->type,
210  "offset");
211 
212  WM_gizmo_target_property_clear_rna_ptr(widget, gz_prop_type);
213 
214  float min, max, range;
215  float step, precision;
216 
217  /* get property range */
218  RNA_property_float_ui_range(&camera_ptr, prop, &min, &max, &step, &precision);
219  range = max - min;
220 
222  widget,
223  is_ortho ?
224  ((range / ca->ortho_scale) * ca->drawsize) :
225  (scale_matrix * range /
226  /* Half sensor, intentionally use sensor from camera and not calculated above. */
227  (0.5f * sensor_size)));
228 
229  WM_gizmo_target_property_def_rna_ptr(widget, gz_prop_type, &camera_ptr, prop, -1);
230  }
231 
232  /* This could be handled more elegantly (split into two gizmo groups). */
233  if ((v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_LENS) == 0) {
234  WM_gizmo_set_flag(cagzgroup->focal_len, WM_GIZMO_HIDDEN, true);
235  WM_gizmo_set_flag(cagzgroup->ortho_scale, WM_GIZMO_HIDDEN, true);
236  }
237 }
238 
240  wmGizmoGroup *gzgroup,
241  struct wmMsgBus *mbus)
242 {
243  ARegion *region = CTX_wm_region(C);
244  ViewLayer *view_layer = CTX_data_view_layer(C);
245  Object *ob = OBACT(view_layer);
246  Camera *ca = ob->data;
247 
248  wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = {
249  .owner = region,
250  .user_data = gzgroup->parent_gzmap,
252  };
253 
254  {
255  const PropertyRNA *props[] = {
256  &rna_CameraDOFSettings_focus_distance,
257  &rna_Camera_display_size,
258  &rna_Camera_ortho_scale,
259  &rna_Camera_sensor_fit,
260  &rna_Camera_sensor_width,
261  &rna_Camera_sensor_height,
262  &rna_Camera_shift_x,
263  &rna_Camera_shift_y,
264  &rna_Camera_type,
265  &rna_Camera_lens,
266  };
267 
268  PointerRNA idptr;
269  RNA_id_pointer_create(&ca->id, &idptr);
270 
271  for (int i = 0; i < ARRAY_SIZE(props); i++) {
272  WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_gz_tag_refresh, __func__);
273  }
274  }
275 
276  /* Subscribe to render settings */
277  {
279  mbus, RenderSettings, resolution_x, &msg_sub_value_gz_tag_refresh);
281  mbus, RenderSettings, resolution_y, &msg_sub_value_gz_tag_refresh);
283  mbus, RenderSettings, pixel_aspect_x, &msg_sub_value_gz_tag_refresh);
285  mbus, RenderSettings, pixel_aspect_y, &msg_sub_value_gz_tag_refresh);
286  }
287 }
288 
290 {
291  gzgt->name = "Camera Widgets";
292  gzgt->idname = "VIEW3D_GGT_camera";
293 
295 
301 }
302 
305 /* -------------------------------------------------------------------- */
311  bool is_camera;
312 
314 
315  struct {
318  } state;
319 };
320 
321 /* scale callbacks */
323  wmGizmoProperty *gz_prop,
324  void *value_p)
325 {
326  float(*matrix)[4] = value_p;
327  BLI_assert(gz_prop->type->array_length == 16);
328  struct CameraViewWidgetGroup *viewgroup = gz_prop->custom_func.user_data;
329  const rctf *border = viewgroup->state.edit_border;
330 
331  unit_m4(matrix);
332  matrix[0][0] = BLI_rctf_size_x(border);
333  matrix[1][1] = BLI_rctf_size_y(border);
334  matrix[3][0] = BLI_rctf_cent_x(border);
335  matrix[3][1] = BLI_rctf_cent_y(border);
336 }
337 
339  wmGizmoProperty *gz_prop,
340  const void *value_p)
341 {
342  const float(*matrix)[4] = value_p;
343  struct CameraViewWidgetGroup *viewgroup = gz_prop->custom_func.user_data;
344  rctf *border = viewgroup->state.edit_border;
345  BLI_assert(gz_prop->type->array_length == 16);
346 
347  BLI_rctf_resize(border, len_v3(matrix[0]), len_v3(matrix[1]));
348  BLI_rctf_recenter(border, matrix[3][0], matrix[3][1]);
350  &(rctf){
351  .xmin = 0,
352  .ymin = 0,
353  .xmax = 1,
354  .ymax = 1,
355  },
356  border,
357  border);
358 
359  if (viewgroup->is_camera) {
361  }
362 }
363 
365 {
367 
368  /* This is just so the border isn't always in the way,
369  * stealing mouse clicks from regular usage.
370  * We could change the rules for when to show. */
371  {
372  ViewLayer *view_layer = CTX_data_view_layer(C);
373  if (scene->camera != OBACT(view_layer)) {
374  return false;
375  }
376  }
377 
378  View3D *v3d = CTX_wm_view3d(C);
380  return false;
381  }
382 
383  ARegion *region = CTX_wm_region(C);
384  RegionView3D *rv3d = region->regiondata;
385  if (rv3d->persp == RV3D_CAMOB) {
386  if (scene->r.mode & R_BORDER) {
387  /* TODO: support overrides. */
389  return true;
390  }
391  }
392  }
393  else if (v3d->flag2 & V3D_RENDER_BORDER) {
394  return true;
395  }
396  return false;
397 }
398 
400 {
401  struct CameraViewWidgetGroup *viewgroup = MEM_mallocN(sizeof(struct CameraViewWidgetGroup),
402  __func__);
403 
404  viewgroup->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, NULL);
405 
406  RNA_enum_set(viewgroup->border->ptr,
407  "transform",
409  /* Box style is more subtle in this case. */
410  RNA_enum_set(viewgroup->border->ptr, "draw_style", ED_GIZMO_CAGE2D_STYLE_BOX);
411 
412  WM_gizmo_set_scale(viewgroup->border, 10.0f / 0.15f);
413 
414  gzgroup->customdata = viewgroup;
415 }
416 
418 {
419  struct CameraViewWidgetGroup *viewgroup = gzgroup->customdata;
420 
421  ARegion *region = CTX_wm_region(C);
422  /* Drawing code should happen with fully evaluated graph. */
424  RegionView3D *rv3d = region->regiondata;
425  if (rv3d->persp == RV3D_CAMOB) {
427  View3D *v3d = CTX_wm_view3d(C);
429  scene, depsgraph, region, v3d, rv3d, &viewgroup->state.view_border, false);
430  }
431  else {
432  viewgroup->state.view_border = (rctf){
433  .xmin = 0,
434  .ymin = 0,
435  .xmax = region->winx,
436  .ymax = region->winy,
437  };
438  }
439 
440  wmGizmo *gz = viewgroup->border;
441  unit_m4(gz->matrix_space);
444  gz->matrix_space[3][0] = viewgroup->state.view_border.xmin;
445  gz->matrix_space[3][1] = viewgroup->state.view_border.ymin;
446 }
447 
449 {
450  struct CameraViewWidgetGroup *viewgroup = gzgroup->customdata;
451 
452  View3D *v3d = CTX_wm_view3d(C);
453  ARegion *region = CTX_wm_region(C);
454  RegionView3D *rv3d = region->regiondata;
456 
457  viewgroup->scene = scene;
458 
459  {
460  wmGizmo *gz = viewgroup->border;
462 
463  RNA_enum_set(viewgroup->border->ptr,
464  "transform",
466 
467  if (rv3d->persp == RV3D_CAMOB) {
468  viewgroup->state.edit_border = &scene->r.border;
469  viewgroup->is_camera = true;
470  }
471  else {
472  viewgroup->state.edit_border = &v3d->render_border;
473  viewgroup->is_camera = false;
474  }
475 
477  "matrix",
478  &(const struct wmGizmoPropertyFnParams){
479  .value_get_fn = gizmo_render_border_prop_matrix_get,
480  .value_set_fn = gizmo_render_border_prop_matrix_set,
481  .range_get_fn = NULL,
482  .user_data = viewgroup,
483  });
484  }
485 }
486 
488 {
489  gzgt->name = "Camera View Widgets";
490  gzgt->idname = "VIEW3D_GGT_camera_view";
491 
493 
498 }
499 
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:236
int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
Definition: camera.c:246
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:784
struct Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
Definition: context.c:1519
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
bool BKE_id_is_editable(const struct Main *bmain, const struct ID *id)
#define BLI_assert(a)
Definition: BLI_assert.h:46
void unit_m4(float m[4][4])
Definition: rct.c:1090
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:181
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:177
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
Definition: rct.c:580
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
Definition: BLI_rect.h:194
void BLI_rctf_resize(struct rctf *rect, float x, float y)
Definition: rct.c:635
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
#define ARRAY_SIZE(arr)
#define UNUSED(x)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ CAM_SHOWLIMITS
@ CAMERA_SENSOR_FIT_HOR
@ CAM_ORTHO
@ 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
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_CONTEXT
#define V3D_RENDER_BORDER
@ ED_GIZMO_CAGE2D_STYLE_BOX
@ ED_GIZMO_ARROW_XFORM_FLAG_CONSTRAINED
@ ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE
@ ED_GIZMO_ARROW_STYLE_CROSS
@ ED_GIZMO_ARROW_STYLE_CONE
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, bool no_shift)
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 Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise 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:25
void UI_GetThemeColor3fv(int colorid, float col[3])
Definition: resources.c:1165
@ TH_GIZMO_HI
Definition: UI_resources.h:304
@ TH_GIZMO_A
Definition: UI_resources.h:308
@ TH_GIZMO_PRIMARY
Definition: UI_resources.h:305
@ 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
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
Definition: rna_access.c:136
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:112
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
Definition: rna_access.c:1311
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:717
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:5015
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
Definition: rna_access.c:4992
#define min(a, b)
Definition: sort.c:35
void * regiondata
struct Object * object
struct CameraViewWidgetGroup::@561 state
char sensor_fit
float sensor_y
float shiftx
float sensor_x
short flag
float shifty
float drawsize
struct CameraDOFSettings dof
float ortho_scale
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:69
float ymin
Definition: DNA_vec_types.h:70
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
const struct wmGizmoPropertyType * type
struct wmGizmoProperty::@1185 custom_func
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:299
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:278
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:81
void WM_gizmo_set_scale(wmGizmo *gz, const float scale)
Definition: wm_gizmo.c:314
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
Definition: wm_gizmo.c:284
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
Definition: wm_gizmo.c:304
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
Definition: wm_gizmo.c:94
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:45
#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)