Blender  V2.93
Classes | Enumerations | Functions
alembic_capi.cc File Reference
#include "../ABC_alembic.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 "WM_api.h"
#include "WM_types.h"

Go to the source code of this file.

Classes

struct  AbcArchiveHandle
 
struct  ImportJobData
 

Enumerations

enum  { ABC_NO_ERROR = 0 , ABC_ARCHIVE_FAIL }
 

Functions

BLI_INLINE ArchiveReaderarchive_from_handle (AbcArchiveHandle *handle)
 
BLI_INLINE AbcArchiveHandlehandle_from_archive (ArchiveReader *archive)
 
static bool gather_objects_paths (const IObject &object, ListBase *object_paths)
 
AbcArchiveHandleABC_create_handle (struct Main *bmain, const char *filename, ListBase *object_paths)
 
void ABC_free_handle (AbcArchiveHandle *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 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 as_background_job)
 
void ABC_get_transform (CacheReader *reader, float r_mat_world[4][4], float time, float scale)
 
static AbcObjectReaderget_abc_reader (CacheReader *reader, Object *ob, const char **err_str)
 
static ISampleSelector sample_selector_for_time (float time)
 
MeshABC_read_mesh (CacheReader *reader, Object *ob, Mesh *existing_mesh, const float time, const char **err_str, int read_flag)
 
bool ABC_mesh_topology_changed (CacheReader *reader, Object *ob, Mesh *existing_mesh, const float time, const char **err_str)
 
void CacheReader_free (CacheReader *reader)
 
void CacheReader_incref (CacheReader *reader)
 
CacheReaderCacheReader_open_alembic_object (AbcArchiveHandle *handle, CacheReader *reader, Object *object, const char *object_path)
 
static const PropertyHeader * get_property_header (const IPolyMeshSchema &schema, const char *name)
 
bool ABC_has_vec3_array_property_named (struct CacheReader *reader, const char *name)
 
static V3fArraySamplePtr get_velocity_prop (const IPolyMeshSchema &schema, const ISampleSelector &iss, const std::string &name)
 
int ABC_read_velocity_cache (CacheReader *reader, const char *velocity_name, const float time, float velocity_scale, int num_vertices, float *r_vertex_velocities)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ABC_NO_ERROR 
ABC_ARCHIVE_FAIL 

Definition at line 413 of file alembic_capi.cc.

Function Documentation

◆ ABC_create_handle()

AbcArchiveHandle* ABC_create_handle ( struct Main bmain,
const char *  filename,
ListBase object_paths 
)

◆ ABC_free_handle()

void ABC_free_handle ( AbcArchiveHandle handle)

Definition at line 181 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],
float  time,
float  scale 
)

◆ ABC_get_version()

int ABC_get_version ( void  )

Definition at line 186 of file alembic_capi.cc.

Referenced by make_alembic_info().

◆ ABC_has_vec3_array_property_named()

bool ABC_has_vec3_array_property_named ( struct CacheReader reader,
const char *  name 
)

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

◆ ABC_mesh_topology_changed()

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

◆ ABC_read_mesh()

Mesh* ABC_read_mesh ( CacheReader reader,
Object ob,
Mesh existing_mesh,
const float  time,
const char **  err_str,
int  read_flag 
)

◆ ABC_read_velocity_cache()

int ABC_read_velocity_cache ( CacheReader reader,
const char *  velocity_name,
const float  time,
float  velocity_scale,
int  num_vertices,
float r_vertex_velocities 
)

◆ archive_from_handle()

BLI_INLINE ArchiveReader* archive_from_handle ( AbcArchiveHandle handle)

Definition at line 96 of file alembic_capi.cc.

Referenced by ABC_free_handle(), and CacheReader_open_alembic_object().

◆ CacheReader_free()

void CacheReader_free ( CacheReader reader)

◆ CacheReader_incref()

void CacheReader_incref ( CacheReader reader)

Definition at line 825 of file alembic_capi.cc.

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

◆ CacheReader_open_alembic_object()

CacheReader* CacheReader_open_alembic_object ( AbcArchiveHandle 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 191 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

◆ get_property_header()

static const PropertyHeader* get_property_header ( const IPolyMeshSchema &  schema,
const char *  name 
)
static

Definition at line 867 of file alembic_capi.cc.

References blender::io::alembic::has_property().

Referenced by ABC_has_vec3_array_property_named().

◆ get_velocity_prop()

static V3fArraySamplePtr get_velocity_prop ( const IPolyMeshSchema &  schema,
const ISampleSelector &  iss,
const std::string &  name 
)
static

Definition at line 916 of file alembic_capi.cc.

References blender::io::alembic::has_property().

Referenced by ABC_read_velocity_cache().

◆ handle_from_archive()

BLI_INLINE AbcArchiveHandle* handle_from_archive ( ArchiveReader archive)

Definition at line 101 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 654 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

◆ sample_selector_for_time()

static ISampleSelector sample_selector_for_time ( float  time)
static

Definition at line 778 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 233 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, and AlembicObjectPath::path.

Referenced by import_startjob().