Blender V4.3
alembic_capi.cc File Reference
#include "../ABC_alembic.h"
#include "IO_types.hh"
#include <Alembic/AbcGeom/ILight.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_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  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 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 415 of file alembic_capi.cc.

Function Documentation

◆ ABC_CacheReader_free()

◆ ABC_create_handle()

◆ ABC_free_handle()

void ABC_free_handle ( CacheArchiveHandle * handle)

Definition at line 185 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 190 of file alembic_capi.cc.

Referenced by 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()

void ABC_read_geometry ( CacheReader * reader,
Object * ob,
blender::bke::GeometrySet & geometry_set,
const ABCReadParams * params,
const char ** r_err_str )

◆ add_object_path()

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

Definition at line 93 of file alembic_capi.cc.

References BLI_addtail(), CacheObjectPath::path, and STRNCPY.

Referenced by gather_objects_paths(), and visit_object().

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

◆ find_iobject()

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

Definition at line 195 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 ** r_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()

◆ import_file()

◆ import_freejob()

static void import_freejob ( void * user_data)
static

Definition at line 708 of file alembic_capi.cc.

References data.

Referenced by ABC_import().

◆ import_startjob()

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

◆ report_job_duration()

static void report_job_duration ( const ImportJobData * data)
static

Definition at line 450 of file alembic_capi.cc.

References blender::timeit::print_duration().

◆ sample_selector_for_time()

static ISampleSelector sample_selector_for_time ( chrono_t time)
static

Definition at line 823 of file alembic_capi.cc.

Referenced by ABC_mesh_topology_changed(), and ABC_read_geometry().

◆ set_frame_range()

static void set_frame_range ( ImportJobData * data)
static

Definition at line 584 of file alembic_capi.cc.

References FPS, int, Scene::r, and RenderData::sfra.

Referenced by import_startjob().

◆ sort_readers()

static void sort_readers ( blender::MutableSpan< AbcObjectReader * > readers)
static

◆ 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 237 of file alembic_capi.cc.

References add_object_path(), BLI_assert, getParent(), blender::io::alembic::has_property(), blender::io::alembic::AbcObjectReader::incref(), blender::io::alembic::AbcObjectReader::parent_reader, UNUSED_VARS_NDEBUG, and visit_object().

Referenced by import_file(), and visit_object().