Blender  V2.93
object_modes.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 
24 #include "DNA_gpencil_types.h"
25 #include "DNA_object_types.h"
26 #include "DNA_scene_types.h"
27 #include "DNA_workspace_types.h"
28 
29 #include "BLI_kdopbvh.h"
30 #include "BLI_math.h"
31 #include "BLI_utildefines.h"
32 
33 #include "BLT_translation.h"
34 
35 #include "BKE_context.h"
36 #include "BKE_gpencil_modifier.h"
37 #include "BKE_layer.h"
38 #include "BKE_main.h"
39 #include "BKE_modifier.h"
40 #include "BKE_object.h"
41 #include "BKE_paint.h"
42 #include "BKE_report.h"
43 #include "BKE_scene.h"
44 #include "BKE_screen.h"
45 
46 #include "WM_api.h"
47 #include "WM_types.h"
48 
49 #include "RNA_access.h"
50 #include "RNA_define.h"
51 
52 #include "DEG_depsgraph.h"
53 #include "DEG_depsgraph_query.h"
54 
55 #include "ED_armature.h"
56 #include "ED_gpencil.h"
57 #include "ED_screen.h"
59 #include "ED_undo.h"
60 #include "ED_view3d.h"
61 
62 #include "WM_toolsystem.h"
63 
64 #include "ED_object.h" /* own include */
65 #include "object_intern.h"
66 
67 /* -------------------------------------------------------------------- */
71 static const char *object_mode_op_string(eObjectMode mode)
72 {
73  if (mode & OB_MODE_EDIT) {
74  return "OBJECT_OT_editmode_toggle";
75  }
76  if (mode == OB_MODE_SCULPT) {
77  return "SCULPT_OT_sculptmode_toggle";
78  }
79  if (mode == OB_MODE_VERTEX_PAINT) {
80  return "PAINT_OT_vertex_paint_toggle";
81  }
82  if (mode == OB_MODE_WEIGHT_PAINT) {
83  return "PAINT_OT_weight_paint_toggle";
84  }
85  if (mode == OB_MODE_TEXTURE_PAINT) {
86  return "PAINT_OT_texture_paint_toggle";
87  }
88  if (mode == OB_MODE_PARTICLE_EDIT) {
89  return "PARTICLE_OT_particle_edit_toggle";
90  }
91  if (mode == OB_MODE_POSE) {
92  return "OBJECT_OT_posemode_toggle";
93  }
94  if (mode == OB_MODE_EDIT_GPENCIL) {
95  return "GPENCIL_OT_editmode_toggle";
96  }
97  if (mode == OB_MODE_PAINT_GPENCIL) {
98  return "GPENCIL_OT_paintmode_toggle";
99  }
100  if (mode == OB_MODE_SCULPT_GPENCIL) {
101  return "GPENCIL_OT_sculptmode_toggle";
102  }
103  if (mode == OB_MODE_WEIGHT_GPENCIL) {
104  return "GPENCIL_OT_weightmode_toggle";
105  }
106  if (mode == OB_MODE_VERTEX_GPENCIL) {
107  return "GPENCIL_OT_vertexmode_toggle";
108  }
109  return NULL;
110 }
111 
117 {
118  if (ob) {
119  if (mode == OB_MODE_OBJECT) {
120  return true;
121  }
122 
123  switch (ob->type) {
124  case OB_MESH:
127  return true;
128  }
129  break;
130  case OB_CURVE:
131  case OB_SURF:
132  case OB_FONT:
133  case OB_MBALL:
134  if (mode & OB_MODE_EDIT) {
135  return true;
136  }
137  break;
138  case OB_LATTICE:
139  if (mode & (OB_MODE_EDIT | OB_MODE_WEIGHT_PAINT)) {
140  return true;
141  }
142  break;
143  case OB_ARMATURE:
144  if (mode & (OB_MODE_EDIT | OB_MODE_POSE)) {
145  return true;
146  }
147  break;
148  case OB_GPENCIL:
151  return true;
152  }
153  break;
154  }
155  }
156 
157  return false;
158 }
159 
166 {
167  bool ok;
168  if (!ELEM(ob->mode, mode, OB_MODE_OBJECT)) {
169  const char *opstring = object_mode_op_string(ob->mode);
170 
172  ok = ELEM(ob->mode, mode, OB_MODE_OBJECT);
173  if (!ok) {
174  wmOperatorType *ot = WM_operatortype_find(opstring, false);
175  BKE_reportf(reports, RPT_ERROR, "Unable to execute '%s', error changing modes", ot->name);
176  }
177  }
178  else {
179  ok = true;
180  }
181 
182  return ok;
183 }
184 
187 /* -------------------------------------------------------------------- */
195 bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportList *reports)
196 {
198  ViewLayer *view_layer = CTX_data_view_layer(C);
199  Object *ob = OBACT(view_layer);
200  if (ob == NULL) {
201  return (mode == OB_MODE_OBJECT);
202  }
203 
204  if ((ob->type == OB_GPENCIL) && (mode == OB_MODE_EDIT)) {
205  mode = OB_MODE_EDIT_GPENCIL;
206  }
207 
208  if (ob->mode == mode) {
209  return true;
210  }
211 
212  if (!ED_object_mode_compat_test(ob, mode)) {
213  return false;
214  }
215 
216  const char *opstring = object_mode_op_string((mode == OB_MODE_OBJECT) ? ob->mode : mode);
217  wmOperatorType *ot = WM_operatortype_find(opstring, false);
218 
219  if (!use_undo) {
220  wm->op_undo_depth++;
221  }
223  if (!use_undo) {
224  wm->op_undo_depth--;
225  }
226 
227  if (ob->mode != mode) {
228  BKE_reportf(reports, RPT_ERROR, "Unable to execute '%s', error changing modes", ot->name);
229  return false;
230  }
231 
232  return true;
233 }
234 
236 {
237  /* Don't do undo push by default, since this may be called by lower level code. */
238  return ED_object_mode_set_ex(C, mode, true, NULL);
239 }
240 
245 static bool ed_object_mode_generic_exit_ex(struct Main *bmain,
246  struct Depsgraph *depsgraph,
247  struct Scene *scene,
248  struct Object *ob,
249  bool only_test)
250 {
251  BLI_assert((bmain == NULL) == only_test);
252  if (ob->mode & OB_MODE_EDIT) {
253  if (BKE_object_is_in_editmode(ob)) {
254  if (only_test) {
255  return true;
256  }
258  }
259  }
260  else if (ob->mode & OB_MODE_VERTEX_PAINT) {
261  if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_VERTEX_PAINT)) {
262  if (only_test) {
263  return true;
264  }
266  }
267  }
268  else if (ob->mode & OB_MODE_WEIGHT_PAINT) {
269  if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_WEIGHT_PAINT)) {
270  if (only_test) {
271  return true;
272  }
274  }
275  }
276  else if (ob->mode & OB_MODE_SCULPT) {
277  if (ob->sculpt && (ob->sculpt->mode_type == OB_MODE_SCULPT)) {
278  if (only_test) {
279  return true;
280  }
282  }
283  }
284  else if (ob->mode & OB_MODE_POSE) {
285  if (ob->pose != NULL) {
286  if (only_test) {
287  return true;
288  }
289  ED_object_posemode_exit_ex(bmain, ob);
290  }
291  }
292  else if (ob->mode & OB_MODE_TEXTURE_PAINT) {
293  if (only_test) {
294  return true;
295  }
297  }
298  else if (ob->mode & OB_MODE_PARTICLE_EDIT) {
299  if (only_test) {
300  return true;
301  }
303  }
304  else if (ob->type == OB_GPENCIL) {
305  /* Accounted for above. */
306  BLI_assert((ob->mode & OB_MODE_OBJECT) == 0);
307  if (only_test) {
308  return true;
309  }
310  ED_object_gpencil_exit(bmain, ob);
311  }
312  else {
313  if (only_test) {
314  return false;
315  }
316  BLI_assert((ob->mode & OB_MODE_ALL_MODE_DATA) == 0);
317  }
318 
319  return false;
320 }
321 
322 /* When locked, it's almost impossible to select the pose-object
323  * then the mesh-object to enter weight paint mode.
324  * Even when the object mode is not locked this is inconvenient - so allow in either case.
325  *
326  * In this case move our pose object in/out of pose mode.
327  * This is in fits with the convention of selecting multiple objects and entering a mode.
328  */
330  Main *bmain,
331  Object *ob_arm,
332  const bool is_mode_set)
333 {
334  View3D *v3d = CTX_wm_view3d(C);
335  ViewLayer *view_layer = CTX_data_view_layer(C);
336 
337  if (ob_arm != NULL) {
338  const Base *base_arm = BKE_view_layer_base_find(view_layer, ob_arm);
339  if (base_arm && BASE_VISIBLE(v3d, base_arm)) {
340  if (is_mode_set) {
341  if ((ob_arm->mode & OB_MODE_POSE) != 0) {
342  ED_object_posemode_exit_ex(bmain, ob_arm);
343  }
344  }
345  else {
346  /* Only check selected status when entering weight-paint mode
347  * because we may have multiple armature objects.
348  * Selecting one will de-select the other, which would leave it in pose-mode
349  * when exiting weight paint mode. While usable, this looks like inconsistent
350  * behavior from a user perspective. */
351  if (base_arm->flag & BASE_SELECTED) {
352  if ((ob_arm->mode & OB_MODE_POSE) == 0) {
353  ED_object_posemode_enter_ex(bmain, ob_arm);
354  }
355  }
356  }
357  }
358  }
359 }
360 
362  Main *bmain,
363  Object *ob,
364  const bool is_mode_set)
365 {
366  if (ob->type == OB_GPENCIL) {
367  GpencilVirtualModifierData virtualModifierData;
369  &virtualModifierData);
370  for (; md; md = md->next) {
371  if (md->type == eGpencilModifierType_Armature) {
373  Object *ob_arm = amd->object;
374  ed_object_posemode_set_for_weight_paint_ex(C, bmain, ob_arm, is_mode_set);
375  }
376  }
377  }
378  else {
379  VirtualModifierData virtualModifierData;
380  ModifierData *md = BKE_modifiers_get_virtual_modifierlist(ob, &virtualModifierData);
381  for (; md; md = md->next) {
382  if (md->type == eModifierType_Armature) {
384  Object *ob_arm = amd->object;
385  ed_object_posemode_set_for_weight_paint_ex(C, bmain, ob_arm, is_mode_set);
386  }
387  }
388  }
389 }
390 
392  struct Depsgraph *depsgraph,
393  struct Scene *scene,
394  struct Object *ob)
395 {
396  ed_object_mode_generic_exit_ex(bmain, depsgraph, scene, ob, false);
397 }
398 
400 {
402 }
403 
406 /* -------------------------------------------------------------------- */
414 {
415  if (!CTX_wm_region_view3d(C)) {
416  return false;
417  }
418  const Object *ob = CTX_data_active_object(C);
419  return ob && (ob->mode & (OB_MODE_SCULPT));
420 }
421 
422 /* Update the viewport rotation origin to the mouse cursor. */
423 static void object_transfer_mode_reposition_view_pivot(bContext *C, const int mval[2])
424 {
425  ARegion *region = CTX_wm_region(C);
427 
428  float global_loc[3];
429  if (!ED_view3d_autodist_simple(region, mval, global_loc, 0, NULL)) {
430  return;
431  }
433  copy_v3_v3(ups->average_stroke_accum, global_loc);
434  ups->average_stroke_counter = 1;
435  ups->last_stroke_valid = true;
436 }
437 
439 {
441  ViewLayer *view_layer = CTX_data_view_layer(C);
442 
443  if (base_dst == NULL) {
444  return false;
445  }
446 
447  Object *ob_dst = base_dst->object;
448  Object *ob_src = CTX_data_active_object(C);
449 
450  if (ob_dst == ob_src) {
451  return false;
452  }
453 
454  const eObjectMode last_mode = (eObjectMode)ob_src->mode;
455  if (!ED_object_mode_compat_test(ob_dst, last_mode)) {
456  return false;
457  }
458 
459  bool mode_transfered = false;
460 
462 
463  if (ED_object_mode_set_ex(C, OB_MODE_OBJECT, true, op->reports)) {
464  Object *ob_dst_orig = DEG_get_original_object(ob_dst);
465  Base *base = BKE_view_layer_base_find(view_layer, ob_dst_orig);
469 
470  ED_undo_push(C, "Change Active");
471 
472  ob_dst_orig = DEG_get_original_object(ob_dst);
473  ED_object_mode_set_ex(C, last_mode, true, op->reports);
474 
477  mode_transfered = true;
478  }
479 
481  return mode_transfered;
482 }
483 
484 static int object_transfer_mode_modal(bContext *C, wmOperator *op, const wmEvent *event)
485 {
486  switch (event->type) {
487  case LEFTMOUSE:
488  if (event->val == KM_PRESS) {
491 
492  /* This ensures that the click was done in an viewport region. */
493  bScreen *screen = CTX_wm_screen(C);
495  screen, SPACE_VIEW3D, event->x, event->y);
496  if (!region) {
497  return OPERATOR_CANCELLED;
498  }
499 
500  const int mval[2] = {event->x - region->winrct.xmin, event->y - region->winrct.ymin};
501  Base *base_dst = ED_view3d_give_base_under_cursor(C, mval);
502  const bool mode_transfered = object_transfer_mode_to_base(C, op, base_dst);
503  if (!mode_transfered) {
504  return OPERATOR_CANCELLED;
505  }
506 
507  return OPERATOR_FINISHED;
508  }
509  break;
510  case RIGHTMOUSE: {
513  return OPERATOR_CANCELLED;
514  }
515  }
516  return OPERATOR_RUNNING_MODAL;
517 }
518 
519 static int object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
520 {
521  const bool use_eyedropper = RNA_boolean_get(op->ptr, "use_eyedropper");
522  if (use_eyedropper) {
523  ED_workspace_status_text(C, TIP_("Click in the viewport to select an object"));
526  return OPERATOR_RUNNING_MODAL;
527  }
528 
529  Object *ob_src = CTX_data_active_object(C);
530  const eObjectMode src_mode = (eObjectMode)ob_src->mode;
531 
532  Base *base_dst = ED_view3d_give_base_under_cursor(C, event->mval);
533  const bool mode_transfered = object_transfer_mode_to_base(C, op, base_dst);
534  if (!mode_transfered) {
535  return OPERATOR_CANCELLED;
536  }
537 
538  if (src_mode & OB_MODE_ALL_PAINT) {
540  }
541 
542  return OPERATOR_FINISHED;
543 }
544 
546 {
547  /* identifiers */
548  ot->name = "Transfer Mode";
549  ot->idname = "OBJECT_OT_transfer_mode";
550  ot->description =
551  "Switches the active object and assigns the same mode to a new one under the mouse cursor, "
552  "leaving the active mode in the current one";
553 
554  /* api callbacks */
558 
559  /* Undo push is handled by the operator. */
561 
563  "use_eyedropper",
564  false,
565  "Use Eyedropper",
566  "Pick the object to switch to using an eyedropper");
567 }
568 
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1279
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct bScreen * CTX_wm_screen(const bContext *C)
Definition: context.c:709
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct RegionView3D * CTX_wm_region_view3d(const bContext *C)
Definition: context.c:769
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
struct GpencilModifierData * BKE_gpencil_modifiers_get_virtual_modifierlist(const struct Object *ob, struct GpencilVirtualModifierData *data)
void BKE_view_layer_base_deselect_all(struct ViewLayer *view_layer)
Definition: layer.c:403
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
Definition: layer.c:394
void BKE_view_layer_base_select_and_set_active(struct ViewLayer *view_layer, struct Base *selbase)
Definition: layer.c:412
struct ModifierData * BKE_modifiers_get_virtual_modifierlist(const struct Object *ob, struct VirtualModifierData *data)
General operations, lookup, etc. for blender objects.
bool BKE_object_is_in_editmode(const struct Object *ob)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
struct ARegion * BKE_screen_find_main_region_at_xy(struct bScreen *screen, const int space_type, const int x, const int y)
Definition: screen.c:1060
#define BLI_assert(a)
Definition: BLI_assert.h:58
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define ELEM(...)
#define TIP_(msgid)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_id_tag_update(struct ID *id, int flag)
struct Object * DEG_get_original_object(struct Object *object)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:638
@ eGpencilModifierType_Armature
@ BASE_SELECTED
@ eModifierType_Armature
#define OB_MODE_ALL_PAINT
#define OB_MODE_ALL_MODE_DATA
eObjectMode
@ OB_MODE_VERTEX_GPENCIL
@ OB_MODE_EDIT_GPENCIL
@ OB_MODE_PARTICLE_EDIT
@ OB_MODE_EDIT
@ OB_MODE_WEIGHT_PAINT
@ OB_MODE_WEIGHT_GPENCIL
@ OB_MODE_SCULPT
@ OB_MODE_SCULPT_GPENCIL
@ OB_MODE_POSE
@ OB_MODE_TEXTURE_PAINT
@ OB_MODE_OBJECT
@ OB_MODE_VERTEX_PAINT
@ OB_MODE_PAINT_GPENCIL
Object is a sort of wrapper for general info.
@ OB_LATTICE
@ OB_MBALL
@ OB_SURF
@ OB_FONT
@ OB_ARMATURE
@ OB_MESH
@ OB_CURVE
@ OB_GPENCIL
#define OBACT(_view_layer)
#define BASE_VISIBLE(v3d, base)
@ SPACE_VIEW3D
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
void ED_object_vpaintmode_exit_ex(struct Object *ob)
void ED_object_wpaintmode_exit_ex(struct Object *ob)
@ EM_FREEDATA
Definition: ED_object.h:204
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
Definition: object_edit.c:676
void ED_object_texture_paint_mode_exit_ex(struct Main *bmain, struct Scene *scene, Object *ob)
Definition: paint_image.c:1190
void ED_object_particle_edit_mode_exit_ex(struct Scene *scene, Object *ob)
void ED_object_sculptmode_exit_ex(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: sculpt.c:8488
void ED_workspace_status_text(struct bContext *C, const char *str)
Definition: area.c:840
void ED_undo_group_begin(struct bContext *C)
Definition: ed_undo.c:105
void ED_undo_push(struct bContext *C, const char *str)
Definition: ed_undo.c:117
void ED_undo_group_end(struct bContext *C)
Definition: ed_undo.c:111
struct Base * ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2])
bool ED_view3d_autodist_simple(struct ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
#define C
Definition: RandGen.cpp:39
@ OPTYPE_REGISTER
Definition: WM_types.h:153
@ WM_OP_EXEC_REGION_WIN
Definition: WM_types.h:205
#define ND_OB_SELECT
Definition: WM_types.h:342
#define NC_SCENE
Definition: WM_types.h:279
#define KM_PRESS
Definition: WM_types.h:242
Scene scene
const Depsgraph * depsgraph
bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
void ED_object_posemode_set_for_weight_paint(bContext *C, Main *bmain, Object *ob, const bool is_mode_set)
Definition: object_modes.c:361
bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
Definition: object_modes.c:116
bool ED_object_mode_compat_set(bContext *C, Object *ob, eObjectMode mode, ReportList *reports)
Definition: object_modes.c:165
static bool object_transfer_mode_poll(bContext *C)
Definition: object_modes.c:413
static bool ed_object_mode_generic_exit_ex(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, bool only_test)
Definition: object_modes.c:245
static int object_transfer_mode_invoke(bContext *C, wmOperator *op, const wmEvent *event)
Definition: object_modes.c:519
void ED_object_mode_generic_exit(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob)
Definition: object_modes.c:391
static bool object_transfer_mode_to_base(bContext *C, wmOperator *op, Base *base_dst)
Definition: object_modes.c:438
static int object_transfer_mode_modal(bContext *C, wmOperator *op, const wmEvent *event)
Definition: object_modes.c:484
static void ed_object_posemode_set_for_weight_paint_ex(bContext *C, Main *bmain, Object *ob_arm, const bool is_mode_set)
Definition: object_modes.c:329
static void object_transfer_mode_reposition_view_pivot(bContext *C, const int mval[2])
Definition: object_modes.c:423
void OBJECT_OT_transfer_mode(wmOperatorType *ot)
Definition: object_modes.c:545
bool ED_object_mode_generic_has_data(struct Depsgraph *depsgraph, struct Object *ob)
Definition: object_modes.c:399
static const char * object_mode_op_string(eObjectMode mode)
Definition: object_modes.c:71
bool ED_object_mode_set(bContext *C, eObjectMode mode)
Definition: object_modes.c:235
bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportList *reports)
Definition: object_modes.c:195
bool ED_object_posemode_enter_ex(struct Main *bmain, Object *ob)
Definition: pose_edit.c:94
bool ED_object_posemode_exit_ex(struct Main *bmain, Object *ob)
Definition: pose_edit.c:129
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
short flag
struct Object * object
struct GpencilModifierData * next
Definition: BKE_main.h:116
struct ModifierData * next
struct bPose * pose
struct SculptSession * sculpt
struct ToolSettings * toolsettings
eObjectMode mode_type
Definition: BKE_paint.h:600
struct UnifiedPaintSettings unified_paint_settings
int ymin
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int y
Definition: WM_types.h:581
short val
Definition: WM_types.h:579
int mval[2]
Definition: WM_types.h:583
int x
Definition: WM_types.h:581
short type
Definition: WM_types.h:577
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
struct ReportList * reports
struct PointerRNA * ptr
void WM_cursor_modal_set(wmWindow *win, int val)
Definition: wm_cursors.c:207
void WM_cursor_modal_restore(wmWindow *win)
Definition: wm_cursors.c:216
@ WM_CURSOR_EYEDROPPER
Definition: wm_cursors.h:51
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
int WM_operator_name_call(bContext *C, const char *opstring, short context, PointerRNA *properties)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_operator_name_call_ptr(bContext *C, wmOperatorType *ot, short context, PointerRNA *properties)
@ RIGHTMOUSE
@ LEFTMOUSE
wmOperatorType * ot
Definition: wm_files.c:3156
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_toolsystem_update_from_context_view3d(bContext *C)