26 using Alembic::AbcGeom::IObject;
27 using Alembic::AbcGeom::IXform;
28 using Alembic::AbcGeom::IXformSchema;
35 m_settings(&settings),
36 m_min_time(
std::numeric_limits<chrono_t>::
max()),
37 m_max_time(
std::numeric_limits<chrono_t>::
min()),
39 parent_reader(nullptr)
41 m_name =
object.getFullName();
42 std::vector<std::string> parts;
45 if (parts.size() >= 2) {
60 IXform ixform =
xform();
65 const IXformSchema &schema(ixform.getSchema());
66 if (!schema.valid()) {
67 std::cerr <<
"Alembic object " << ixform.getFullName() <<
" has an invalid schema."
74 IObject ixform_parent = ixform.getParent();
75 if (!ixform_parent.getParent()) {
101 const Imath::M44d &m1,
104 float mat0[4][4], mat1[4][4],
ret[4][4];
119 Alembic::AbcGeom::index_t i0,
i1;
120 Alembic::AbcGeom::XformSample s0, s1;
123 time, schema.getTimeSampling(), schema.getNumSamples(), i0,
i1);
125 schema.get(s0, Alembic::AbcGeom::ISampleSelector(i0));
128 schema.get(s1, Alembic::AbcGeom::ISampleSelector(
i1));
132 return s0.getMatrix();
136 const Alembic::Abc::ISampleSelector &
UNUSED(sample_sel),
138 const char *
UNUSED(velocity_name),
139 const float UNUSED(velocity_scale),
140 const char **
UNUSED(err_str))
142 return existing_mesh;
146 const Alembic::Abc::ISampleSelector & )
155 bool is_constant =
false;
156 float transform_from_alembic[4][4];
184 if (IXform::matches(
m_iobject.getMetaData())) {
186 return IXform(
m_iobject, Alembic::AbcGeom::kWrapExisting);
188 catch (Alembic::Util::Exception &ex) {
189 printf(
"Alembic: error reading object transform for '%s': %s\n",
198 IObject abc_parent =
m_iobject.getParent();
201 if (abc_parent.getParent() && IXform::matches(abc_parent.getMetaData())) {
203 return IXform(abc_parent, Alembic::AbcGeom::kWrapExisting);
205 catch (Alembic::Util::Exception &ex) {
206 printf(
"Alembic: error reading object transform for '%s': %s\n",
207 abc_parent.getFullName().c_str(),
223 IXform ixform =
xform();
226 r_is_constant =
true;
230 const IXformSchema &schema(ixform.getSchema());
231 if (!schema.valid()) {
232 std::cerr <<
"Alembic object " << ixform.getFullName() <<
" has an invalid schema."
245 float camera_rotation[4][4];
252 float scale_mat[4][4];
257 r_is_constant = schema.isConstant();
struct bConstraint * BKE_constraint_add_for_object(struct Object *ob, const char *name, short type)
void id_us_plus(struct ID *id)
struct ModifierData * BKE_modifier_new(int type)
General operations, lookup, etc. for blender objects.
void BKE_object_to_mat4(struct Object *ob, float r_mat[4][4])
void BKE_object_apply_mat4(struct Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void interp_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], float t)
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void unit_m4(float m[4][4])
void scale_m4_fl(float R[4][4], float scale)
void axis_angle_to_mat4_single(float R[4][4], char axis, float angle)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
@ CONSTRAINT_TYPE_TRANSFORM_CACHE
@ eModifierType_MeshSequenceCache
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint i1
std::string m_object_name
Alembic::Abc::IObject m_iobject
AbcObjectReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
void read_matrix(float r_mat[4][4], chrono_t time, float scale, bool &is_constant)
const Alembic::Abc::IObject & iobject() const
void determine_inherits_xform()
virtual bool topology_changed(const Mesh *existing_mesh, const Alembic::Abc::ISampleSelector &sample_sel)
virtual Alembic::AbcGeom::IXform xform()
void setupObjectTransform(chrono_t time)
virtual struct Mesh * read_mesh(struct Mesh *mesh, const Alembic::Abc::ISampleSelector &sample_sel, int read_flag, const char *velocity_name, float velocity_scale, const char **err_str)
ImportSettings * m_settings
static void get_weight_and_index(CDStreamConfig &config, Alembic::AbcCoreAbstract::TimeSamplingPtr time_sampling, size_t samples_number)
Imath::M44d get_matrix(const IXformSchema &schema, const chrono_t time)
void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMode mode)
static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1, const double weight)
Imath::M44d convert_matrix_datatype(float mat[4][4])
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
struct CacheFile * cache_file
bool always_add_cache_reader