Changeset View
Changeset View
Standalone View
Standalone View
source/blender/alembic/intern/alembic_capi.cc
| Show First 20 Lines • Show All 621 Lines • ▼ Show 20 Lines | struct ImportJobData { | ||||
| Main *bmain; | Main *bmain; | ||||
| Scene *scene; | Scene *scene; | ||||
| ViewLayer *view_layer; | ViewLayer *view_layer; | ||||
| wmWindowManager *wm; | wmWindowManager *wm; | ||||
| char filename[1024]; | char filename[1024]; | ||||
| ImportSettings settings; | ImportSettings settings; | ||||
| ArchiveReader *archive; | |||||
| std::vector<AbcObjectReader *> readers; | std::vector<AbcObjectReader *> readers; | ||||
| short *stop; | short *stop; | ||||
| short *do_update; | short *do_update; | ||||
| float *progress; | float *progress; | ||||
| char error_code; | char error_code; | ||||
| bool was_cancelled; | bool was_cancelled; | ||||
| Show All 29 Lines | #endif | ||||
| /* Decrement the ID ref-count because it is going to be incremented for each | /* Decrement the ID ref-count because it is going to be incremented for each | ||||
| * modifier and constraint that it will be attached to, so since currently | * modifier and constraint that it will be attached to, so since currently | ||||
| * it is not used by anyone, its use count will off by one. */ | * it is not used by anyone, its use count will off by one. */ | ||||
| id_us_min(&cache_file->id); | id_us_min(&cache_file->id); | ||||
| cache_file->is_sequence = data->settings.is_sequence; | cache_file->is_sequence = data->settings.is_sequence; | ||||
| cache_file->scale = data->settings.scale; | cache_file->scale = data->settings.scale; | ||||
| cache_file->handle = handle_from_archive(archive); | STRNCPY(cache_file->filepath, data->filename); | ||||
| BLI_strncpy(cache_file->filepath, data->filename, 1024); | |||||
| data->archive = archive; | |||||
| data->settings.cache_file = cache_file; | data->settings.cache_file = cache_file; | ||||
| *data->do_update = true; | *data->do_update = true; | ||||
| *data->progress = 0.05f; | *data->progress = 0.05f; | ||||
| /* Parse Alembic Archive. */ | /* Parse Alembic Archive. */ | ||||
| AbcObjectReader::ptr_vector assign_as_parent; | AbcObjectReader::ptr_vector assign_as_parent; | ||||
| visit_object(archive->getTop(), data->readers, data->settings, assign_as_parent); | visit_object(archive->getTop(), data->readers, data->settings, assign_as_parent); | ||||
| ▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | static void import_endjob(void *user_data) | ||||
| } | } | ||||
| WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene); | WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene); | ||||
| } | } | ||||
| static void import_freejob(void *user_data) | static void import_freejob(void *user_data) | ||||
| { | { | ||||
| ImportJobData *data = static_cast<ImportJobData *>(user_data); | ImportJobData *data = static_cast<ImportJobData *>(user_data); | ||||
| delete data->archive; | |||||
| delete data; | delete data; | ||||
| } | } | ||||
| bool ABC_import(bContext *C, | bool ABC_import(bContext *C, | ||||
| const char *filepath, | const char *filepath, | ||||
| float scale, | float scale, | ||||
| bool is_sequence, | bool is_sequence, | ||||
| bool set_frame_range, | bool set_frame_range, | ||||
| Show All 15 Lines | bool ABC_import(bContext *C, | ||||
| job->settings.scale = scale; | job->settings.scale = scale; | ||||
| job->settings.is_sequence = is_sequence; | job->settings.is_sequence = is_sequence; | ||||
| job->settings.set_frame_range = set_frame_range; | job->settings.set_frame_range = set_frame_range; | ||||
| job->settings.sequence_len = sequence_len; | job->settings.sequence_len = sequence_len; | ||||
| job->settings.sequence_offset = offset; | job->settings.sequence_offset = offset; | ||||
| job->settings.validate_meshes = validate_meshes; | job->settings.validate_meshes = validate_meshes; | ||||
| job->error_code = ABC_NO_ERROR; | job->error_code = ABC_NO_ERROR; | ||||
| job->was_cancelled = false; | job->was_cancelled = false; | ||||
| job->archive = NULL; | |||||
| G.is_break = false; | G.is_break = false; | ||||
| bool import_ok = false; | bool import_ok = false; | ||||
| if (as_background_job) { | if (as_background_job) { | ||||
| wmJob *wm_job = WM_jobs_get(CTX_wm_manager(C), | wmJob *wm_job = WM_jobs_get(CTX_wm_manager(C), | ||||
| CTX_wm_window(C), | CTX_wm_window(C), | ||||
| job->scene, | job->scene, | ||||
| ▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines | |||||