77 "Use Render settings for object visibility, modifier settings, etc"},
82 "Use Viewport settings for object visibility, modifier settings, etc"},
99 BLI_strncpy(filepath,
"untitled",
sizeof(filepath));
161 if (
params.frame_start == INT_MIN) {
164 if (
params.frame_end == INT_MIN) {
184 uiItemR(box, imfptr,
"global_scale", 0,
NULL, ICON_NONE);
194 uiItemR(sub, imfptr,
"start", 0,
IFACE_(
"Frame Start"), ICON_NONE);
197 uiItemR(
col, imfptr,
"xsamples", 0,
IFACE_(
"Samples Transform"), 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);
211 uiItemR(sub, imfptr,
"selected", 0,
IFACE_(
"Selected Objects"), ICON_NONE);
212 uiItemR(sub, imfptr,
"visible_objects_only", 0,
IFACE_(
"Visible Objects"), ICON_NONE);
227 uiItemR(row, imfptr,
"packuv", 0,
NULL, ICON_NONE);
237 uiItemR(sub, imfptr,
"apply_subdiv", 0,
IFACE_(
"Apply"), ICON_NONE);
238 uiItemR(sub, imfptr,
"subdiv_schema", 0,
IFACE_(
"Use Schema"), ICON_NONE);
246 uiItemR(sub, imfptr,
"quad_method", 0,
IFACE_(
"Method Quads"), ICON_NONE);
247 uiItemR(sub, imfptr,
"ngon_method", 0,
IFACE_(
"Polygons"), ICON_NONE);
252 uiItemL(row,
IFACE_(
"Particle Systems"), ICON_PARTICLE_DATA);
276 ui_alembic_export_settings(op->
layout, &
ptr);
295 ot->
name =
"Export Alembic";
296 ot->
description =
"Export current scene in an Alembic archive";
297 ot->
idname =
"WM_OT_alembic_export";
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;
319 "Start frame of the export, use the default value to "
320 "take the start frame of the current scene",
330 "End frame of the export, use the default value to "
331 "take the end frame of the current scene",
341 "Number of times per frame transformations are sampled",
351 "Number of times per frame object data are sampled",
361 "Time at which the shutter is open",
371 "Time at which the shutter is closed",
376 ot->
srna,
"selected", 0,
"Selected Objects Only",
"Export only selected objects");
379 "visible_objects_only",
381 "Visible Objects Only",
382 "Export only objects that are visible");
388 "Do not preserve objects' parent/children relationship");
399 ot->
srna,
"face_sets", 0,
"Face Sets",
"Export per face shading group assignments");
404 "Use Subdivision Schema",
405 "Export meshes using Alembic's subdivision schema");
410 "Apply Subdivision Surface",
411 "Export subdivision surfaces as meshes");
417 "Export curves and NURBS surfaces as meshes");
423 "Export data of duplicated objects as Alembic instances; speeds up the export "
424 "and can be disabled for compatibility with other software");
433 "Value by which to enlarge or shrink the objects with respect to the world's origin",
441 "Export polygons (quads and n-gons) as triangles");
448 "Method for splitting the quads into triangles");
455 "Method for splitting the n-gons into triangles");
461 "Exports hair particle systems as animated curves");
463 ot->
srna,
"export_particles", 1,
"Export Particles",
"Exports non-hair particle systems");
466 "export_custom_properties",
468 "Export Custom Properties",
469 "Export custom properties to Alembic .userProperties");
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");
482 rna_enum_abc_export_evaluation_mode_items,
485 "Determines visibility of objects, modifier settings, and other areas where there "
486 "are different settings for viewport and rendering");
498 typedef struct CacheFrame {
499 struct CacheFrame *
next, *prev;
503 static int cmp_frame(
const void *
a,
const void *b)
505 const CacheFrame *frame_a =
a;
506 const CacheFrame *frame_b = b;
508 if (frame_a->framenr < frame_b->framenr) {
511 if (frame_a->framenr > frame_b->framenr) {
517 static int get_sequence_len(
char *filename,
int *ofs)
530 if (path[0] ==
'\0') {
538 "Error opening directory '%s': %s\n",
540 errno ? strerror(errno) :
"unknown error");
544 const char *ext =
".abc";
546 const int len = strlen(
basename) - (numdigit + strlen(ext));
554 if (!strstr(fname->
d_name, ext)) {
562 CacheFrame *cache_frame =
MEM_callocN(
sizeof(CacheFrame),
"abc_frame");
573 CacheFrame *cache_frame = frames.
first;
576 int frame_curr = cache_frame->framenr;
579 while (cache_frame && (cache_frame->framenr == frame_curr)) {
581 cache_frame = cache_frame->next;
586 return frame_curr - (*ofs);
623 ui_alembic_import_settings(op->
layout, &
ptr);
652 int sequence_len = 1;
655 sequence_len = get_sequence_len(filename, &offset);
656 if (sequence_len < 0) {
683 ot->
name =
"Import Alembic";
685 ot->
idname =
"WM_OT_alembic_import";
688 ot->
invoke = wm_alembic_import_invoke;
689 ot->
exec = wm_alembic_import_exec;
691 ot->
ui = wm_alembic_import_draw;
708 "Value by which to enlarge or shrink the objects with respect to the world's origin",
717 "If checked, update scene's start and end frame to match those of the Alembic archive");
723 "Check imported mesh objects for invalid data (slow)");
729 "Set to true if the cache is split into separate files");
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");
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)
struct Object * CTX_data_edit_object(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
const char * BKE_main_blendfile_path_from_global(void)
void BKE_report(ReportList *reports, ReportType type, const char *message)
BLI_INLINE void BLI_listbase_clear(struct ListBase *lb)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
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)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen)
bool BLI_path_frame_get(char *path, int *r_frame, int *numdigits) ATTR_NONNULL()
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL()
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define STREQLEN(a, b, n)
Compatibility-like things for windows.
struct dirent * readdir(DIR *dp)
DIR * opendir(const char *path)
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
@ MOD_TRIANGULATE_NGON_BEAUTY
Object is a sort of wrapper for general info.
bool ED_object_mode_set(struct bContext *C, eObjectMode mode)
Read Guarded memory(de)allocation.
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)
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
#define WM_FILESEL_RELPATH
#define WM_FILESEL_FILEPATH
static char * basename(char *string)
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)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_modifier_triangulate_ngon_method_items[]
const EnumPropertyItem rna_enum_modifier_triangulate_quad_method_items[]
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* ui)(struct bContext *, struct wmOperator *)
bool(* check)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
void WM_event_add_fileselect(bContext *C, wmOperator *op)
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))