Blender  V3.3
gpencil_mesh.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. */
3 
9 #include "MEM_guardedalloc.h"
10 
11 #include "BLI_blenlib.h"
12 #include "BLI_ghash.h"
13 #include "BLI_math.h"
14 
15 #include "DNA_anim_types.h"
16 #include "DNA_gpencil_types.h"
17 #include "DNA_scene_types.h"
18 #include "DNA_screen_types.h"
19 
20 #include "BKE_anim_data.h"
21 #include "BKE_context.h"
22 #include "BKE_duplilist.h"
23 #include "BKE_gpencil_geom.h"
24 #include "BKE_layer.h"
25 #include "BKE_main.h"
26 #include "BKE_material.h"
27 #include "BKE_object.h"
28 #include "BKE_report.h"
29 #include "BKE_scene.h"
30 
31 #include "DEG_depsgraph.h"
32 #include "DEG_depsgraph_query.h"
33 
34 #include "WM_api.h"
35 #include "WM_types.h"
36 
37 #include "RNA_access.h"
38 #include "RNA_define.h"
39 
40 #include "ED_gpencil.h"
42 
43 #include "gpencil_intern.h"
44 
45 /* Check frame_end is always > start frame! */
47  struct Scene *UNUSED(scene),
48  struct PointerRNA *ptr)
49 {
50  int frame_start = RNA_int_get(ptr, "frame_start");
51  int frame_end = RNA_int_get(ptr, "frame_end");
52 
53  if (frame_end <= frame_start) {
54  RNA_int_set(ptr, "frame_end", frame_start + 1);
55  }
56 }
57 
58 /* Extract mesh animation to Grease Pencil. */
60 {
62  return false;
63  }
64 
65  /* Only if the current view is 3D View. */
67  return (area && area->spacetype);
68 }
69 
70 struct GpBakeOb {
71  struct GpBakeOb *next, *prev;
72  Object *ob;
73 };
74 
75 /* Get list of keyframes used by selected objects. */
76 static void animdata_keyframe_list_get(ListBase *ob_list,
77  const bool only_selected,
78  GHash *r_keyframes)
79 {
80  /* Loop all objects to get the list of keyframes used. */
81  LISTBASE_FOREACH (GpBakeOb *, elem, ob_list) {
82  Object *ob = elem->ob;
84  if ((adt == nullptr) || (adt->action == nullptr)) {
85  continue;
86  }
87  LISTBASE_FOREACH (FCurve *, fcurve, &adt->action->curves) {
88  int i;
89  BezTriple *bezt;
90  for (i = 0, bezt = fcurve->bezt; i < fcurve->totvert; i++, bezt++) {
91  /* Keyframe number is x value of point. */
92  if ((bezt->f2 & SELECT) || (!only_selected)) {
93  /* Insert only one key for each keyframe number. */
94  int key = (int)bezt->vec[1][0];
95  if (!BLI_ghash_haskey(r_keyframes, POINTER_FROM_INT(key))) {
96  BLI_ghash_insert(r_keyframes, POINTER_FROM_INT(key), POINTER_FROM_INT(key));
97  }
98  }
99  }
100  }
101  }
102 }
103 
105 {
106  GpBakeOb *elem = nullptr;
107  ListBase *lb;
109  LISTBASE_FOREACH (DupliObject *, dob, lb) {
110  if (dob->ob->type != OB_MESH) {
111  continue;
112  }
113  elem = MEM_cnew<GpBakeOb>(__func__);
114  elem->ob = dob->ob;
115  BLI_addtail(list, elem);
116  }
117 
119 }
120 
122 {
123  GpBakeOb *elem = nullptr;
124  bool simple_material = false;
125 
126  /* Add active object. In some files this could not be in selected array. */
127  Object *obact = CTX_data_active_object(C);
128  if (obact == nullptr) {
129  return false;
130  }
131 
132  if (obact->type == OB_MESH) {
133  elem = MEM_cnew<GpBakeOb>(__func__);
134  elem->ob = obact;
135  BLI_addtail(list, elem);
136  }
137  /* Add duplilist. */
138  else if (obact->type == OB_EMPTY) {
139  gpencil_bake_duplilist(depsgraph, scene, obact, list);
140  simple_material |= true;
141  }
142 
143  /* Add other selected objects. */
144  CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
145  if (ob == obact) {
146  continue;
147  }
148  /* Add selected meshes. */
149  if (ob->type == OB_MESH) {
150  elem = MEM_cnew<GpBakeOb>(__func__);
151  elem->ob = ob;
152  BLI_addtail(list, elem);
153  }
154 
155  /* Add duplilist. */
156  if (ob->type == OB_EMPTY) {
157  gpencil_bake_duplilist(depsgraph, scene, obact, list);
158  }
159  }
160  CTX_DATA_END;
161 
162  return simple_material;
163 }
164 
166 {
167  LISTBASE_FOREACH_MUTABLE (GpBakeOb *, elem, list) {
168  MEM_SAFE_FREE(elem);
169  }
170 }
171 
173 {
174  Main *bmain = CTX_data_main(C);
177  View3D *v3d = CTX_wm_view3d(C);
178 
179  ListBase ob_selected_list = {nullptr, nullptr};
180  gpencil_bake_ob_list(C, depsgraph, scene, &ob_selected_list);
181 
182  /* Cannot check this in poll because the active object changes. */
183  if (ob_selected_list.first == nullptr) {
184  BKE_report(op->reports, RPT_INFO, "No valid object selected");
185  gpencil_bake_free_ob_list(&ob_selected_list);
186  return OPERATOR_CANCELLED;
187  }
188 
189  /* Grab all relevant settings. */
190  const int step = RNA_int_get(op->ptr, "step");
191 
192  const int frame_start = (scene->r.sfra > RNA_int_get(op->ptr, "frame_start")) ?
193  scene->r.sfra :
194  RNA_int_get(op->ptr, "frame_start");
195 
196  const int frame_end = (scene->r.efra < RNA_int_get(op->ptr, "frame_end")) ?
197  scene->r.efra :
198  RNA_int_get(op->ptr, "frame_end");
199 
200  const float angle = RNA_float_get(op->ptr, "angle");
201  const int thickness = RNA_int_get(op->ptr, "thickness");
202  const bool use_seams = RNA_boolean_get(op->ptr, "seams");
203  const bool use_faces = RNA_boolean_get(op->ptr, "faces");
204  const bool only_selected = RNA_boolean_get(op->ptr, "only_selected");
205  const float offset = RNA_float_get(op->ptr, "offset");
206  const int frame_offset = RNA_int_get(op->ptr, "frame_target") - frame_start;
207  const eGP_ReprojectModes project_type = (eGP_ReprojectModes)RNA_enum_get(op->ptr,
208  "project_type");
209  const eGP_TargetObjectMode target = (eGP_TargetObjectMode)RNA_enum_get(op->ptr, "target");
210 
211  /* Create a new grease pencil object in origin or reuse selected. */
212  Object *ob_gpencil = nullptr;
213  bool newob = false;
214 
215  if (target == GP_TARGET_OB_SELECTED) {
217  if (ob_gpencil != nullptr) {
218  if (ob_gpencil->type != OB_GPENCIL) {
219  BKE_report(op->reports, RPT_WARNING, "Target object not a grease pencil, ignoring!");
220  ob_gpencil = nullptr;
221  }
222  else if (BKE_object_obdata_is_libdata(ob_gpencil)) {
223  BKE_report(op->reports, RPT_WARNING, "Target object library-data, ignoring!");
224  ob_gpencil = nullptr;
225  }
226  }
227  }
228 
229  if (ob_gpencil == nullptr) {
230  ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
231  const float loc[3] = {0.0f, 0.0f, 0.0f};
232  ob_gpencil = ED_gpencil_add_object(C, loc, local_view_bits);
233  newob = true;
234  }
235 
236  bGPdata *gpd = (bGPdata *)ob_gpencil->data;
237  gpd->draw_mode = (project_type == GP_REPROJECT_KEEP) ? GP_DRAWMODE_3D : GP_DRAWMODE_2D;
238 
239  /* Set cursor to indicate working. */
240  WM_cursor_wait(true);
241 
242  GP_SpaceConversion gsc = {nullptr};
243  SnapObjectContext *sctx = nullptr;
244  if (project_type != GP_REPROJECT_KEEP) {
245  /* Init space conversion stuff. */
247  /* Move the grease pencil object to conversion data. */
248  gsc.ob = ob_gpencil;
249 
250  /* Init snap context for geometry projection. */
252 
253  /* Tag all existing strokes to avoid reprojections. */
254  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
255  LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
256  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
257  gps->flag |= GP_STROKE_TAG;
258  }
259  }
260  }
261  }
262 
263  /* Loop all frame range. */
264  int oldframe = (int)DEG_get_ctime(depsgraph);
265  int key = -1;
266 
267  /* Get list of keyframes. */
268  GHash *keyframe_list = BLI_ghash_int_new(__func__);
269  if (only_selected) {
270  animdata_keyframe_list_get(&ob_selected_list, only_selected, keyframe_list);
271  }
272 
273  for (int i = frame_start; i < frame_end + 1; i++) {
274  key++;
275  /* Jump if not step limit but include last frame always. */
276  if ((key % step != 0) && (i != frame_end)) {
277  continue;
278  }
279 
280  /* Check if frame is in the list of frames to be exported. */
281  if ((only_selected) && (!BLI_ghash_haskey(keyframe_list, POINTER_FROM_INT(i)))) {
282  continue;
283  }
284 
285  /* Move scene to new frame. */
286  scene->r.cfra = i;
288 
289  /* Loop all objects in the list. */
290  LISTBASE_FOREACH (GpBakeOb *, elem, &ob_selected_list) {
291  Object *ob_eval = (Object *)DEG_get_evaluated_object(depsgraph, elem->ob);
292 
293  /* Generate strokes. */
295  depsgraph,
296  scene,
297  ob_gpencil,
298  elem->ob,
299  angle,
300  thickness,
301  offset,
302  ob_eval->obmat,
303  frame_offset,
304  use_seams,
305  use_faces,
306  true);
307 
308  /* Reproject all un-tagged created strokes. */
309  if (project_type != GP_REPROJECT_KEEP) {
310  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
311  bGPDframe *gpf = gpl->actframe;
312  if (gpf == nullptr) {
313  continue;
314  }
315  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
316  if ((gps->flag & GP_STROKE_TAG) == 0) {
318  depsgraph, &gsc, sctx, gpl, gpf, gps, project_type, false);
319  gps->flag |= GP_STROKE_TAG;
320  }
321  }
322  }
323  }
324  }
325  }
326 
327  /* Return scene frame state and DB to original state. */
328  scene->r.cfra = oldframe;
330 
331  /* Remove unused materials. */
332  int actcol = ob_gpencil->actcol;
333  for (int slot = 1; slot <= ob_gpencil->totcol; slot++) {
334  while (slot <= ob_gpencil->totcol && !BKE_object_material_slot_used(ob_gpencil, slot)) {
335  ob_gpencil->actcol = slot;
337 
338  if (actcol >= slot) {
339  actcol--;
340  }
341  }
342  }
343  ob_gpencil->actcol = actcol;
344 
345  /* Untag all strokes. */
346  if (project_type != GP_REPROJECT_KEEP) {
347  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
348  LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
349  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
350  gps->flag &= ~GP_STROKE_TAG;
351  }
352  }
353  }
354  }
355 
356  /* Free memory. */
357  gpencil_bake_free_ob_list(&ob_selected_list);
358  if (sctx != nullptr) {
360  }
361  /* Free temp hash table. */
362  if (keyframe_list != nullptr) {
363  BLI_ghash_free(keyframe_list, nullptr, nullptr);
364  }
365 
366  /* notifiers */
367  if (newob) {
369  }
373 
374  /* Reset cursor. */
375  WM_cursor_wait(false);
376 
377  /* done */
378  return OPERATOR_FINISHED;
379 }
380 
382  wmOperator *op,
383  const wmEvent *UNUSED(event))
384 {
385  /* Show popup dialog to allow editing. */
386  /* FIXME: hard-coded dimensions here are just arbitrary. */
387  return WM_operator_props_dialog_popup(C, op, 250);
388 }
389 
391 {
392  static const EnumPropertyItem target_object_modes[] = {
393  {GP_TARGET_OB_NEW, "NEW", 0, "New Object", ""},
394  {GP_TARGET_OB_SELECTED, "SELECTED", 0, "Selected Object", ""},
395  {0, nullptr, 0, nullptr, nullptr},
396  };
397 
398  PropertyRNA *prop;
399 
400  /* identifiers */
401  ot->name = "Bake Mesh Animation to Grease Pencil";
402  ot->idname = "GPENCIL_OT_bake_mesh_animation";
403  ot->description = "Bake mesh animation to grease pencil strokes";
404 
405  /* callbacks */
409 
410  /* flags */
412 
413  /* properties */
414  ot->prop = RNA_def_enum(ot->srna,
415  "target",
416  target_object_modes,
418  "Target Object",
419  "Target grease pencil");
421 
422  prop = RNA_def_int(
423  ot->srna, "frame_start", 1, 1, 100000, "Start Frame", "The start frame", 1, 100000);
424 
425  prop = RNA_def_int(
426  ot->srna, "frame_end", 250, 1, 100000, "End Frame", "The end frame of animation", 1, 100000);
428 
429  prop = RNA_def_int(ot->srna, "step", 1, 1, 100, "Step", "Step between generated frames", 1, 100);
430 
431  RNA_def_int(ot->srna, "thickness", 1, 1, 100, "Thickness", "", 1, 100);
432 
434  "angle",
435  0,
436  nullptr,
437  DEG2RADF(0.0f),
438  DEG2RADF(180.0f),
439  "Threshold Angle",
440  "Threshold to determine ends of the strokes",
441  DEG2RADF(0.0f),
442  DEG2RADF(180.0f));
444 
446  "offset",
447  0.001f,
448  0.0,
449  100.0,
450  "Stroke Offset",
451  "Offset strokes from fill",
452  0.0,
453  100.00);
454 
455  RNA_def_boolean(ot->srna, "seams", false, "Only Seam Edges", "Convert only seam edges");
456  RNA_def_boolean(ot->srna, "faces", true, "Export Faces", "Export faces as filled strokes");
458  "only_selected",
459  false,
460  "Only Selected Keyframes",
461  "Convert only selected keyframes");
462  RNA_def_int(
463  ot->srna, "frame_target", 1, 1, 100000, "Target Frame", "Destination frame", 1, 100000);
464 
466  "project_type",
469  "Projection Type",
470  "");
471 }
struct AnimData * BKE_animdata_from_id(const struct ID *id)
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:269
@ CTX_MODE_OBJECT
Definition: BKE_context.h:118
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C)
Definition: context.c:1528
struct Object * CTX_data_active_object(const bContext *C)
Definition: context.c:1353
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:784
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
#define CTX_DATA_END
Definition: BKE_context.h:278
enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
Definition: context.c:1228
struct ListBase * object_duplilist(struct Depsgraph *depsgraph, struct Scene *sce, struct Object *ob)
void free_object_duplilist(struct ListBase *lb)
bool BKE_gpencil_convert_mesh(struct Main *bmain, struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob_gp, struct Object *ob_mesh, float angle, int thickness, float offset, const float matrix[4][4], int frame_offset, bool use_seams, bool use_faces, bool use_vgroups)
struct Object * BKE_view_layer_non_active_selected_object(struct ViewLayer *view_layer, const struct View3D *v3d)
Definition: layer_utils.c:186
General operations, lookup, etc. for materials.
bool BKE_object_material_slot_remove(struct Main *bmain, struct Object *ob)
Definition: material.c:1248
bool BKE_object_material_slot_used(struct Object *object, short actcol)
Definition: material.c:452
General operations, lookup, etc. for blender objects.
bool BKE_object_obdata_is_libdata(const struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
Definition: scene.cc:2728
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:822
GHash * BLI_ghash_int_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:710
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:863
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
Definition: BLI_listbase.h:354
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
#define DEG2RADF(_deg)
unsigned short ushort
Definition: BLI_sys_types.h:68
#define POINTER_FROM_INT(i)
#define UNUSED(x)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
float DEG_get_ctime(const Depsgraph *graph)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ ID_RECALC_SELECT
Definition: DNA_ID.h:818
@ GP_DRAWMODE_3D
@ GP_DRAWMODE_2D
@ GP_STROKE_TAG
@ OB_EMPTY
@ OB_MESH
@ OB_GPENCIL
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
eGP_TargetObjectMode
Definition: ED_gpencil.h:68
@ GP_TARGET_OB_SELECTED
Definition: ED_gpencil.h:70
@ GP_TARGET_OB_NEW
Definition: ED_gpencil.h:69
eGP_ReprojectModes
Definition: ED_gpencil.h:52
@ GP_REPROJECT_VIEW
Definition: ED_gpencil.h:58
@ GP_REPROJECT_KEEP
Definition: ED_gpencil.h:64
SnapObjectContext * ED_transform_snap_object_context_create(struct Scene *scene, int flag)
void ED_transform_snap_object_context_destroy(SnapObjectContext *sctx)
Read Guarded memory(de)allocation.
#define MEM_SAFE_FREE(v)
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
#define C
Definition: RandGen.cpp:25
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define ND_OB_ACTIVE
Definition: WM_types.h:388
#define NC_SCENE
Definition: WM_types.h:328
#define NA_ADDED
Definition: WM_types.h:525
#define NC_OBJECT
Definition: WM_types.h:329
int main(int argc, char *argv[])
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
#define SELECT
Scene scene
const Depsgraph * depsgraph
const EnumPropertyItem rna_gpencil_reproject_type_items[]
void gpencil_point_conversion_init(struct bContext *C, GP_SpaceConversion *r_gsc)
static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
static void gpencil_bake_free_ob_list(ListBase *list)
static bool gpencil_bake_mesh_animation_poll(bContext *C)
Definition: gpencil_mesh.cc:59
static void animdata_keyframe_list_get(ListBase *ob_list, const bool only_selected, GHash *r_keyframes)
Definition: gpencil_mesh.cc:76
static void gpencil_bake_set_frame_end(struct Main *UNUSED(main), struct Scene *UNUSED(scene), struct PointerRNA *ptr)
Definition: gpencil_mesh.cc:46
static int gpencil_bake_mesh_animation_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
void GPENCIL_OT_bake_mesh_animation(wmOperatorType *ot)
static void gpencil_bake_duplilist(Depsgraph *depsgraph, Scene *scene, Object *ob, ListBase *list)
static bool gpencil_bake_ob_list(bContext *C, Depsgraph *depsgraph, Scene *scene, ListBase *list)
Object * ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits)
void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, const GP_SpaceConversion *gsc, SnapObjectContext *sctx, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps, const eGP_ReprojectModes mode, const bool keep_original)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static void area(int d1, int d2, int e1, int e2, float weights[2])
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:4921
int RNA_int_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4910
float RNA_float_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4957
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:5004
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
PropertyRNA * RNA_def_float_distance(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4052
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_update_runtime(PropertyRNA *prop, const void *func)
Definition: rna_define.c:2911
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
PropertyRNA * RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:4016
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
bAction * action
float vec[3][3]
uint8_t f2
struct Object * ob
struct GpBakeOb * prev
struct GpBakeOb * next
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
float obmat[4][4]
struct RenderData r
unsigned short local_view_uuid
struct View3D * localvd
ListBase curves
ListBase strokes
ListBase layers
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
struct StructRNA * srna
Definition: WM_types.h:969
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
PropertyRNA * prop
Definition: WM_types.h:981
struct ReportList * reports
struct PointerRNA * ptr
void WM_cursor_wait(bool val)
Definition: wm_cursors.c:209
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480
wmOperatorType * ot
Definition: wm_files.c:3479
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)