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