Blender V4.5
alembic_capi.cc File Reference
#include "../ABC_alembic.h"
#include "IO_types.hh"
#include <Alembic/AbcGeom/ILight.h>
#include <Alembic/AbcGeom/INuPatch.h>
#include <Alembic/AbcMaterial/IMaterial.h>
#include "abc_reader_archive.h"
#include "abc_reader_camera.h"
#include "abc_reader_curves.h"
#include "abc_reader_mesh.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_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_cachefile.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_object.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "ED_undo.hh"
#include "BLI_compiler_compat.h"
#include "BLI_listbase.h"
#include "BLI_math_matrix.h"
#include "BLI_path_utils.hh"
#include "BLI_sort.hh"
#include "BLI_span.hh"
#include "BLI_string.h"
#include "BLI_timeit.hh"
#include "BLT_translation.hh"
#include "WM_api.hh"
#include "WM_types.hh"

Go to the source code of this file.

Classes

struct  AlembicArchiveData
struct  ImportJobData

Enumerations

enum  { ABC_NO_ERROR = 0 , ABC_ARCHIVE_FAIL }

Functions

BLI_INLINE AlembicArchiveDataarchive_from_handle (CacheArchiveHandle *handle)
BLI_INLINE CacheArchiveHandlehandle_from_archive (AlembicArchiveData *archive)
static void add_object_path (ListBase *object_paths, const IObject &object)
static bool gather_objects_paths (const IObject &object, ListBase *object_paths)
CacheArchiveHandleABC_create_handle (const Main *bmain, const char *filepath, 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 sort_readers (blender::MutableSpan< AbcObjectReader * > readers)
static void import_file (ImportJobData *data, const char *filepath, float progress_factor)
static void set_frame_range (ImportJobData *data)
static void import_startjob (void *user_data, wmJobWorkerStatus *worker_status)
static void import_endjob (void *user_data)
static void import_freejob (void *user_data)
bool ABC_import (bContext *C, const AlembicImportParams *params, bool as_background_job)
void ABC_get_transform (CacheReader *reader, float r_mat_world[4][4], double time, float scale)
static AbcObjectReaderget_abc_reader (CacheReader *reader, Object *ob, const char **r_err_str)
static ISampleSelector sample_selector_for_time (chrono_t time)
void ABC_read_geometry (CacheReader *reader, Object *ob, blender::bke::GeometrySet &geometry_set, const ABCReadParams *params, const char **r_err_str)
bool ABC_mesh_topology_changed (CacheReader *reader, Object *ob, const Mesh *existing_mesh, const double time, const char **r_err_str)
void ABC_CacheReader_free (CacheReader *reader)
CacheReaderCacheReader_open_alembic_object (CacheArchiveHandle *handle, CacheReader *reader, Object *object, const char *object_path, const bool is_sequence)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ABC_NO_ERROR 
ABC_ARCHIVE_FAIL 

Definition at line 436 of file alembic_capi.cc.

Function Documentation

◆ ABC_CacheReader_free()

◆ ABC_create_handle()

◆ ABC_free_handle()

void ABC_free_handle ( CacheArchiveHandle * handle)

◆ ABC_get_transform()

◆ ABC_get_version()

int ABC_get_version ( )

Definition at line 211 of file alembic_capi.cc.

References ABC_get_version().

Referenced by ABC_get_version(), and make_alembic_info().

◆ ABC_import()

◆ ABC_mesh_topology_changed()

bool ABC_mesh_topology_changed ( CacheReader * reader,
Object * ob,
const Mesh * existing_mesh,
const double time,
const char ** r_err_str )

◆ ABC_read_geometry()

◆ add_object_path()

void add_object_path ( ListBase * object_paths,
const IObject & object )
static

◆ archive_from_handle()

BLI_INLINE AlembicArchiveData * archive_from_handle ( CacheArchiveHandle * handle)

◆ CacheReader_open_alembic_object()

◆ find_iobject()

void find_iobject ( const IObject & object,
IObject & ret,
const std::string & path )
static

Definition at line 216 of file alembic_capi.cc.

References find_iobject(), ret, and blender::io::alembic::split().

Referenced by CacheReader_open_alembic_object(), and find_iobject().

◆ gather_objects_paths()

bool gather_objects_paths ( const IObject & object,
ListBase * object_paths )
static

◆ get_abc_reader()

◆ handle_from_archive()

BLI_INLINE CacheArchiveHandle * handle_from_archive ( AlembicArchiveData * archive)

Definition at line 102 of file alembic_capi.cc.

References BLI_INLINE, and handle_from_archive().

Referenced by ABC_create_handle(), and handle_from_archive().

◆ import_endjob()

◆ import_file()

◆ import_freejob()

void import_freejob ( void * user_data)
static

Definition at line 731 of file alembic_capi.cc.

References data, and import_freejob().

Referenced by ABC_import(), and import_freejob().

◆ import_startjob()

void import_startjob ( void * user_data,
wmJobWorkerStatus * worker_status )
static

◆ report_job_duration()

void report_job_duration ( const ImportJobData * data)
static

◆ sample_selector_for_time()

ISampleSelector sample_selector_for_time ( chrono_t time)
static

◆ set_frame_range()

void set_frame_range ( ImportJobData * data)
static

◆ sort_readers()

◆ visit_object()

std::pair< bool, AbcObjectReader * > visit_object ( const IObject & object,
AbcObjectReader::ptr_vector & readers,
ImportSettings & settings,
AbcObjectReader::ptr_vector & r_assign_as_parent )
static

Generates an AbcObjectReader for this Alembic object and its children.

Parameters
objectThe Alembic IObject to visit.
readersThe created AbcObjectReader * will be appended to this vector.
settingsImport settings, not used directly but passed to the AbcObjectReader subclass constructors.
r_assign_as_parentReturn 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.
Returns
A pair of boolean and reader pointer. The boolean indicates whether this IObject claims its parent as part of the same object (for example an IPolyMesh object would claim its parent, as the mesh is interpreted as the object's data, and the parent IXform as its Blender object). The pointer is the AbcObjectReader that represents the IObject parameter.

NOTE: this function is similar to gather_object_paths above, need to keep them in sync.

Definition at line 258 of file alembic_capi.cc.

References blender::io::alembic::AbcCameraReader::AbcCameraReader(), blender::io::alembic::AbcCurveReader::AbcCurveReader(), blender::io::alembic::AbcEmptyReader::AbcEmptyReader(), blender::io::alembic::AbcMeshReader::AbcMeshReader(), blender::io::alembic::AbcNurbsReader::AbcNurbsReader(), blender::io::alembic::AbcPointsReader::AbcPointsReader(), blender::io::alembic::AbcSubDReader::AbcSubDReader(), add_object_path(), BLI_assert, blender::io::alembic::ImportSettings::cache_file, getParent(), blender::io::alembic::has_property(), i, blender::io::alembic::AbcObjectReader::incref(), CacheFile::object_paths, UNUSED_VARS_NDEBUG, and visit_object().

Referenced by import_file(), and visit_object().