Blender
V3.3
|
#include "../ABC_alembic.h"
#include "IO_types.h"
#include <Alembic/AbcMaterial/IMaterial.h>
#include "abc_axis_conversion.h"
#include "abc_reader_archive.h"
#include "abc_reader_camera.h"
#include "abc_reader_curves.h"
#include "abc_reader_mesh.h"
#include "abc_reader_nurbs.h"
#include "abc_reader_points.h"
#include "abc_reader_transform.h"
#include "abc_util.h"
#include "MEM_guardedalloc.h"
#include "DNA_cachefile_types.h"
#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_cachefile.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_global.h"
#include "BKE_layer.h"
#include "BKE_lib_id.h"
#include "BKE_object.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "ED_undo.h"
#include "BLI_compiler_compat.h"
#include "BLI_fileops.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
#include "BLI_timeit.hh"
#include "WM_api.h"
#include "WM_types.h"
Go to the source code of this file.
Classes | |
struct | ImportJobData |
Enumerations | |
enum | { ABC_NO_ERROR = 0 , ABC_ARCHIVE_FAIL } |
Functions | |
BLI_INLINE ArchiveReader * | archive_from_handle (CacheArchiveHandle *handle) |
BLI_INLINE CacheArchiveHandle * | handle_from_archive (ArchiveReader *archive) |
static bool | gather_objects_paths (const IObject &object, ListBase *object_paths) |
CacheArchiveHandle * | ABC_create_handle (struct Main *bmain, const char *filename, const CacheFileLayer *layers, ListBase *object_paths) |
void | ABC_free_handle (CacheArchiveHandle *handle) |
int | ABC_get_version () |
static void | find_iobject (const IObject &object, IObject &ret, const std::string &path) |
static std::pair< bool, AbcObjectReader * > | visit_object (const IObject &object, AbcObjectReader::ptr_vector &readers, ImportSettings &settings, AbcObjectReader::ptr_vector &r_assign_as_parent) |
static void | report_job_duration (const ImportJobData *data) |
static void | import_startjob (void *user_data, short *stop, short *do_update, float *progress) |
static void | import_endjob (void *user_data) |
static void | import_freejob (void *user_data) |
bool | ABC_import (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) |
void | ABC_get_transform (CacheReader *reader, float r_mat_world[4][4], double time, float scale) |
static AbcObjectReader * | get_abc_reader (CacheReader *reader, Object *ob, const char **err_str) |
static ISampleSelector | sample_selector_for_time (chrono_t time) |
Mesh * | ABC_read_mesh (CacheReader *reader, Object *ob, Mesh *existing_mesh, const ABCReadParams *params, const char **err_str) |
bool | ABC_mesh_topology_changed (CacheReader *reader, Object *ob, const Mesh *existing_mesh, const double time, const char **err_str) |
void | ABC_CacheReader_free (CacheReader *reader) |
void | ABC_CacheReader_incref (CacheReader *reader) |
CacheReader * | CacheReader_open_alembic_object (CacheArchiveHandle *handle, CacheReader *reader, Object *object, const char *object_path) |
anonymous enum |
Enumerator | |
---|---|
ABC_NO_ERROR | |
ABC_ARCHIVE_FAIL |
Definition at line 412 of file alembic_capi.cc.
void ABC_CacheReader_free | ( | CacheReader * | reader | ) |
Definition at line 836 of file alembic_capi.cc.
References blender::io::alembic::AbcObjectReader::decref(), and blender::io::alembic::AbcObjectReader::refcount().
Referenced by BKE_cachefile_reader_free(), cachefile_handle_free(), and CacheReader_open_alembic_object().
void ABC_CacheReader_incref | ( | CacheReader * | reader | ) |
Definition at line 846 of file alembic_capi.cc.
References blender::io::alembic::AbcObjectReader::incref().
CacheArchiveHandle* ABC_create_handle | ( | struct Main * | bmain, |
const char * | filename, | ||
const CacheFileLayer * | layers, | ||
ListBase * | object_paths | ||
) |
Definition at line 147 of file alembic_capi.cc.
References CACHEFILE_LAYER_HIDDEN, CacheFileLayer::filepath, CacheFileLayer::flag, gather_objects_paths(), blender::io::alembic::ArchiveReader::get(), blender::io::alembic::ArchiveReader::getTop(), handle_from_archive(), CacheFileLayer::next, and blender::io::alembic::ArchiveReader::valid().
void ABC_free_handle | ( | CacheArchiveHandle * | handle | ) |
Definition at line 179 of file alembic_capi.cc.
References archive_from_handle().
Referenced by cachefile_handle_free().
void ABC_get_transform | ( | CacheReader * | reader, |
float | r_mat_world[4][4], | ||
double | time, | ||
float | scale | ||
) |
Definition at line 741 of file alembic_capi.cc.
References BKE_object_get_parent_matrix(), mul_m4_m4m4(), blender::io::alembic::AbcObjectReader::object(), Object::parent, Object::parentinv, blender::io::alembic::AbcObjectReader::read_matrix(), and time.
Referenced by transformcache_evaluate().
int ABC_get_version | ( | void | ) |
Definition at line 184 of file alembic_capi.cc.
Referenced by make_alembic_info().
bool ABC_import | ( | 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 | ||
) |
Definition at line 673 of file alembic_capi.cc.
References ABC_NO_ERROR, blender::io::alembic::ImportSettings::always_add_cache_reader, ImportJobData::archive, BLI_strncpy(), ImportJobData::bmain, C, ImportJobData::C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_manager(), CTX_wm_window(), ImportJobData::error_code, ImportJobData::filename, G, import_endjob(), import_freejob(), ImportJobData::import_ok, import_startjob(), ImportJobData::is_background_job, blender::io::alembic::ImportSettings::is_sequence, NC_SCENE, ND_FRAME, offset, blender::io::alembic::ImportSettings::scale, ImportJobData::scene, blender::io::alembic::ImportSettings::sequence_len, blender::io::alembic::ImportSettings::sequence_offset, blender::io::alembic::ImportSettings::set_frame_range, ImportJobData::settings, blender::io::alembic::ImportSettings::validate_meshes, ImportJobData::view_layer, ImportJobData::was_cancelled, ImportJobData::wm, WM_JOB_PROGRESS, WM_JOB_TYPE_ALEMBIC, WM_jobs_callbacks(), WM_jobs_customdata_set(), WM_jobs_get(), WM_jobs_start(), and WM_jobs_timer().
bool ABC_mesh_topology_changed | ( | CacheReader * | reader, |
Object * | ob, | ||
const Mesh * | existing_mesh, | ||
const double | time, | ||
const char ** | err_str | ||
) |
Definition at line 819 of file alembic_capi.cc.
References get_abc_reader(), sample_selector_for_time(), time, and blender::io::alembic::AbcObjectReader::topology_changed().
Mesh* ABC_read_mesh | ( | CacheReader * | reader, |
Object * | ob, | ||
Mesh * | existing_mesh, | ||
const ABCReadParams * | params, | ||
const char ** | err_str | ||
) |
Definition at line 799 of file alembic_capi.cc.
References get_abc_reader(), params, blender::io::alembic::AbcObjectReader::read_mesh(), and sample_selector_for_time().
Referenced by modifyMesh().
BLI_INLINE ArchiveReader* archive_from_handle | ( | CacheArchiveHandle * | handle | ) |
Definition at line 80 of file alembic_capi.cc.
Referenced by ABC_free_handle(), and CacheReader_open_alembic_object().
CacheReader* CacheReader_open_alembic_object | ( | CacheArchiveHandle * | handle, |
CacheReader * | reader, | ||
Object * | object, | ||
const char * | object_path | ||
) |
Definition at line 852 of file alembic_capi.cc.
References ABC_CacheReader_free(), archive_from_handle(), blender::io::alembic::create_reader(), find_iobject(), blender::io::alembic::ArchiveReader::getTop(), blender::io::alembic::AbcObjectReader::incref(), blender::io::alembic::AbcObjectReader::object(), and blender::io::alembic::ArchiveReader::valid().
Referenced by BKE_cachefile_reader_open().
|
static |
Definition at line 189 of file alembic_capi.cc.
References ret, and blender::io::alembic::split().
Referenced by CacheReader_open_alembic_object().
Definition at line 94 of file alembic_capi.cc.
References BLI_addtail(), BLI_strncpy(), getParent(), blender::io::alembic::has_property(), MEM_callocN, and CacheObjectPath::path.
Referenced by ABC_create_handle().
|
static |
Definition at line 773 of file alembic_capi.cc.
References blender::io::alembic::AbcObjectReader::accepts_object_type(), and blender::io::alembic::AbcObjectReader::iobject().
Referenced by ABC_mesh_topology_changed(), and ABC_read_mesh().
BLI_INLINE CacheArchiveHandle* handle_from_archive | ( | ArchiveReader * | archive | ) |
Definition at line 85 of file alembic_capi.cc.
Referenced by ABC_create_handle().
Definition at line 581 of file alembic_capi.cc.
References ABC_ARCHIVE_FAIL, ABC_NO_ERROR, BKE_collection_object_add(), BKE_id_free_us(), BKE_layer_collection_get_active(), BKE_layer_collection_resync_allow(), BKE_layer_collection_resync_forbid(), BKE_main_collection_sync(), BKE_view_layer_base_deselect_all(), BKE_view_layer_base_find(), BKE_view_layer_base_select_and_set_active(), LayerCollection::collection, data, blender::io::alembic::AbcObjectReader::decref(), DEG_id_tag_update(), DEG_id_tag_update_ex(), DEG_relations_tag_update(), ED_undo_push(), Collection::id, Object::id, ID_RECALC_ANIMATION, ID_RECALC_BASE_FLAGS, ID_RECALC_COPY_ON_WRITE, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, NC_SCENE, ND_FRAME, blender::io::alembic::AbcObjectReader::object(), blender::io::alembic::AbcObjectReader::refcount(), blender::io::alembic::report_job_duration(), RPT_ERROR, SCOPE_TIMER, user_data, WM_main_add_notifier(), WM_report(), and WM_set_locked_interface().
Referenced by ABC_import().
Definition at line 666 of file alembic_capi.cc.
References data, and user_data.
Referenced by ABC_import().
|
static |
Definition at line 449 of file alembic_capi.cc.
References ABC_ARCHIVE_FAIL, BKE_cachefile_add(), BLI_assert, BLI_path_basename(), RenderData::cfra, data, RenderData::efra, CacheFile::filepath, FPS, G, blender::io::alembic::ArchiveReader::get(), blender::io::alembic::ArchiveReader::getTop(), CacheFile::id, id_us_min(), blender::io::alembic::AbcObjectReader::inherits_xform(), CacheFile::is_sequence, max, blender::io::alembic::AbcObjectReader::maxTime(), min, blender::io::alembic::AbcObjectReader::minTime(), blender::io::alembic::AbcObjectReader::name(), blender::io::alembic::AbcObjectReader::object(), Object::parent, blender::io::alembic::AbcObjectReader::parent_reader, Scene::r, blender::io::alembic::AbcObjectReader::readObjectData(), CacheFile::scale, scene, SCOPE_TIMER, blender::io::alembic::AbcObjectReader::setupObjectTransform(), RenderData::sfra, size(), STRNCPY, user_data, blender::io::alembic::ArchiveReader::valid(), blender::io::alembic::AbcObjectReader::valid(), visit_object(), and WM_set_locked_interface().
Referenced by ABC_import().
|
static |
Definition at line 441 of file alembic_capi.cc.
References data, and blender::timeit::print_duration().
|
static |
Definition at line 792 of file alembic_capi.cc.
References time.
Referenced by ABC_mesh_topology_changed(), and ABC_read_mesh().
|
static |
Generates an AbcObjectReader for this Alembic object and its children.
object | The Alembic IObject to visit. |
readers | The created AbcObjectReader * will be appended to this vector. |
settings | Import settings, not used directly but passed to the AbcObjectReader subclass constructors. |
r_assign_as_parent | Return parameter, contains a list of reader pointers, whose parent pointer should still be set. This is filled when this call to visit_object() didn't create a reader that should be the parent. |
NOTE: this function is similar to gather_object_paths above, need to keep them in sync.
Definition at line 231 of file alembic_capi.cc.
References BLI_addtail(), BLI_assert, BLI_strncpy(), blender::io::alembic::ImportSettings::cache_file, getParent(), blender::io::alembic::has_property(), blender::io::alembic::AbcObjectReader::incref(), MEM_callocN, CacheFile::object_paths, blender::io::alembic::AbcObjectReader::parent_reader, CacheObjectPath::path, and UNUSED_VARS_NDEBUG.
Referenced by import_startjob().