Blender V5.3
abc_writer_instance.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
11
12#include "BLI_assert.hh"
13
14#include "CLG_log.h"
15
16namespace blender {
17
18static CLG_LogRef LOG = {"io.alembic"};
19
20namespace io::alembic {
21
22using Alembic::Abc::OObject;
23
28
30{
31 OObject original = args_.hierarchy_iterator->get_alembic_object(context->original_export_path);
32 OObject abc_parent = args_.abc_parent;
33 if (!abc_parent.addChildInstance(original, args_.abc_name)) {
34 CLOG_WARN(&LOG, "unable to export %s as instance", args_.abc_path.c_str());
35 return;
36 }
37 CLOG_DEBUG(&LOG, "exporting instance %s", args_.abc_path.c_str());
38}
39
41{
42 /* Intentionally do nothing. Instances should not have their own custom properties. */
43}
44
45Alembic::Abc::OCompoundProperty ABCInstanceWriter::abc_prop_for_custom_props()
46{
47 return Alembic::Abc::OCompoundProperty();
48}
49
51{
52 /* There is no OObject for an instance. */
53 BLI_assert_msg(0, "ABCInstanceWriter cannot return its Alembic OObject");
54 return OObject();
55}
56
58{
59 return context->is_instance();
60}
61
63{
64 /* Instances don't have data to be written. Just creating them is enough. */
65}
66
67} // namespace io::alembic
68} // namespace blender
#define CLOG_DEBUG(clg_ref,...)
Definition CLG_log.h:191
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:189
#define BLI_assert_msg(a, msg)
ABCAbstractWriter(const ABCWriterConstructorArgs &args)
const ABCWriterConstructorArgs args_
Alembic::Abc::OObject get_alembic_object(const std::string &export_path) const
void create_alembic_objects(const HierarchyContext *context) override
bool is_supported(const HierarchyContext *context) const override
void do_write(HierarchyContext &context) override
Alembic::Abc::OCompoundProperty abc_prop_for_custom_props() override
Alembic::Abc::OObject get_alembic_object() const override
void ensure_custom_properties_exporter(const HierarchyContext &context) override
ABCInstanceWriter(const ABCWriterConstructorArgs &args)
BMesh Iterators.
static CLG_LogRef LOG
Definition logging.cpp:12