Blender V5.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
8
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
18namespace blender {
19
20using Alembic::Abc::ISampleSelector;
21
22namespace io::alembic {
23
25{
26 /* Empties have no data. It makes the import of Alembic files easier to
27 * understand when we name the empty after its name in Alembic. */
28 m_object_name = m_iobject.getName();
29
30 Alembic::AbcGeom::IXform xform(m_iobject, Alembic::AbcGeom::kWrapExisting);
31 m_schema = xform.getSchema();
32}
33
35{
36 return m_schema.valid();
37}
38
40 const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
41 const Object *const ob,
42 const char **r_err_str) const
43{
44 if (!Alembic::AbcGeom::IXform::matches(alembic_header)) {
45 *r_err_str = RPT_(
46 "Object type mismatch, Alembic object path pointed to XForm when importing, but not any "
47 "more");
48 return false;
49 }
50
51 if (ob->type != OB_EMPTY) {
52 *r_err_str = RPT_("Object type mismatch, Alembic object path points to XForm");
53 return false;
54 }
55
56 return true;
57}
58
59void AbcEmptyReader::readObjectData(Main *bmain, const ISampleSelector & /*sample_sel*/)
60{
62 m_object->data = nullptr;
63}
64
65} // namespace io::alembic
66} // namespace blender
General operations, lookup, etc. for blender objects.
#define RPT_(msgid)
Object is a sort of wrapper for general info.
AbcEmptyReader(const AbcReaderConstructorArgs &args)
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
AbcObjectReader(const AbcReaderConstructorArgs &args)
virtual Alembic::AbcGeom::IXform xform()
BMesh Iterators.
Object * BKE_object_add_only_object(Main *bmain, ObjectType type, const char *name) ATTR_RETURNS_NONNULL
Definition object.cc:2265