61 "Use Render settings for object visibility, modifier settings, etc"},
66 "Use Viewport settings for object visibility, modifier settings, etc"},
83 BLI_strncpy(filepath,
"untitled",
sizeof(filepath));
146 if (
params.frame_start == INT_MIN) {
149 if (
params.frame_end == INT_MIN) {
169 uiItemR(box, imfptr,
"global_scale", 0,
NULL, ICON_NONE);
179 uiItemR(sub, imfptr,
"start", 0,
IFACE_(
"Frame Start"), ICON_NONE);
182 uiItemR(
col, imfptr,
"xsamples", 0,
IFACE_(
"Samples Transform"), 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);
196 uiItemR(sub, imfptr,
"selected", 0,
IFACE_(
"Selected Objects"), ICON_NONE);
197 uiItemR(sub, imfptr,
"visible_objects_only", 0,
IFACE_(
"Visible Objects"), ICON_NONE);
212 uiItemR(row, imfptr,
"packuv", 0,
NULL, ICON_NONE);
223 uiItemR(sub, imfptr,
"apply_subdiv", 0,
IFACE_(
"Apply"), ICON_NONE);
224 uiItemR(sub, imfptr,
"subdiv_schema", 0,
IFACE_(
"Use Schema"), ICON_NONE);
232 uiItemR(sub, imfptr,
"quad_method", 0,
IFACE_(
"Method Quads"), ICON_NONE);
233 uiItemR(sub, imfptr,
"ngon_method", 0,
IFACE_(
"Polygons"), ICON_NONE);
238 uiItemL(row,
IFACE_(
"Particle Systems"), ICON_PARTICLE_DATA);
257 ui_alembic_export_settings(op->
layout, op->
ptr);
276 ot->
name =
"Export Alembic";
277 ot->
description =
"Export current scene in an Alembic archive";
278 ot->
idname =
"WM_OT_alembic_export";
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;
304 "Start frame of the export, use the default value to "
305 "take the start frame of the current scene",
315 "End frame of the export, use the default value to "
316 "take the end frame of the current scene",
326 "Number of times per frame transformations are sampled",
336 "Number of times per frame object data are sampled",
346 "Time at which the shutter is open",
356 "Time at which the shutter is closed",
361 ot->
srna,
"selected", 0,
"Selected Objects Only",
"Export only selected objects");
364 "visible_objects_only",
366 "Visible Objects Only",
367 "Export only objects that are visible");
373 "Do not preserve objects' parent/children relationship");
386 "Generated Coordinates",
387 "Export undeformed mesh vertex coordinates");
390 ot->
srna,
"face_sets", 0,
"Face Sets",
"Export per face shading group assignments");
395 "Use Subdivision Schema",
396 "Export meshes using Alembic's subdivision schema");
401 "Apply Subdivision Surface",
402 "Export subdivision surfaces as meshes");
408 "Export curves and NURBS surfaces as meshes");
414 "Export data of duplicated objects as Alembic instances; speeds up the export "
415 "and can be disabled for compatibility with other software");
424 "Value by which to enlarge or shrink the objects with respect to the world's origin",
432 "Export polygons (quads and n-gons) as triangles");
439 "Method for splitting the quads into triangles");
446 "Method for splitting the n-gons into triangles");
452 "Exports hair particle systems as animated curves");
454 ot->
srna,
"export_particles", 1,
"Export Particles",
"Exports non-hair particle systems");
457 "export_custom_properties",
459 "Export Custom Properties",
460 "Export custom properties to Alembic .userProperties");
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");
473 rna_enum_abc_export_evaluation_mode_items,
476 "Determines visibility of objects, modifier settings, and other areas where there "
477 "are different settings for viewport and rendering");
489 typedef struct CacheFrame {
494 static int cmp_frame(
const void *
a,
const void *
b)
496 const CacheFrame *frame_a =
a;
497 const CacheFrame *frame_b =
b;
499 if (frame_a->framenr < frame_b->framenr) {
502 if (frame_a->framenr > frame_b->framenr) {
508 static int get_sequence_len(
char *filename,
int *ofs)
521 if (path[0] ==
'\0') {
529 "Error opening directory '%s': %s\n",
531 errno ? strerror(errno) :
"unknown error");
535 const char *ext =
".abc";
537 const int len = strlen(
basename) - (numdigit + strlen(ext));
545 if (!strstr(fname->
d_name, ext)) {
553 CacheFrame *cache_frame =
MEM_callocN(
sizeof(CacheFrame),
"abc_frame");
564 CacheFrame *cache_frame = frames.
first;
567 int frame_curr = cache_frame->framenr;
570 while (cache_frame && (cache_frame->framenr == frame_curr)) {
572 cache_frame = cache_frame->next;
577 return frame_curr - (*ofs);
606 uiItemR(
col, imfptr,
"always_add_cache_reader", 0,
NULL, ICON_NONE);
611 ui_alembic_import_settings(op->
layout, op->
ptr);
637 const bool always_add_cache_reader =
RNA_boolean_get(op->
ptr,
"always_add_cache_reader");
641 int sequence_len = 1;
644 sequence_len = get_sequence_len(filename, &
offset);
645 if (sequence_len < 0) {
665 always_add_cache_reader,
673 ot->
name =
"Import Alembic";
675 ot->
idname =
"WM_OT_alembic_import";
678 ot->
invoke = wm_alembic_import_invoke;
679 ot->
exec = wm_alembic_import_exec;
681 ot->
ui = wm_alembic_import_draw;
701 "Value by which to enlarge or shrink the objects with respect to the world's origin",
710 "If checked, update scene's start and end frame to match those of the Alembic archive");
716 "Check imported mesh objects for invalid data (slow)");
719 "always_add_cache_reader",
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");
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 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)
struct Object * CTX_data_edit_object(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, eReportType 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)
void BLI_split_dir_part(const char *string, char *dir, size_t dirlen)
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
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_frame_get(char *path, int *r_frame, int *r_digits_len) 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, 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_NGON_BEAUTY
@ MOD_TRIANGULATE_QUAD_SHORTEDGE
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)
static char * basename(char *string)
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)
SymEdge< T > * prev(const SymEdge< T > *se)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
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_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
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
void WM_event_add_fileselect(bContext *C, wmOperator *op)
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))