Blender  V3.3
io_alembic.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2016 Blender Foundation. All rights reserved. */
3 
8 #ifdef WITH_ALEMBIC
9 
10 /* needed for directory lookup */
11 # ifndef WIN32
12 # include <dirent.h>
13 # else
14 # include "BLI_winstuff.h"
15 # endif
16 
17 # include <errno.h>
18 # include <string.h>
19 
20 # include "MEM_guardedalloc.h"
21 
22 # include "DNA_modifier_types.h"
23 # include "DNA_object_types.h"
24 # include "DNA_scene_types.h"
25 # include "DNA_space_types.h"
26 
27 # include "BKE_context.h"
28 # include "BKE_main.h"
29 # include "BKE_report.h"
30 
31 # include "BLI_listbase.h"
32 # include "BLI_path_util.h"
33 # include "BLI_string.h"
34 # include "BLI_utildefines.h"
35 
36 # include "BLT_translation.h"
37 
38 # include "RNA_access.h"
39 # include "RNA_define.h"
40 # include "RNA_enum_types.h"
41 
42 # include "ED_object.h"
43 
44 # include "UI_interface.h"
45 # include "UI_resources.h"
46 
47 # include "WM_api.h"
48 # include "WM_types.h"
49 
50 # include "DEG_depsgraph.h"
51 
52 # include "io_alembic.h"
53 
54 # include "ABC_alembic.h"
55 
56 const EnumPropertyItem rna_enum_abc_export_evaluation_mode_items[] = {
58  "RENDER",
59  0,
60  "Render",
61  "Use Render settings for object visibility, modifier settings, etc"},
63  "VIEWPORT",
64  0,
65  "Viewport",
66  "Use Viewport settings for object visibility, modifier settings, etc"},
67  {0, NULL, 0, NULL, NULL},
68 };
69 
70 static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *event)
71 {
72  if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) {
73  RNA_boolean_set(op->ptr, "as_background_job", true);
74  }
75 
76  RNA_boolean_set(op->ptr, "init_scene_frame_range", true);
77 
78  if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
79  Main *bmain = CTX_data_main(C);
80  char filepath[FILE_MAX];
81 
82  if (BKE_main_blendfile_path(bmain)[0] == '\0') {
83  BLI_strncpy(filepath, "untitled", sizeof(filepath));
84  }
85  else {
86  BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
87  }
88 
89  BLI_path_extension_replace(filepath, sizeof(filepath), ".abc");
90  RNA_string_set(op->ptr, "filepath", filepath);
91  }
92 
94 
96 
97  UNUSED_VARS(event);
98 }
99 
100 static int wm_alembic_export_exec(bContext *C, wmOperator *op)
101 {
102  if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
103  BKE_report(op->reports, RPT_ERROR, "No filename given");
104  return OPERATOR_CANCELLED;
105  }
106 
107  char filename[FILE_MAX];
108  RNA_string_get(op->ptr, "filepath", filename);
109 
110  struct AlembicExportParams params = {
111  .frame_start = RNA_int_get(op->ptr, "start"),
112  .frame_end = RNA_int_get(op->ptr, "end"),
113 
114  .frame_samples_xform = RNA_int_get(op->ptr, "xsamples"),
115  .frame_samples_shape = RNA_int_get(op->ptr, "gsamples"),
116 
117  .shutter_open = RNA_float_get(op->ptr, "sh_open"),
118  .shutter_close = RNA_float_get(op->ptr, "sh_close"),
119 
120  .selected_only = RNA_boolean_get(op->ptr, "selected"),
121  .uvs = RNA_boolean_get(op->ptr, "uvs"),
122  .normals = RNA_boolean_get(op->ptr, "normals"),
123  .vcolors = RNA_boolean_get(op->ptr, "vcolors"),
124  .orcos = RNA_boolean_get(op->ptr, "orcos"),
125  .apply_subdiv = RNA_boolean_get(op->ptr, "apply_subdiv"),
126  .curves_as_mesh = RNA_boolean_get(op->ptr, "curves_as_mesh"),
127  .flatten_hierarchy = RNA_boolean_get(op->ptr, "flatten"),
128  .visible_objects_only = RNA_boolean_get(op->ptr, "visible_objects_only"),
129  .face_sets = RNA_boolean_get(op->ptr, "face_sets"),
130  .use_subdiv_schema = RNA_boolean_get(op->ptr, "subdiv_schema"),
131  .export_hair = RNA_boolean_get(op->ptr, "export_hair"),
132  .export_particles = RNA_boolean_get(op->ptr, "export_particles"),
133  .export_custom_properties = RNA_boolean_get(op->ptr, "export_custom_properties"),
134  .use_instancing = RNA_boolean_get(op->ptr, "use_instancing"),
135  .packuv = RNA_boolean_get(op->ptr, "packuv"),
136  .triangulate = RNA_boolean_get(op->ptr, "triangulate"),
137  .quad_method = RNA_enum_get(op->ptr, "quad_method"),
138  .ngon_method = RNA_enum_get(op->ptr, "ngon_method"),
139  .evaluation_mode = RNA_enum_get(op->ptr, "evaluation_mode"),
140 
141  .global_scale = RNA_float_get(op->ptr, "global_scale"),
142  };
143 
144  /* Take some defaults from the scene, if not specified explicitly. */
146  if (params.frame_start == INT_MIN) {
147  params.frame_start = scene->r.sfra;
148  }
149  if (params.frame_end == INT_MIN) {
150  params.frame_end = scene->r.efra;
151  }
152 
153  const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job");
154  bool ok = ABC_export(scene, C, filename, &params, as_background_job);
155 
156  return as_background_job || ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
157 }
158 
159 static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr)
160 {
161  uiLayout *box, *row, *col, *sub;
162 
163  uiLayoutSetPropSep(layout, true);
164  uiLayoutSetPropDecorate(layout, false);
165 
166  box = uiLayoutBox(layout);
167  uiItemL(box, IFACE_("Manual Transform"), ICON_NONE);
168 
169  uiItemR(box, imfptr, "global_scale", 0, NULL, ICON_NONE);
170 
171  /* Scene Options */
172  box = uiLayoutBox(layout);
173  row = uiLayoutRow(box, false);
174  uiItemL(row, IFACE_("Scene Options"), ICON_SCENE_DATA);
175 
176  col = uiLayoutColumn(box, false);
177 
178  sub = uiLayoutColumn(col, true);
179  uiItemR(sub, imfptr, "start", 0, IFACE_("Frame Start"), ICON_NONE);
180  uiItemR(sub, imfptr, "end", 0, IFACE_("End"), ICON_NONE);
181 
182  uiItemR(col, imfptr, "xsamples", 0, IFACE_("Samples Transform"), ICON_NONE);
183  uiItemR(col, imfptr, "gsamples", 0, IFACE_("Geometry"), ICON_NONE);
184 
185  sub = uiLayoutColumn(col, true);
186  uiItemR(sub, imfptr, "sh_open", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
187  uiItemR(sub, imfptr, "sh_close", UI_ITEM_R_SLIDER, IFACE_("Close"), ICON_NONE);
188 
189  uiItemS(col);
190 
191  uiItemR(col, imfptr, "flatten", 0, NULL, ICON_NONE);
192  uiItemR(sub, imfptr, "use_instancing", 0, IFACE_("Use Instancing"), ICON_NONE);
193  uiItemR(sub, imfptr, "export_custom_properties", 0, IFACE_("Custom Properties"), ICON_NONE);
194 
195  sub = uiLayoutColumnWithHeading(col, true, IFACE_("Only"));
196  uiItemR(sub, imfptr, "selected", 0, IFACE_("Selected Objects"), ICON_NONE);
197  uiItemR(sub, imfptr, "visible_objects_only", 0, IFACE_("Visible Objects"), ICON_NONE);
198 
199  col = uiLayoutColumn(box, true);
200  uiItemR(col, imfptr, "evaluation_mode", 0, NULL, ICON_NONE);
201 
202  /* Object Data */
203  box = uiLayoutBox(layout);
204  row = uiLayoutRow(box, false);
205  uiItemL(row, IFACE_("Object Options"), ICON_OBJECT_DATA);
206 
207  col = uiLayoutColumn(box, false);
208 
209  uiItemR(col, imfptr, "uvs", 0, NULL, ICON_NONE);
210  row = uiLayoutRow(col, false);
211  uiLayoutSetActive(row, RNA_boolean_get(imfptr, "uvs"));
212  uiItemR(row, imfptr, "packuv", 0, NULL, ICON_NONE);
213 
214  uiItemR(col, imfptr, "normals", 0, NULL, ICON_NONE);
215  uiItemR(col, imfptr, "vcolors", 0, NULL, ICON_NONE);
216  uiItemR(col, imfptr, "orcos", 0, NULL, ICON_NONE);
217  uiItemR(col, imfptr, "face_sets", 0, NULL, ICON_NONE);
218  uiItemR(col, imfptr, "curves_as_mesh", 0, NULL, ICON_NONE);
219 
220  uiItemS(col);
221 
222  sub = uiLayoutColumnWithHeading(col, true, IFACE_("Subdivisions"));
223  uiItemR(sub, imfptr, "apply_subdiv", 0, IFACE_("Apply"), ICON_NONE);
224  uiItemR(sub, imfptr, "subdiv_schema", 0, IFACE_("Use Schema"), ICON_NONE);
225 
226  uiItemS(col);
227 
228  col = uiLayoutColumn(box, false);
229  uiItemR(col, imfptr, "triangulate", 0, NULL, ICON_NONE);
230  sub = uiLayoutColumn(col, false);
231  uiLayoutSetActive(sub, RNA_boolean_get(imfptr, "triangulate"));
232  uiItemR(sub, imfptr, "quad_method", 0, IFACE_("Method Quads"), ICON_NONE);
233  uiItemR(sub, imfptr, "ngon_method", 0, IFACE_("Polygons"), ICON_NONE);
234 
235  /* Particle Data */
236  box = uiLayoutBox(layout);
237  row = uiLayoutRow(box, false);
238  uiItemL(row, IFACE_("Particle Systems"), ICON_PARTICLE_DATA);
239 
240  col = uiLayoutColumn(box, true);
241  uiItemR(col, imfptr, "export_hair", 0, NULL, ICON_NONE);
242  uiItemR(col, imfptr, "export_particles", 0, NULL, ICON_NONE);
243 }
244 
245 static void wm_alembic_export_draw(bContext *C, wmOperator *op)
246 {
247  /* Conveniently set start and end frame to match the scene's frame range. */
249 
250  if (scene != NULL && RNA_boolean_get(op->ptr, "init_scene_frame_range")) {
251  RNA_int_set(op->ptr, "start", scene->r.sfra);
252  RNA_int_set(op->ptr, "end", scene->r.efra);
253 
254  RNA_boolean_set(op->ptr, "init_scene_frame_range", false);
255  }
256 
257  ui_alembic_export_settings(op->layout, op->ptr);
258 }
259 
260 static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op)
261 {
262  char filepath[FILE_MAX];
263  RNA_string_get(op->ptr, "filepath", filepath);
264 
265  if (!BLI_path_extension_check(filepath, ".abc")) {
266  BLI_path_extension_ensure(filepath, FILE_MAX, ".abc");
267  RNA_string_set(op->ptr, "filepath", filepath);
268  return true;
269  }
270 
271  return false;
272 }
273 
275 {
276  ot->name = "Export Alembic";
277  ot->description = "Export current scene in an Alembic archive";
278  ot->idname = "WM_OT_alembic_export";
279 
280  ot->invoke = wm_alembic_export_invoke;
281  ot->exec = wm_alembic_export_exec;
283  ot->ui = wm_alembic_export_draw;
284  ot->check = wm_alembic_export_check;
285  ot->flag = OPTYPE_PRESET;
286 
289  FILE_BLENDER,
290  FILE_SAVE,
294 
295  PropertyRNA *prop = RNA_def_string(ot->srna, "filter_glob", "*.abc", 0, "", "");
297 
299  "start",
300  INT_MIN,
301  INT_MIN,
302  INT_MAX,
303  "Start Frame",
304  "Start frame of the export, use the default value to "
305  "take the start frame of the current scene",
306  INT_MIN,
307  INT_MAX);
308 
310  "end",
311  INT_MIN,
312  INT_MIN,
313  INT_MAX,
314  "End Frame",
315  "End frame of the export, use the default value to "
316  "take the end frame of the current scene",
317  INT_MIN,
318  INT_MAX);
319 
321  "xsamples",
322  1,
323  1,
324  128,
325  "Transform Samples",
326  "Number of times per frame transformations are sampled",
327  1,
328  128);
329 
331  "gsamples",
332  1,
333  1,
334  128,
335  "Geometry Samples",
336  "Number of times per frame object data are sampled",
337  1,
338  128);
339 
341  "sh_open",
342  0.0f,
343  -1.0f,
344  1.0f,
345  "Shutter Open",
346  "Time at which the shutter is open",
347  -1.0f,
348  1.0f);
349 
351  "sh_close",
352  1.0f,
353  -1.0f,
354  1.0f,
355  "Shutter Close",
356  "Time at which the shutter is closed",
357  -1.0f,
358  1.0f);
359 
361  ot->srna, "selected", 0, "Selected Objects Only", "Export only selected objects");
362 
364  "visible_objects_only",
365  0,
366  "Visible Objects Only",
367  "Export only objects that are visible");
368 
370  "flatten",
371  0,
372  "Flatten Hierarchy",
373  "Do not preserve objects' parent/children relationship");
374 
375  RNA_def_boolean(ot->srna, "uvs", 1, "UVs", "Export UVs");
376 
377  RNA_def_boolean(ot->srna, "packuv", 1, "Pack UV Islands", "Export UVs with packed island");
378 
379  RNA_def_boolean(ot->srna, "normals", 1, "Normals", "Export normals");
380 
381  RNA_def_boolean(ot->srna, "vcolors", 0, "Color Attributes", "Export color attributes");
382 
384  "orcos",
385  true,
386  "Generated Coordinates",
387  "Export undeformed mesh vertex coordinates");
388 
390  ot->srna, "face_sets", 0, "Face Sets", "Export per face shading group assignments");
391 
393  "subdiv_schema",
394  0,
395  "Use Subdivision Schema",
396  "Export meshes using Alembic's subdivision schema");
397 
399  "apply_subdiv",
400  0,
401  "Apply Subdivision Surface",
402  "Export subdivision surfaces as meshes");
403 
405  "curves_as_mesh",
406  false,
407  "Curves as Mesh",
408  "Export curves and NURBS surfaces as meshes");
409 
411  "use_instancing",
412  true,
413  "Use Instancing",
414  "Export data of duplicated objects as Alembic instances; speeds up the export "
415  "and can be disabled for compatibility with other software");
416 
418  ot->srna,
419  "global_scale",
420  1.0f,
421  0.0001f,
422  1000.0f,
423  "Scale",
424  "Value by which to enlarge or shrink the objects with respect to the world's origin",
425  0.0001f,
426  1000.0f);
427 
429  "triangulate",
430  false,
431  "Triangulate",
432  "Export polygons (quads and n-gons) as triangles");
433 
435  "quad_method",
438  "Quad Method",
439  "Method for splitting the quads into triangles");
440 
442  "ngon_method",
445  "N-gon Method",
446  "Method for splitting the n-gons into triangles");
447 
449  "export_hair",
450  1,
451  "Export Hair",
452  "Exports hair particle systems as animated curves");
454  ot->srna, "export_particles", 1, "Export Particles", "Exports non-hair particle systems");
455 
457  "export_custom_properties",
458  true,
459  "Export Custom Properties",
460  "Export custom properties to Alembic .userProperties");
461 
463  ot->srna,
464  "as_background_job",
465  false,
466  "Run as Background Job",
467  "Enable this to run the import in the background, disable to block Blender while importing. "
468  "This option is deprecated; EXECUTE this operator to run in the foreground, and INVOKE it "
469  "to run as a background job");
470 
472  "evaluation_mode",
473  rna_enum_abc_export_evaluation_mode_items,
475  "Use Settings for",
476  "Determines visibility of objects, modifier settings, and other areas where there "
477  "are different settings for viewport and rendering");
478 
479  /* This dummy prop is used to check whether we need to init the start and
480  * end frame values to that of the scene's, otherwise they are reset at
481  * every change, draw update. */
482  RNA_def_boolean(ot->srna, "init_scene_frame_range", true, "", "");
483 }
484 
485 /* ************************************************************************** */
486 
487 /* TODO(kevin): check on de-duplicating all this with code in image_ops.c */
488 
489 typedef struct CacheFrame {
490  struct CacheFrame *next, *prev;
491  int framenr;
492 } CacheFrame;
493 
494 static int cmp_frame(const void *a, const void *b)
495 {
496  const CacheFrame *frame_a = a;
497  const CacheFrame *frame_b = b;
498 
499  if (frame_a->framenr < frame_b->framenr) {
500  return -1;
501  }
502  if (frame_a->framenr > frame_b->framenr) {
503  return 1;
504  }
505  return 0;
506 }
507 
508 static int get_sequence_len(char *filename, int *ofs)
509 {
510  int frame;
511  int numdigit;
512 
513  if (!BLI_path_frame_get(filename, &frame, &numdigit)) {
514  return 1;
515  }
516 
517  char path[FILE_MAX];
519  BLI_split_dir_part(filename, path, FILE_MAX);
520 
521  if (path[0] == '\0') {
522  /* The filename had no path, so just use the blend file path. */
524  }
525 
526  DIR *dir = opendir(path);
527  if (dir == NULL) {
528  fprintf(stderr,
529  "Error opening directory '%s': %s\n",
530  path,
531  errno ? strerror(errno) : "unknown error");
532  return -1;
533  }
534 
535  const char *ext = ".abc";
536  const char *basename = BLI_path_basename(filename);
537  const int len = strlen(basename) - (numdigit + strlen(ext));
538 
539  ListBase frames;
540  BLI_listbase_clear(&frames);
541 
542  struct dirent *fname;
543  while ((fname = readdir(dir)) != NULL) {
544  /* do we have the right extension? */
545  if (!strstr(fname->d_name, ext)) {
546  continue;
547  }
548 
549  if (!STREQLEN(basename, fname->d_name, len)) {
550  continue;
551  }
552 
553  CacheFrame *cache_frame = MEM_callocN(sizeof(CacheFrame), "abc_frame");
554 
555  BLI_path_frame_get(fname->d_name, &cache_frame->framenr, &numdigit);
556 
557  BLI_addtail(&frames, cache_frame);
558  }
559 
560  closedir(dir);
561 
562  BLI_listbase_sort(&frames, cmp_frame);
563 
564  CacheFrame *cache_frame = frames.first;
565 
566  if (cache_frame) {
567  int frame_curr = cache_frame->framenr;
568  (*ofs) = frame_curr;
569 
570  while (cache_frame && (cache_frame->framenr == frame_curr)) {
571  frame_curr++;
572  cache_frame = cache_frame->next;
573  }
574 
575  BLI_freelistN(&frames);
576 
577  return frame_curr - (*ofs);
578  }
579 
580  return 1;
581 }
582 
583 /* ************************************************************************** */
584 
585 static void ui_alembic_import_settings(uiLayout *layout, PointerRNA *imfptr)
586 {
587 
588  uiLayoutSetPropSep(layout, true);
589  uiLayoutSetPropDecorate(layout, false);
590 
591  uiLayout *box = uiLayoutBox(layout);
592  uiLayout *row = uiLayoutRow(box, false);
593  uiItemL(row, IFACE_("Manual Transform"), ICON_NONE);
594 
595  uiItemR(box, imfptr, "scale", 0, NULL, ICON_NONE);
596 
597  box = uiLayoutBox(layout);
598  row = uiLayoutRow(box, false);
599  uiItemL(row, IFACE_("Options"), ICON_NONE);
600 
601  uiLayout *col = uiLayoutColumn(box, false);
602  uiItemR(col, imfptr, "relative_path", 0, NULL, ICON_NONE);
603  uiItemR(col, imfptr, "set_frame_range", 0, NULL, ICON_NONE);
604  uiItemR(col, imfptr, "is_sequence", 0, NULL, ICON_NONE);
605  uiItemR(col, imfptr, "validate_meshes", 0, NULL, ICON_NONE);
606  uiItemR(col, imfptr, "always_add_cache_reader", 0, NULL, ICON_NONE);
607 }
608 
609 static void wm_alembic_import_draw(bContext *UNUSED(C), wmOperator *op)
610 {
611  ui_alembic_import_settings(op->layout, op->ptr);
612 }
613 
614 /* op->invoke, opens fileselect if path property not set, otherwise executes */
615 static int wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent *event)
616 {
617  if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) {
618  RNA_boolean_set(op->ptr, "as_background_job", true);
619  }
620  return WM_operator_filesel(C, op, event);
621 }
622 
623 static int wm_alembic_import_exec(bContext *C, wmOperator *op)
624 {
625  if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) {
626  BKE_report(op->reports, RPT_ERROR, "No filename given");
627  return OPERATOR_CANCELLED;
628  }
629 
630  char filename[FILE_MAX];
631  RNA_string_get(op->ptr, "filepath", filename);
632 
633  const float scale = RNA_float_get(op->ptr, "scale");
634  const bool is_sequence = RNA_boolean_get(op->ptr, "is_sequence");
635  const bool set_frame_range = RNA_boolean_get(op->ptr, "set_frame_range");
636  const bool validate_meshes = RNA_boolean_get(op->ptr, "validate_meshes");
637  const bool always_add_cache_reader = RNA_boolean_get(op->ptr, "always_add_cache_reader");
638  const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job");
639 
640  int offset = 0;
641  int sequence_len = 1;
642 
643  if (is_sequence) {
644  sequence_len = get_sequence_len(filename, &offset);
645  if (sequence_len < 0) {
646  BKE_report(op->reports, RPT_ERROR, "Unable to determine ABC sequence length");
647  return OPERATOR_CANCELLED;
648  }
649  }
650 
651  /* Switch out of edit mode to avoid being stuck in it (T54326). */
652  Object *obedit = CTX_data_edit_object(C);
653  if (obedit) {
655  }
656 
657  bool ok = ABC_import(C,
658  filename,
659  scale,
660  is_sequence,
661  set_frame_range,
662  sequence_len,
663  offset,
664  validate_meshes,
665  always_add_cache_reader,
666  as_background_job);
667 
668  return as_background_job || ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
669 }
670 
672 {
673  ot->name = "Import Alembic";
674  ot->description = "Load an Alembic archive";
675  ot->idname = "WM_OT_alembic_import";
677 
678  ot->invoke = wm_alembic_import_invoke;
679  ot->exec = wm_alembic_import_exec;
681  ot->ui = wm_alembic_import_draw;
682 
685  FILE_BLENDER,
690 
691  PropertyRNA *prop = RNA_def_string(ot->srna, "filter_glob", "*.abc", 0, "", "");
693 
695  ot->srna,
696  "scale",
697  1.0f,
698  0.0001f,
699  1000.0f,
700  "Scale",
701  "Value by which to enlarge or shrink the objects with respect to the world's origin",
702  0.0001f,
703  1000.0f);
704 
706  ot->srna,
707  "set_frame_range",
708  true,
709  "Set Frame Range",
710  "If checked, update scene's start and end frame to match those of the Alembic archive");
711 
713  "validate_meshes",
714  0,
715  "Validate Meshes",
716  "Check imported mesh objects for invalid data (slow)");
717 
719  "always_add_cache_reader",
720  false,
721  "Always Add Cache Reader",
722  "Add cache modifiers and constraints to imported objects even if they are not "
723  "animated so that they can be updated when reloading the Alembic archive");
724 
726  "is_sequence",
727  false,
728  "Is Sequence",
729  "Set to true if the cache is split into separate files");
730 
732  ot->srna,
733  "as_background_job",
734  false,
735  "Run as Background Job",
736  "Enable this to run the export in the background, disable to block Blender while exporting. "
737  "This option is deprecated; EXECUTE this operator to run in the foreground, and INVOKE it "
738  "to run as a background job");
739 }
740 
741 #endif
bool ABC_import(struct bContext *C, const char *filepath, float scale, bool is_sequence, bool set_frame_range, int sequence_len, int offset, bool validate_meshes, bool always_add_cache_reader, bool as_background_job)
bool ABC_export(struct Scene *scene, struct bContext *C, const char *filepath, const struct AlembicExportParams *params, bool as_background_job)
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct Object * CTX_data_edit_object(const bContext *C)
Definition: context.c:1370
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1074
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global(void)
Definition: main.c:562
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
Definition: BLI_listbase.h:273
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void void BLI_listbase_sort(struct ListBase *listbase, int(*cmp)(const void *, const void *)) ATTR_NONNULL(1
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen)
Definition: path_util.c:1490
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1653
#define FILE_MAX
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
Definition: path_util.c:1420
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
Definition: path_util.c:1393
bool BLI_path_frame_get(char *path, int *r_frame, int *r_digits_len) ATTR_NONNULL()
Definition: path_util.c:753
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1299
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:897
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
#define UNUSED_VARS(...)
#define STREQLEN(a, b, n)
#define UNUSED(x)
Compatibility-like things for windows.
struct __dirstream DIR
Definition: BLI_winstuff.h:84
int closedir(DIR *dp)
struct dirent * readdir(DIR *dp)
DIR * opendir(const char *path)
#define IFACE_(msgid)
@ DAG_EVAL_RENDER
Definition: DEG_depsgraph.h:46
@ DAG_EVAL_VIEWPORT
Definition: DEG_depsgraph.h:45
@ MOD_TRIANGULATE_NGON_BEAUTY
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
@ OB_MODE_OBJECT
Object is a sort of wrapper for general info.
@ FILE_SORT_DEFAULT
@ FILE_BLENDER
@ FILE_TYPE_ALEMBIC
@ FILE_TYPE_FOLDER
@ FILE_DEFAULTDISPLAY
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
bool ED_object_mode_set(struct bContext *C, eObjectMode mode)
Definition: object_modes.c:231
Read Guarded memory(de)allocation.
@ PROP_HIDDEN
Definition: RNA_types.h:216
#define C
Definition: RandGen.cpp:25
void uiLayoutSetActive(uiLayout *layout, bool active)
uiLayout * uiLayoutColumnWithHeading(uiLayout *layout, bool align, const char *heading)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemL(uiLayout *layout, const char *name, int icon)
uiLayout * uiLayoutBox(uiLayout *layout)
void uiLayoutSetPropSep(uiLayout *layout, bool is_sep)
void uiItemS(uiLayout *layout)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
@ UI_ITEM_R_SLIDER
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep)
@ WM_FILESEL_RELPATH
Definition: WM_api.h:752
@ WM_FILESEL_SHOW_PROPS
Definition: WM_api.h:758
@ WM_FILESEL_FILEPATH
Definition: WM_api.h:755
@ FILE_OPENFILE
Definition: WM_api.h:764
@ FILE_SAVE
Definition: WM_api.h:765
@ OPTYPE_PRESET
Definition: WM_types.h:161
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
static char * basename(char *string)
Definition: datatoc.c:17
Scene scene
int len
Definition: draw_manager.c:108
uint col
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void WM_OT_alembic_import(struct wmOperatorType *ot)
void WM_OT_alembic_export(struct wmOperatorType *ot)
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
static ulong * next
static unsigned a[3]
Definition: RandGen.cpp:78
SymEdge< T > * prev(const SymEdge< T > *se)
Definition: delaunay_2d.cc:105
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
Definition: rna_access.c:5155
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
Definition: rna_access.c:4874
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
Definition: rna_access.c:5289
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
Definition: rna_access.c:4921
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
Definition: rna_access.c:5116
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_struct_property_is_set(PointerRNA *ptr, const char *identifier)
Definition: rna_access.c:5301
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_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
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
const EnumPropertyItem rna_enum_modifier_triangulate_ngon_method_items[]
Definition: rna_modifier.c:333
const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[]
Definition: rna_modifier.c:304
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct RenderData r
char * d_name
Definition: BLI_winstuff.h:80
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
void(* ui)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:954
bool(* check)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:911
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
struct ReportList * reports
struct uiLayout * layout
struct PointerRNA * ptr
void WM_event_add_fileselect(bContext *C, wmOperator *op)
wmOperatorType * ot
Definition: wm_files.c:3479
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
bool WM_operator_winactive(bContext *C)
int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))