Blender  V3.3
gpencil_trace_ops.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 
8 #include "MEM_guardedalloc.h"
9 
10 #include "BLI_math.h"
11 
12 #include "BLT_translation.h"
13 
14 #include "DNA_gpencil_types.h"
15 #include "DNA_scene_types.h"
16 #include "DNA_screen_types.h"
17 
18 #include "BKE_context.h"
19 #include "BKE_global.h"
20 #include "BKE_gpencil.h"
21 #include "BKE_image.h"
22 #include "BKE_layer.h"
23 #include "BKE_lib_id.h"
24 #include "BKE_main.h"
25 #include "BKE_object.h"
26 #include "BKE_report.h"
27 
28 #include "DEG_depsgraph.h"
29 #include "DEG_depsgraph_query.h"
30 
31 #include "WM_api.h"
32 #include "WM_types.h"
33 
34 #include "RNA_access.h"
35 #include "RNA_define.h"
36 
37 #include "IMB_imbuf_types.h"
38 
39 #include "ED_gpencil.h"
40 #include "ED_object.h"
41 
42 #include "gpencil_intern.h"
43 #include "gpencil_trace.h"
44 
45 typedef struct TraceJob {
46  /* from wmJob */
47  struct Object *owner;
48  short *stop, *do_update;
49  float *progress;
50 
62 
65 
67  float threshold;
68  float scale;
69  float sample;
77 
78  bool success;
81 
87 static bool gpencil_trace_image(TraceJob *trace_job, ImBuf *ibuf, bGPDframe *gpf)
88 {
89  potrace_bitmap_t *bm = NULL;
90  potrace_param_t *param = NULL;
91  potrace_state_t *st = NULL;
92 
93  /* Create an empty BW bitmap. */
94  bm = ED_gpencil_trace_bitmap_new(ibuf->x, ibuf->y);
95  if (!bm) {
96  return false;
97  }
98 
99  /* Set tracing parameters, starting from defaults */
100  param = potrace_param_default();
101  if (!param) {
102  return false;
103  }
104  param->turdsize = 0;
105  param->turnpolicy = trace_job->turnpolicy;
106 
107  /* Load BW bitmap with image. */
108  ED_gpencil_trace_image_to_bitmap(ibuf, bm, trace_job->threshold);
109 
110  /* Trace the bitmap. */
111  st = potrace_trace(param, bm);
112  if (!st || st->status != POTRACE_STATUS_OK) {
114  if (st) {
115  potrace_state_free(st);
116  }
117  potrace_param_free(param);
118  return false;
119  }
120  /* Free BW bitmap. */
122 
123  /* Convert the trace to strokes. */
124  int32_t offset[2];
125  offset[0] = ibuf->x / 2;
126  offset[1] = ibuf->y / 2;
127 
128  /* Scale correction for Potrace.
129  * Really, there isn't documented in Potrace about how the scale is calculated,
130  * but after doing a lot of tests, it looks is using a VGA resolution (640) as a base.
131  * Maybe there are others ways to get the right scale conversion, but this solution works. */
132  float scale_potrace = trace_job->scale * (640.0f / (float)ibuf->x) *
133  ((float)ibuf->x / (float)ibuf->y);
134  if (ibuf->x > ibuf->y) {
135  scale_potrace *= (float)ibuf->y / (float)ibuf->x;
136  }
137 
139  st,
140  trace_job->ob_gpencil,
141  gpf,
142  offset,
143  scale_potrace,
144  trace_job->sample,
145  trace_job->resolution,
146  trace_job->thickness);
147 
148  /* Free memory. */
149  potrace_state_free(st);
150  potrace_param_free(param);
151 
152  return true;
153 }
154 
155 /* Trace Image to Grease Pencil. */
157 {
159  if ((ob == NULL) || (ob->type != OB_EMPTY) || (ob->data == NULL)) {
160  CTX_wm_operator_poll_msg_set(C, "No image empty selected");
161  return false;
162  }
163 
164  Image *image = (Image *)ob->data;
166  CTX_wm_operator_poll_msg_set(C, "No valid image format selected");
167  return false;
168  }
169 
170  return true;
171 }
172 
173 static void trace_initialize_job_data(TraceJob *trace_job)
174 {
175  /* Create a new grease pencil object. */
176  if (trace_job->ob_gpencil == NULL) {
177  ushort local_view_bits = (trace_job->v3d && trace_job->v3d->localvd) ?
178  trace_job->v3d->local_view_uuid :
179  0;
180  trace_job->ob_gpencil = ED_gpencil_add_object(
181  trace_job->C, trace_job->ob_active->loc, local_view_bits);
182  /* Apply image rotation. */
183  copy_v3_v3(trace_job->ob_gpencil->rot, trace_job->ob_active->rot);
184  /* Grease pencil is rotated 90 degrees in X axis by default. */
185  trace_job->ob_gpencil->rot[0] -= DEG2RADF(90.0f);
186  trace_job->was_ob_created = true;
187  /* Apply image Scale. */
188  copy_v3_v3(trace_job->ob_gpencil->scale, trace_job->ob_active->scale);
189  /* The default display size of the image is 5.0 and this is used as scale = 1.0. */
190  mul_v3_fl(trace_job->ob_gpencil->scale, trace_job->ob_active->empty_drawsize / 5.0f);
191  }
192 
193  /* Create Layer. */
194  trace_job->gpd = (bGPdata *)trace_job->ob_gpencil->data;
195  trace_job->gpl = BKE_gpencil_layer_active_get(trace_job->gpd);
196  if (trace_job->gpl == NULL) {
197  trace_job->gpl = BKE_gpencil_layer_addnew(trace_job->gpd, DATA_("Trace"), true, false);
198  }
199 }
200 
201 static void trace_start_job(void *customdata, short *stop, short *do_update, float *progress)
202 {
203  TraceJob *trace_job = customdata;
204 
205  trace_job->stop = stop;
206  trace_job->do_update = do_update;
207  trace_job->progress = progress;
208  trace_job->was_canceled = false;
209  const int init_frame = max_ii((trace_job->use_current_frame) ? trace_job->frame_target : 0, 0);
210 
211  G.is_break = false;
212 
213  /* Single Image. */
214  if ((trace_job->image->source == IMA_SRC_FILE) ||
215  (trace_job->mode == GPENCIL_TRACE_MODE_SINGLE)) {
216  void *lock;
217  ImageUser *iuser = trace_job->ob_active->iuser;
218 
219  iuser->framenr = ((trace_job->frame_num == 0) || (trace_job->frame_num > iuser->frames)) ?
220  init_frame :
221  trace_job->frame_num;
222  ImBuf *ibuf = BKE_image_acquire_ibuf(trace_job->image, iuser, &lock);
223  if (ibuf) {
224  /* Create frame. */
226  trace_job->gpl, trace_job->frame_target, GP_GETFRAME_ADD_NEW);
227  gpencil_trace_image(trace_job, ibuf, gpf);
228  BKE_image_release_ibuf(trace_job->image, ibuf, lock);
229  *(trace_job->progress) = 1.0f;
230  }
231  }
232  /* Image sequence. */
233  else if (trace_job->image->type == IMA_TYPE_IMAGE) {
234  ImageUser *iuser = trace_job->ob_active->iuser;
235  for (int i = init_frame; i <= iuser->frames; i++) {
236  if (G.is_break) {
237  trace_job->was_canceled = true;
238  break;
239  }
240 
241  *(trace_job->progress) = (float)i / (float)iuser->frames;
242  *do_update = true;
243 
244  iuser->framenr = i;
245 
246  void *lock;
247  ImBuf *ibuf = BKE_image_acquire_ibuf(trace_job->image, iuser, &lock);
248  if (ibuf) {
249  /* Create frame. */
251  gpencil_trace_image(trace_job, ibuf, gpf);
252 
253  BKE_image_release_ibuf(trace_job->image, ibuf, lock);
254  }
255  }
256  }
257 
258  trace_job->success = !trace_job->was_canceled;
259  *do_update = true;
260  *stop = 0;
261 }
262 
263 static void trace_end_job(void *customdata)
264 {
265  TraceJob *trace_job = customdata;
266 
267  /* If canceled, delete all previously created object and data-block. */
268  if ((trace_job->was_canceled) && (trace_job->was_ob_created) && (trace_job->ob_gpencil)) {
269  bGPdata *gpd = trace_job->ob_gpencil->data;
270  BKE_id_delete(trace_job->bmain, &trace_job->ob_gpencil->id);
271  BKE_id_delete(trace_job->bmain, &gpd->id);
272  }
273 
274  if (trace_job->success) {
275  DEG_relations_tag_update(trace_job->bmain);
276 
279 
282  }
283 }
284 
285 static void trace_free_job(void *customdata)
286 {
287  TraceJob *tj = customdata;
288  MEM_freeN(tj);
289 }
290 
292 {
293  TraceJob *job = MEM_mallocN(sizeof(TraceJob), "TraceJob");
294  job->C = C;
296  job->wm = CTX_wm_manager(C);
297  job->bmain = CTX_data_main(C);
299  job->scene = scene;
300  job->v3d = CTX_wm_view3d(C);
302  job->ob_active = job->base_active->object;
303  job->image = (Image *)job->ob_active->data;
304  job->frame_target = scene->r.cfra;
305  job->use_current_frame = RNA_boolean_get(op->ptr, "use_current_frame");
306 
307  /* Create a new grease pencil object or reuse selected. */
308  eGP_TargetObjectMode target = RNA_enum_get(op->ptr, "target");
310  CTX_data_view_layer(C), job->v3d) :
311  NULL;
312 
313  if (job->ob_gpencil != NULL) {
314  if (job->ob_gpencil->type != OB_GPENCIL) {
315  BKE_report(op->reports, RPT_WARNING, "Target object not a grease pencil, ignoring!");
316  job->ob_gpencil = NULL;
317  }
318  else if (BKE_object_obdata_is_libdata(job->ob_gpencil)) {
319  BKE_report(op->reports, RPT_WARNING, "Target object library-data, ignoring!");
320  job->ob_gpencil = NULL;
321  }
322  }
323 
324  job->was_ob_created = false;
325 
326  job->threshold = RNA_float_get(op->ptr, "threshold");
327  job->scale = RNA_float_get(op->ptr, "scale");
328  job->sample = RNA_float_get(op->ptr, "sample");
329  job->resolution = RNA_int_get(op->ptr, "resolution");
330  job->thickness = RNA_int_get(op->ptr, "thickness");
331  job->turnpolicy = RNA_enum_get(op->ptr, "turnpolicy");
332  job->mode = RNA_enum_get(op->ptr, "mode");
333  job->frame_num = RNA_int_get(op->ptr, "frame_number");
334 
336 
337  /* Back to active base. */
339 
340  if ((job->image->source == IMA_SRC_FILE) || (job->frame_num > 0)) {
341  short stop = 0, do_update = true;
342  float progress;
343  trace_start_job(job, &stop, &do_update, &progress);
344  trace_end_job(job);
345  trace_free_job(job);
346  }
347  else {
348  wmJob *wm_job = WM_jobs_get(job->wm,
349  CTX_wm_window(C),
350  job->scene,
351  "Trace Image",
354 
356  WM_jobs_timer(wm_job, 0.1, NC_GEOM | ND_DATA, NC_GEOM | ND_DATA);
358 
359  WM_jobs_start(CTX_wm_manager(C), wm_job);
360  }
361 
362  return OPERATOR_FINISHED;
363 }
364 
366 {
367  /* Show popup dialog to allow editing. */
368  /* FIXME: hard-coded dimensions here are just arbitrary. */
369  return WM_operator_props_dialog_popup(C, op, 250);
370 }
371 
373 {
374  PropertyRNA *prop;
375 
376  static const EnumPropertyItem turnpolicy_type[] = {
377  {POTRACE_TURNPOLICY_BLACK,
378  "BLACK",
379  0,
380  "Black",
381  "Prefers to connect black (foreground) components"},
382  {POTRACE_TURNPOLICY_WHITE,
383  "WHITE",
384  0,
385  "White",
386  "Prefers to connect white (background) components"},
387  {POTRACE_TURNPOLICY_LEFT, "LEFT", 0, "Left", "Always take a left turn"},
388  {POTRACE_TURNPOLICY_RIGHT, "RIGHT", 0, "Right", "Always take a right turn"},
389  {POTRACE_TURNPOLICY_MINORITY,
390  "MINORITY",
391  0,
392  "Minority",
393  "Prefers to connect the color (black or white) that occurs least frequently in the local "
394  "neighborhood of the current position"},
395  {POTRACE_TURNPOLICY_MAJORITY,
396  "MAJORITY",
397  0,
398  "Majority",
399  "Prefers to connect the color (black or white) that occurs most frequently in the local "
400  "neighborhood of the current position"},
401  {POTRACE_TURNPOLICY_RANDOM, "RANDOM", 0, "Random", "Choose pseudo-randomly"},
402  {0, NULL, 0, NULL, NULL},
403  };
404 
405  static const EnumPropertyItem trace_modes[] = {
406  {GPENCIL_TRACE_MODE_SINGLE, "SINGLE", 0, "Single", "Trace the current frame of the image"},
407  {GPENCIL_TRACE_MODE_SEQUENCE, "SEQUENCE", 0, "Sequence", "Trace full sequence"},
408  {0, NULL, 0, NULL, NULL},
409  };
410 
411  static const EnumPropertyItem target_object_modes[] = {
412  {GP_TARGET_OB_NEW, "NEW", 0, "New Object", ""},
413  {GP_TARGET_OB_SELECTED, "SELECTED", 0, "Selected Object", ""},
414  {0, NULL, 0, NULL, NULL},
415  };
416 
417  /* identifiers */
418  ot->name = "Trace Image to Grease Pencil";
419  ot->idname = "GPENCIL_OT_trace_image";
420  ot->description = "Extract Grease Pencil strokes from image";
421 
422  /* callbacks */
426 
427  /* flags */
429 
430  /* properties */
431  ot->prop = RNA_def_enum(ot->srna,
432  "target",
433  target_object_modes,
435  "Target Object",
436  "Target grease pencil");
438 
439  RNA_def_int(ot->srna, "thickness", 10, 1, 1000, "Thickness", "", 1, 1000);
440  RNA_def_int(
441  ot->srna, "resolution", 5, 1, 20, "Resolution", "Resolution of the generated curves", 1, 20);
442 
444  "scale",
445  1.0f,
446  0.001f,
447  100.0f,
448  "Scale",
449  "Scale of the final stroke",
450  0.001f,
451  100.0f);
453  "sample",
454  0.0f,
455  0.0f,
456  100.0f,
457  "Sample",
458  "Distance to sample points, zero to disable",
459  0.0f,
460  100.0f);
462  "threshold",
463  0.5f,
464  0.0f,
465  1.0f,
466  "Color Threshold",
467  "Determine the lightness threshold above which strokes are generated",
468  0.0f,
469  1.0f);
471  "turnpolicy",
472  turnpolicy_type,
473  POTRACE_TURNPOLICY_MINORITY,
474  "Turn Policy",
475  "Determines how to resolve ambiguities during decomposition of bitmaps into paths");
477  "mode",
478  trace_modes,
480  "Mode",
481  "Determines if trace simple image or full sequence");
483  "use_current_frame",
484  true,
485  "Start At Current Frame",
486  "Trace Image starting in current image frame");
487  prop = RNA_def_int(
488  ot->srna,
489  "frame_number",
490  0,
491  0,
492  9999,
493  "Trace Frame",
494  "Used to trace only one frame of the image sequence, set to zero to trace all",
495  0,
496  9999);
498 }
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct Base * CTX_data_active_base(const bContext *C)
Definition: context.c:1358
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
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
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
Definition: context.c:1042
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1558
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
Definition: gpencil.c:621
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
Definition: gpencil.c:1232
@ GP_GETFRAME_ADD_NEW
Definition: BKE_gpencil.h:341
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct Object * BKE_view_layer_non_active_selected_object(struct ViewLayer *view_layer, const struct View3D *v3d)
Definition: layer_utils.c:186
void BKE_id_delete(struct Main *bmain, void *idv) ATTR_NONNULL()
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
MINLINE int max_ii(int a, int b)
#define DEG2RADF(_deg)
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
unsigned short ushort
Definition: BLI_sys_types.h:68
#define UNUSED(x)
#define ELEM(...)
#define DATA_(msgid)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_SELECT
Definition: DNA_ID.h:818
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ IMA_SRC_FILE
@ IMA_SRC_MOVIE
@ IMA_SRC_SEQUENCE
@ IMA_TYPE_IMAGE
@ OB_EMPTY
@ OB_GPENCIL
@ 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
void ED_object_base_activate(struct bContext *C, struct Base *base)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
@ PROP_SKIP_SAVE
Definition: RNA_types.h:218
#define C
Definition: RandGen.cpp:25
@ WM_JOB_PROGRESS
Definition: WM_api.h:1339
@ WM_JOB_TYPE_TRACE_IMAGE
Definition: WM_api.h:1372
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_GEOM
Definition: WM_types.h:343
#define ND_OB_ACTIVE
Definition: WM_types.h:388
#define ND_DATA
Definition: WM_types.h:456
#define NC_SCENE
Definition: WM_types.h:328
#define NA_ADDED
Definition: WM_types.h:525
#define NC_OBJECT
Definition: WM_types.h:329
volatile int lock
ATTR_WARN_UNUSED_RESULT BMesh * bm
short type
short source
Scene scene
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img image(1, GPU_R32F, Qualifier::WRITE, ImageType::FLOAT_2D_ARRAY, "out_weight_img") .image(3
void ED_gpencil_trace_data_to_strokes(struct Main *bmain, potrace_state_t *st, struct Object *ob, struct bGPDframe *gpf, int32_t offset[2], float scale, float sample, int32_t resolution, int32_t thickness)
#define GPENCIL_TRACE_MODE_SINGLE
Definition: gpencil_trace.h:43
void ED_gpencil_trace_bitmap_free(const potrace_bitmap_t *bm)
#define GPENCIL_TRACE_MODE_SEQUENCE
Definition: gpencil_trace.h:44
void ED_gpencil_trace_image_to_bitmap(struct ImBuf *ibuf, const potrace_bitmap_t *bm, float threshold)
potrace_bitmap_t * ED_gpencil_trace_bitmap_new(int32_t w, int32_t h)
static bool gpencil_trace_image_poll(bContext *C)
struct TraceJob TraceJob
static bool gpencil_trace_image(TraceJob *trace_job, ImBuf *ibuf, bGPDframe *gpf)
static void trace_free_job(void *customdata)
static int gpencil_trace_image_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void trace_start_job(void *customdata, short *stop, short *do_update, float *progress)
static int gpencil_trace_image_exec(bContext *C, wmOperator *op)
static void trace_end_job(void *customdata)
void GPENCIL_OT_trace_image(wmOperatorType *ot)
static void trace_initialize_job_data(TraceJob *trace_job)
Object * ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
#define G(x, y, z)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
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_float(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:3836
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
PropertyRNA * RNA_def_float_factor(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:4144
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
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_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
signed int int32_t
Definition: stdint.h:77
struct Object * object
Definition: BKE_main.h:121
float loc[3]
float scale[3]
float rot[3]
ImageUser * iuser
float empty_drawsize
void * data
struct RenderData r
bool use_current_frame
bContext * C
int32_t thickness
bGPdata * gpd
int32_t resolution
bool was_ob_created
Scene * scene
float * progress
Image * image
View3D * v3d
Object * ob_active
int32_t mode
int32_t frame_num
Object * ob_gpencil
struct Object * owner
short * do_update
Base * base_active
int32_t turnpolicy
int32_t frame_target
bGPDlayer * gpl
wmWindowManager * wm
short * stop
unsigned short local_view_uuid
struct View3D * localvd
Definition: wm_jobs.c:57
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_main_add_notifier(unsigned int type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3479
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition: wm_jobs.c:437
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
Definition: wm_jobs.c:351
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *))
Definition: wm_jobs.c:323
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)
Definition: wm_jobs.c:339
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, int flag, int job_type)
Definition: wm_jobs.c:184
int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)