Blender V4.3
abc_reader_transform.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#include "abc_util.h"
11
12#include "DNA_object_types.h"
13
14#include "BLT_translation.hh"
15
16#include "BKE_object.hh"
17
18using Alembic::Abc::ISampleSelector;
19
20namespace blender::io::alembic {
21
22AbcEmptyReader::AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
23 : AbcObjectReader(object, settings)
24{
25 /* Empties have no data. It makes the import of Alembic files easier to
26 * understand when we name the empty after its name in Alembic. */
27 m_object_name = object.getName();
28
29 Alembic::AbcGeom::IXform xform(object, Alembic::AbcGeom::kWrapExisting);
30 m_schema = xform.getSchema();
31
33}
34
36{
37 return m_schema.valid();
38}
39
41 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
42 const Object *const ob,
43 const char **r_err_str) const
44{
45 if (!Alembic::AbcGeom::IXform::matches(alembic_header)) {
46 *r_err_str = RPT_(
47 "Object type mismatch, Alembic object path pointed to XForm when importing, but not any "
48 "more");
49 return false;
50 }
51
52 if (ob->type != OB_EMPTY) {
53 *r_err_str = RPT_("Object type mismatch, Alembic object path points to XForm");
54 return false;
55 }
56
57 return true;
58}
59
60void AbcEmptyReader::readObjectData(Main *bmain, const ISampleSelector & /*sample_sel*/)
61{
63 m_object->data = nullptr;
64}
65
66} // namespace blender::io::alembic
General operations, lookup, etc. for blender objects.
Object * BKE_object_add_only_object(Main *bmain, int type, const char *name) ATTR_RETURNS_NONNULL
#define RPT_(msgid)
Object is a sort of wrapper for general info.
@ OB_EMPTY
AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override
bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header, const Object *const ob, const char **r_err_str) const override
virtual Alembic::AbcGeom::IXform xform()
void get_min_max_time(const Alembic::AbcGeom::IObject &object, const Schema &schema, chrono_t &min, chrono_t &max)
Definition abc_util.h:82