Blender  V3.3
Classes | Enumerations | Functions
alembic_capi.cc File Reference
#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 ArchiveReaderarchive_from_handle (CacheArchiveHandle *handle)
 
BLI_INLINE CacheArchiveHandlehandle_from_archive (ArchiveReader *archive)
 
static bool gather_objects_paths (const IObject &object, ListBase *object_paths)
 
CacheArchiveHandleABC_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 AbcObjectReaderget_abc_reader (CacheReader *reader, Object *ob, const char **err_str)
 
static ISampleSelector sample_selector_for_time (chrono_t time)
 
MeshABC_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)
 
CacheReaderCacheReader_open_alembic_object (CacheArchiveHandle *handle, CacheReader *reader, Object *object, const char *object_path)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ABC_NO_ERROR 
ABC_ARCHIVE_FAIL 

Definition at line 412 of file alembic_capi.cc.

Function Documentation

◆ ABC_CacheReader_free()

void ABC_CacheReader_free ( CacheReader reader)

◆ ABC_CacheReader_incref()

void ABC_CacheReader_incref ( CacheReader reader)

Definition at line 846 of file alembic_capi.cc.

References blender::io::alembic::AbcObjectReader::incref().

◆ ABC_create_handle()

CacheArchiveHandle* ABC_create_handle ( struct Main bmain,
const char *  filename,
const CacheFileLayer layers,
ListBase object_paths 
)

◆ ABC_free_handle()

void ABC_free_handle ( CacheArchiveHandle handle)

Definition at line 179 of file alembic_capi.cc.

References archive_from_handle().

Referenced by cachefile_handle_free().

◆ ABC_get_transform()

void ABC_get_transform ( CacheReader reader,
float  r_mat_world[4][4],
double  time,
float  scale 
)

◆ ABC_get_version()

int ABC_get_version ( void  )

Definition at line 184 of file alembic_capi.cc.

Referenced by make_alembic_info().

◆ ABC_import()

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 
)

◆ ABC_mesh_topology_changed()

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

◆ ABC_read_mesh()

Mesh* ABC_read_mesh ( CacheReader reader,
Object ob,
Mesh existing_mesh,
const ABCReadParams params,
const char **  err_str 
)

◆ archive_from_handle()

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_open_alembic_object()

CacheReader* CacheReader_open_alembic_object ( CacheArchiveHandle handle,
CacheReader reader,
Object object,
const char *  object_path 
)

◆ find_iobject()

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

Definition at line 189 of file alembic_capi.cc.

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

Referenced by CacheReader_open_alembic_object().

◆ gather_objects_paths()

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

◆ get_abc_reader()

static AbcObjectReader* get_abc_reader ( CacheReader reader,
Object ob,
const char **  err_str 
)
static

◆ handle_from_archive()

BLI_INLINE CacheArchiveHandle* handle_from_archive ( ArchiveReader archive)

Definition at line 85 of file alembic_capi.cc.

Referenced by ABC_create_handle().

◆ import_endjob()

static void import_endjob ( void user_data)
static

◆ import_freejob()

static void import_freejob ( void user_data)
static

Definition at line 666 of file alembic_capi.cc.

References data, and user_data.

Referenced by ABC_import().

◆ import_startjob()

static void import_startjob ( void user_data,
short *  stop,
short *  do_update,
float progress 
)
static

◆ report_job_duration()

static void report_job_duration ( const ImportJobData data)
static

Definition at line 441 of file alembic_capi.cc.

References data, and blender::timeit::print_duration().

◆ sample_selector_for_time()

static ISampleSelector sample_selector_for_time ( chrono_t  time)
static

Definition at line 792 of file alembic_capi.cc.

References time.

Referenced by ABC_mesh_topology_changed(), and ABC_read_mesh().

◆ visit_object()

static 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 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().