Blender  V2.93
object_bake.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  * The Original Code is Copyright (C) 2004 by Blender Foundation
17  * All rights reserved.
18  */
19 
24 #include <string.h>
25 
26 #include "MEM_guardedalloc.h"
27 
28 #include "DNA_material_types.h"
29 #include "DNA_mesh_types.h"
30 #include "DNA_meshdata_types.h"
31 #include "DNA_object_types.h"
32 #include "DNA_scene_types.h"
33 #include "DNA_screen_types.h"
34 #include "DNA_space_types.h"
35 #include "DNA_world_types.h"
36 
37 #include "BLI_blenlib.h"
38 #include "BLI_utildefines.h"
39 
40 #include "BKE_DerivedMesh.h"
41 #include "BKE_blender.h"
42 #include "BKE_cdderivedmesh.h"
43 #include "BKE_context.h"
44 #include "BKE_global.h"
45 #include "BKE_image.h"
46 #include "BKE_material.h"
47 #include "BKE_mesh.h"
48 #include "BKE_modifier.h"
49 #include "BKE_multires.h"
50 #include "BKE_report.h"
51 #include "BKE_scene.h"
52 
53 #include "DEG_depsgraph.h"
54 
55 #include "RE_multires_bake.h"
56 #include "RE_pipeline.h"
57 #include "RE_texture.h"
58 
59 #include "PIL_time.h"
60 
61 #include "IMB_imbuf.h"
62 #include "IMB_imbuf_types.h"
63 
64 #include "WM_api.h"
65 #include "WM_types.h"
66 
67 #include "ED_object.h"
68 #include "ED_screen.h"
69 #include "ED_uvedit.h"
70 
71 #include "object_intern.h"
72 
73 static Image *bake_object_image_get(Object *ob, int mat_nr)
74 {
75  Image *image = NULL;
76  ED_object_get_active_image(ob, mat_nr + 1, &image, NULL, NULL, NULL);
77  return image;
78 }
79 
81 {
82  Image **image_array = MEM_mallocN(sizeof(Material *) * ob->totcol, __func__);
83  for (int i = 0; i < ob->totcol; i++) {
84  image_array[i] = bake_object_image_get(ob, i);
85  }
86  return image_array;
87 }
88 
89 /* ****************** multires BAKING ********************** */
90 
91 /* holder of per-object data needed for bake job
92  * needed to make job totally thread-safe */
93 typedef struct MultiresBakerJobData {
95  /* material aligned image array (for per-face bake image) */
96  struct {
98  int len;
101  int lvl, tot_lvl;
104 
105 /* data passing to multires-baker job */
106 typedef struct {
114  short mode;
120  float bias;
122  int threads;
124  float user_scale;
126 
128 {
130  Object *ob;
131  Mesh *me;
133  bool ok = true;
134  int a;
135 
136  CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
137  ob = base->object;
138 
139  if (ob->type != OB_MESH) {
140  BKE_report(
141  op->reports, RPT_ERROR, "Baking of multires data only works with an active mesh object");
142 
143  ok = false;
144  break;
145  }
146 
147  me = (Mesh *)ob->data;
148  mmd = get_multires_modifier(scene, ob, 0);
149 
150  /* Multi-resolution should be and be last in the stack */
151  if (ok && mmd) {
152  ModifierData *md;
153 
154  ok = mmd->totlvl > 0;
155 
156  for (md = (ModifierData *)mmd->modifier.next; md && ok; md = md->next) {
158  ok = false;
159  }
160  }
161  }
162  else {
163  ok = false;
164  }
165 
166  if (!ok) {
167  BKE_report(op->reports, RPT_ERROR, "Multires data baking requires multi-resolution object");
168 
169  break;
170  }
171 
172  if (!me->mloopuv) {
173  BKE_report(op->reports, RPT_ERROR, "Mesh should be unwrapped before multires data baking");
174 
175  ok = false;
176  }
177  else {
178  a = me->totpoly;
179  while (ok && a--) {
180  Image *ima = bake_object_image_get(ob, me->mpoly[a].mat_nr);
181 
182  if (!ima) {
183  BKE_report(
184  op->reports, RPT_ERROR, "You should have active texture to use multires baker");
185 
186  ok = false;
187  }
188  else {
189  ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
190 
191  if (!ibuf) {
192  BKE_report(op->reports, RPT_ERROR, "Baking should happen to image with image buffer");
193 
194  ok = false;
195  }
196  else {
197  if (ibuf->rect == NULL && ibuf->rect_float == NULL) {
198  ok = false;
199  }
200 
201  if (ibuf->rect_float && !(ibuf->channels == 0 || ibuf->channels == 4)) {
202  ok = false;
203  }
204 
205  if (!ok) {
206  BKE_report(op->reports, RPT_ERROR, "Baking to unsupported image type");
207  }
208  }
209 
210  BKE_image_release_ibuf(ima, ibuf, NULL);
211  }
212  }
213  }
214 
215  if (!ok) {
216  break;
217  }
218  }
219  CTX_DATA_END;
220 
221  return ok;
222 }
223 
225 {
226  DerivedMesh *dm;
228  Mesh *me = (Mesh *)ob->data;
229  MultiresModifierData tmp_mmd = *mmd;
230  DerivedMesh *cddm = CDDM_from_mesh(me);
231 
233 
234  if (mmd->lvl == 0) {
235  dm = CDDM_copy(cddm);
236  }
237  else {
238  tmp_mmd.lvl = mmd->lvl;
239  tmp_mmd.sculptlvl = mmd->lvl;
240  dm = multires_make_derived_from_derived(cddm, &tmp_mmd, scene, ob, 0);
241  }
242 
243  cddm->release(cddm);
244 
245  *lvl = mmd->lvl;
246 
247  return dm;
248 }
249 
251 {
252  Mesh *me = (Mesh *)ob->data;
254  MultiresModifierData tmp_mmd = *mmd;
255  DerivedMesh *cddm = CDDM_from_mesh(me);
256  DerivedMesh *dm;
257 
259 
260  /* TODO: DM_set_only_copy wouldn't set mask for loop and poly data,
261  * but we really need BAREMESH only to save lots of memory
262  */
265 
266  *lvl = mmd->totlvl;
267 
268  tmp_mmd.lvl = mmd->totlvl;
269  tmp_mmd.sculptlvl = mmd->totlvl;
270  dm = multires_make_derived_from_derived(cddm, &tmp_mmd, scene, ob, 0);
271  cddm->release(cddm);
272 
273  return dm;
274 }
275 
276 typedef enum ClearFlag {
280 
281 static void clear_single_image(Image *image, ClearFlag flag)
282 {
283  const float vec_alpha[4] = {0.0f, 0.0f, 0.0f, 0.0f};
284  const float vec_solid[4] = {0.0f, 0.0f, 0.0f, 1.0f};
285  const float nor_alpha[4] = {0.5f, 0.5f, 1.0f, 0.0f};
286  const float nor_solid[4] = {0.5f, 0.5f, 1.0f, 1.0f};
287  const float disp_alpha[4] = {0.5f, 0.5f, 0.5f, 0.0f};
288  const float disp_solid[4] = {0.5f, 0.5f, 0.5f, 1.0f};
289 
290  if ((image->id.tag & LIB_TAG_DOIT) == 0) {
291  ImBuf *ibuf = BKE_image_acquire_ibuf(image, NULL, NULL);
292 
293  if (flag == CLEAR_TANGENT_NORMAL) {
294  IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
295  }
296  else if (flag == CLEAR_DISPLACEMENT) {
297  IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? disp_alpha : disp_solid);
298  }
299  else {
300  IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
301  }
302 
303  image->id.tag |= LIB_TAG_DOIT;
304 
305  BKE_image_release_ibuf(image, ibuf, NULL);
306  }
307 }
308 
309 static void clear_images_poly(Image **ob_image_array, int ob_image_array_len, ClearFlag flag)
310 {
311  for (int i = 0; i < ob_image_array_len; i++) {
312  Image *image = ob_image_array[i];
313  if (image) {
314  image->id.tag &= ~LIB_TAG_DOIT;
315  }
316  }
317 
318  for (int i = 0; i < ob_image_array_len; i++) {
319  Image *image = ob_image_array[i];
320  if (image) {
321  clear_single_image(image, flag);
322  }
323  }
324 
325  for (int i = 0; i < ob_image_array_len; i++) {
326  Image *image = ob_image_array[i];
327  if (image) {
328  image->id.tag &= ~LIB_TAG_DOIT;
329  }
330  }
331 }
332 
334 {
335  Object *ob;
337  int objects_baked = 0;
338 
339  if (!multiresbake_check(C, op)) {
340  return OPERATOR_CANCELLED;
341  }
342 
343  if (scene->r.bake_flag & R_BAKE_CLEAR) { /* clear images */
344  CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
345  ClearFlag clear_flag = 0;
346 
347  ob = base->object;
348  // me = (Mesh *)ob->data;
349 
350  if (scene->r.bake_mode == RE_BAKE_NORMALS) {
351  clear_flag = CLEAR_TANGENT_NORMAL;
352  }
353  else if (scene->r.bake_mode == RE_BAKE_DISPLACEMENT) {
354  clear_flag = CLEAR_DISPLACEMENT;
355  }
356 
357  {
358  Image **ob_image_array = bake_object_image_get_array(ob);
359  clear_images_poly(ob_image_array, ob->totcol, clear_flag);
360  MEM_freeN(ob_image_array);
361  }
362  }
363  CTX_DATA_END;
364  }
365 
366  CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
367  MultiresBakeRender bkr = {NULL};
368 
369  ob = base->object;
370 
372 
373  /* copy data stored in job descriptor */
374  bkr.scene = scene;
376  bkr.mode = scene->r.bake_mode;
378  bkr.bias = scene->r.bake_biasdist;
382  // bkr.reports= op->reports;
383 
384  /* create low-resolution DM (to bake to) and hi-resolution DM (to bake from) */
386  bkr.ob_image.len = ob->totcol;
387 
390 
392 
393  MEM_freeN(bkr.ob_image.array);
394 
395  BLI_freelistN(&bkr.image);
396 
397  bkr.lores_dm->release(bkr.lores_dm);
398  bkr.hires_dm->release(bkr.hires_dm);
399 
400  objects_baked++;
401  }
402  CTX_DATA_END;
403 
404  if (!objects_baked) {
405  BKE_report(op->reports, RPT_ERROR, "No objects found to bake from");
406  }
407 
408  return OPERATOR_FINISHED;
409 }
410 
411 /* Multiresbake adopted for job-system executing */
413 {
415  Object *ob;
416 
417  /* backup scene settings, so their changing in UI would take no effect on baker */
418  bkj->scene = scene;
419  bkj->bake_filter = scene->r.bake_filter;
420  bkj->mode = scene->r.bake_mode;
423  bkj->bias = scene->r.bake_biasdist;
427  // bkj->reports = op->reports;
428 
429  CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) {
431  int lvl;
432 
433  ob = base->object;
434 
436 
437  data = MEM_callocN(sizeof(MultiresBakerJobData), "multiresBaker derivedMesh_data");
438 
439  data->ob_image.array = bake_object_image_get_array(ob);
440  data->ob_image.len = ob->totcol;
441 
442  /* create low-resolution DM (to bake to) and hi-resolution DM (to bake from) */
443  data->hires_dm = multiresbake_create_hiresdm(scene, ob, &data->tot_lvl);
444  data->lores_dm = multiresbake_create_loresdm(scene, ob, &lvl);
445  data->lvl = lvl;
446 
447  BLI_addtail(&bkj->data, data);
448  }
449  CTX_DATA_END;
450 }
451 
452 static void multiresbake_startjob(void *bkv, short *stop, short *do_update, float *progress)
453 {
455  MultiresBakeJob *bkj = bkv;
456  int baked_objects = 0, tot_obj;
457 
458  tot_obj = BLI_listbase_count(&bkj->data);
459 
460  if (bkj->bake_clear) { /* clear images */
461  for (data = bkj->data.first; data; data = data->next) {
462  ClearFlag clear_flag = 0;
463 
464  if (bkj->mode == RE_BAKE_NORMALS) {
465  clear_flag = CLEAR_TANGENT_NORMAL;
466  }
467  else if (bkj->mode == RE_BAKE_DISPLACEMENT) {
468  clear_flag = CLEAR_DISPLACEMENT;
469  }
470 
471  clear_images_poly(data->ob_image.array, data->ob_image.len, clear_flag);
472  }
473  }
474 
475  for (data = bkj->data.first; data; data = data->next) {
476  MultiresBakeRender bkr = {NULL};
477 
478  /* copy data stored in job descriptor */
479  bkr.scene = bkj->scene;
480  bkr.bake_filter = bkj->bake_filter;
481  bkr.mode = bkj->mode;
482  bkr.use_lores_mesh = bkj->use_lores_mesh;
483  bkr.user_scale = bkj->user_scale;
484  // bkr.reports = bkj->reports;
485  bkr.ob_image.array = data->ob_image.array;
486  bkr.ob_image.len = data->ob_image.len;
487 
488  /* create low-resolution DM (to bake to) and hi-resolution DM (to bake from) */
489  bkr.lores_dm = data->lores_dm;
490  bkr.hires_dm = data->hires_dm;
491  bkr.tot_lvl = data->tot_lvl;
492  bkr.lvl = data->lvl;
493 
494  /* needed for proper progress bar */
495  bkr.tot_obj = tot_obj;
496  bkr.baked_objects = baked_objects;
497 
498  bkr.stop = stop;
499  bkr.do_update = do_update;
500  bkr.progress = progress;
501 
502  bkr.bias = bkj->bias;
503  bkr.number_of_rays = bkj->number_of_rays;
504  bkr.threads = bkj->threads;
505 
507 
508  data->images = bkr.image;
509 
510  baked_objects++;
511  }
512 }
513 
514 static void multiresbake_freejob(void *bkv)
515 {
516  MultiresBakeJob *bkj = bkv;
518  LinkData *link;
519 
520  data = bkj->data.first;
521  while (data) {
522  next = data->next;
523  data->lores_dm->release(data->lores_dm);
524  data->hires_dm->release(data->hires_dm);
525 
526  /* delete here, since this delete will be called from main thread */
527  for (link = data->images.first; link; link = link->next) {
528  Image *ima = (Image *)link->data;
530  }
531 
532  MEM_freeN(data->ob_image.array);
533 
534  BLI_freelistN(&data->images);
535 
536  MEM_freeN(data);
537  data = next;
538  }
539 
540  MEM_freeN(bkj);
541 }
542 
544 {
546  MultiresBakeJob *bkr;
547  wmJob *wm_job;
548 
549  if (!multiresbake_check(C, op)) {
550  return OPERATOR_CANCELLED;
551  }
552 
553  bkr = MEM_callocN(sizeof(MultiresBakeJob), "MultiresBakeJob data");
554  init_multiresbake_job(C, bkr);
555 
556  if (!bkr->data.first) {
557  BKE_report(op->reports, RPT_ERROR, "No objects found to bake from");
558  return OPERATOR_CANCELLED;
559  }
560 
561  /* setup job */
562  wm_job = WM_jobs_get(CTX_wm_manager(C),
563  CTX_wm_window(C),
564  scene,
565  "Multires Bake",
569  WM_jobs_timer(wm_job, 0.5, NC_IMAGE, 0); /* TODO - only draw bake image, can we enforce this */
571 
572  G.is_break = false;
573 
574  WM_jobs_start(CTX_wm_manager(C), wm_job);
575  WM_cursor_wait(false);
576 
577  /* add modal handler for ESC */
579 
580  return OPERATOR_RUNNING_MODAL;
581 }
582 
583 /* ****************** render BAKING ********************** */
584 
585 /* catch esc */
587 {
588  /* no running blender, remove handler and pass through */
591  }
592 
593  /* running render */
594  switch (event->type) {
595  case EVT_ESCKEY:
596  return OPERATOR_RUNNING_MODAL;
597  }
598  return OPERATOR_PASS_THROUGH;
599 }
600 
602 {
604  return scene->r.bake_flag & R_BAKE_MULTIRES;
605  }
606 
607  return 0;
608 }
609 
611 {
614 
616 
618 
619  return result;
620 }
621 
623 {
626 
627  if (!is_multires_bake(scene)) {
628  BLI_assert(0);
629  return result;
630  }
631 
633 
635 
636  return result;
637 }
638 
640 {
641  /* identifiers */
642  ot->name = "Bake";
643  ot->description = "Bake image textures of selected objects";
644  ot->idname = "OBJECT_OT_bake_image";
645 
646  /* api callbacks */
651 }
void DM_set_only_copy(DerivedMesh *dm, const struct CustomData_MeshMasks *mask)
Blender util stuff.
struct DerivedMesh * CDDM_copy(struct DerivedMesh *source)
struct DerivedMesh * CDDM_from_mesh(struct Mesh *mesh)
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:689
#define CTX_DATA_BEGIN(C, Type, instance, member)
Definition: BKE_context.h:252
#define CTX_DATA_END
Definition: BKE_context.h:260
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
void CustomData_set_only_copy(const struct CustomData *data, CustomDataMask mask)
Definition: customdata.c:2871
const CustomData_MeshMasks CD_MASK_BAREMESH
Definition: customdata.c:1919
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
Definition: image.c:5113
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
Definition: image.c:5100
void BKE_image_free_gputextures(struct Image *ima)
Definition: image_gpu.c:517
General operations, lookup, etc. for materials.
bool BKE_modifier_is_enabled(const struct Scene *scene, struct ModifierData *md, int required_mode)
struct MultiresModifierData * get_multires_modifier(struct Scene *scene, struct Object *ob, bool use_first)
Definition: multires.c:336
struct DerivedMesh * multires_make_derived_from_derived(struct DerivedMesh *dm, struct MultiresModifierData *mmd, struct Scene *scene, struct Object *ob, MultiresFlags flags)
Definition: multires.c:1232
void multires_flush_sculpt_updates(struct Object *object)
Definition: multires.c:427
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
int BKE_scene_num_threads(const struct Scene *scene)
#define BLI_assert(a)
Definition: BLI_assert.h:58
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define UNUSED(x)
#define ELEM(...)
@ LIB_TAG_DOIT
Definition: DNA_ID.h:554
@ eModifierMode_Realtime
Object is a sort of wrapper for general info.
@ OB_MESH
#define R_BAKE_CLEAR
#define R_BAKE_USERSCALE
#define R_IMF_PLANES_RGBA
#define R_BAKE_MULTIRES
#define R_BAKE_LORES_MESH
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
bool ED_operator_object_active(struct bContext *C)
Definition: screen_ops.c:355
bool ED_object_get_active_image(struct Object *ob, int mat_nr, struct Image **r_ima, struct ImageUser **r_iuser, struct bNode **r_node, struct bNodeTree **r_ntree)
Definition: uvedit_ops.c:125
void IMB_rectfill(struct ImBuf *drect, const float col[4])
Definition: rectop.c:1077
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
Platform independent time functions.
#define RE_BAKE_AO
Definition: RE_pipeline.h:358
#define RE_BAKE_NORMALS
Definition: RE_pipeline.h:356
#define RE_BAKE_DISPLACEMENT
Definition: RE_pipeline.h:357
#define C
Definition: RandGen.cpp:39
@ WM_JOB_TYPE_OBJECT_BAKE_TEXTURE
Definition: WM_api.h:740
@ WM_JOB_EXCL_RENDER
Definition: WM_api.h:725
@ WM_JOB_PROGRESS
Definition: WM_api.h:726
@ WM_JOB_PRIORITY
Definition: WM_api.h:724
#define ND_RENDER_RESULT
Definition: WM_types.h:346
#define NC_SCENE
Definition: WM_types.h:279
#define NC_IMAGE
Definition: WM_types.h:285
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
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
static ulong * next
void RE_multires_bake_images(MultiresBakeRender *bkr)
static unsigned a[3]
Definition: RandGen.cpp:92
static void multiresbake_startjob(void *bkv, short *stop, short *do_update, float *progress)
Definition: object_bake.c:452
static int multiresbake_image_exec_locked(bContext *C, wmOperator *op)
Definition: object_bake.c:333
static DerivedMesh * multiresbake_create_hiresdm(Scene *scene, Object *ob, int *lvl)
Definition: object_bake.c:250
static int objects_bake_render_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(_event))
Definition: object_bake.c:610
static void multiresbake_freejob(void *bkv)
Definition: object_bake.c:514
static void init_multiresbake_job(bContext *C, MultiresBakeJob *bkj)
Definition: object_bake.c:412
static Image ** bake_object_image_get_array(Object *ob)
Definition: object_bake.c:80
void OBJECT_OT_bake_image(wmOperatorType *ot)
Definition: object_bake.c:639
static int objects_bake_render_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
Definition: object_bake.c:586
ClearFlag
Definition: object_bake.c:276
@ CLEAR_DISPLACEMENT
Definition: object_bake.c:278
@ CLEAR_TANGENT_NORMAL
Definition: object_bake.c:277
static int multiresbake_image_exec(bContext *C, wmOperator *op)
Definition: object_bake.c:543
static void clear_images_poly(Image **ob_image_array, int ob_image_array_len, ClearFlag flag)
Definition: object_bake.c:309
static Image * bake_object_image_get(Object *ob, int mat_nr)
Definition: object_bake.c:73
static void clear_single_image(Image *image, ClearFlag flag)
Definition: object_bake.c:281
struct MultiresBakerJobData MultiresBakerJobData
static bool is_multires_bake(Scene *scene)
Definition: object_bake.c:601
static bool multiresbake_check(bContext *C, wmOperator *op)
Definition: object_bake.c:127
static DerivedMesh * multiresbake_create_loresdm(Scene *scene, Object *ob, int *lvl)
Definition: object_bake.c:224
static int bake_image_exec(bContext *C, wmOperator *op)
Definition: object_bake.c:622
CustomData polyData
CustomData loopData
void(* release)(DerivedMesh *dm)
int tag
Definition: DNA_ID.h:292
int channels
unsigned char planes
unsigned int * rect
float * rect_float
void * data
Definition: DNA_listBase.h:42
struct LinkData * next
Definition: DNA_listBase.h:41
void * first
Definition: DNA_listBase.h:47
short mat_nr
struct MLoopUV * mloopuv
int totpoly
struct MPoly * mpoly
struct ModifierData * next
DerivedMesh * hires_dm
DerivedMesh * lores_dm
struct MultiresBakeRender::@1137 ob_image
struct MultiresBakerJobData * prev
Definition: object_bake.c:94
struct MultiresBakerJobData * next
Definition: object_bake.c:94
DerivedMesh * hires_dm
Definition: object_bake.c:100
DerivedMesh * lores_dm
Definition: object_bake.c:100
struct MultiresBakerJobData::@463 ob_image
void * data
short bake_samples
float bake_biasdist
float bake_user_scale
struct RenderData r
short type
Definition: WM_types.h:577
Definition: wm_jobs.c:73
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
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
struct ReportList * reports
#define G(x, y, z)
void WM_cursor_wait(bool val)
Definition: wm_cursors.c:226
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
@ EVT_ESCKEY
wmOperatorType * ot
Definition: wm_files.c:3156
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition: wm_jobs.c:450
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, void *owner, const char *name, int flag, int job_type)
Definition: wm_jobs.c:196
bool WM_jobs_test(wmWindowManager *wm, void *owner, int job_type)
Definition: wm_jobs.c:223
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:372
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *))
Definition: wm_jobs.c:344
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)
Definition: wm_jobs.c:360