Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/io/io_alembic.c
| Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) | ||||
| col = uiLayoutColumn(box, true); | col = uiLayoutColumn(box, true); | ||||
| uiItemR(col, imfptr, "export_hair", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "export_hair", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, imfptr, "export_particles", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "export_particles", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| static void wm_alembic_export_draw(bContext *C, wmOperator *op) | static void wm_alembic_export_draw(bContext *C, wmOperator *op) | ||||
| { | { | ||||
| PointerRNA ptr; | |||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| /* Conveniently set start and end frame to match the scene's frame range. */ | /* Conveniently set start and end frame to match the scene's frame range. */ | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| if (scene != NULL && RNA_boolean_get(&ptr, "init_scene_frame_range")) { | if (scene != NULL && RNA_boolean_get(op->ptr, "init_scene_frame_range")) { | ||||
| RNA_int_set(&ptr, "start", SFRA); | RNA_int_set(op->ptr, "start", SFRA); | ||||
| RNA_int_set(&ptr, "end", EFRA); | RNA_int_set(op->ptr, "end", EFRA); | ||||
| RNA_boolean_set(&ptr, "init_scene_frame_range", false); | RNA_boolean_set(op->ptr, "init_scene_frame_range", false); | ||||
| } | } | ||||
| ui_alembic_export_settings(op->layout, &ptr); | ui_alembic_export_settings(op->layout, op->ptr); | ||||
| } | } | ||||
| static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op) | static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| char filepath[FILE_MAX]; | char filepath[FILE_MAX]; | ||||
| RNA_string_get(op->ptr, "filepath", filepath); | RNA_string_get(op->ptr, "filepath", filepath); | ||||
| if (!BLI_path_extension_check(filepath, ".abc")) { | if (!BLI_path_extension_check(filepath, ".abc")) { | ||||
| ▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | static void ui_alembic_import_settings(uiLayout *layout, PointerRNA *imfptr) | ||||
| uiItemR(col, imfptr, "relative_path", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "relative_path", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, imfptr, "set_frame_range", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "set_frame_range", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, imfptr, "is_sequence", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "is_sequence", 0, NULL, ICON_NONE); | ||||
| uiItemR(col, imfptr, "validate_meshes", 0, NULL, ICON_NONE); | uiItemR(col, imfptr, "validate_meshes", 0, NULL, ICON_NONE); | ||||
| } | } | ||||
| static void wm_alembic_import_draw(bContext *UNUSED(C), wmOperator *op) | static void wm_alembic_import_draw(bContext *UNUSED(C), wmOperator *op) | ||||
| { | { | ||||
| PointerRNA ptr; | ui_alembic_import_settings(op->layout, op->ptr); | ||||
| RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr); | |||||
| ui_alembic_import_settings(op->layout, &ptr); | |||||
| } | } | ||||
| /* op->invoke, opens fileselect if path property not set, otherwise executes */ | /* op->invoke, opens fileselect if path property not set, otherwise executes */ | ||||
| static int wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) | static int wm_alembic_import_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| { | { | ||||
| if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) { | if (!RNA_struct_property_is_set(op->ptr, "as_background_job")) { | ||||
| RNA_boolean_set(op->ptr, "as_background_job", true); | RNA_boolean_set(op->ptr, "as_background_job", true); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines | |||||