Blender V4.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
11
12#include "BLI_assert.h"
13
14#include "CLG_log.h"
15static CLG_LogRef LOG = {"io.alembic"};
16
17namespace blender::io::alembic {
18
19using Alembic::Abc::OObject;
20
25
27{
28 OObject original = args_.hierarchy_iterator->get_alembic_object(context->original_export_path);
29 OObject abc_parent = args_.abc_parent;
30 if (!abc_parent.addChildInstance(original, args_.abc_name)) {
31 CLOG_WARN(&LOG, "unable to export %s as instance", args_.abc_path.c_str());
32 return;
33 }
34 CLOG_INFO(&LOG, 2, "exporting instance %s", args_.abc_path.c_str());
35}
36
38{
39 /* Intentionally do nothing. Instances should not have their own custom properties. */
40}
41
42Alembic::Abc::OCompoundProperty ABCInstanceWriter::abc_prop_for_custom_props()
43{
44 return Alembic::Abc::OCompoundProperty();
45}
46
48{
49 /* There is no OObject for an instance. */
50 BLI_assert_msg(0, "ABCInstanceWriter cannot return its Alembic OObject");
51 return OObject();
52}
53
55{
56 return context->is_instance();
57}
58
60{
61 /* Instances don't have data to be written. Just creating them is enough. */
62}
63
64} // namespace blender::io::alembic
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:181
#define CLOG_INFO(clg_ref, level,...)
Definition CLG_log.h:179
static CLG_LogRef LOG
const ABCWriterConstructorArgs args_
Alembic::Abc::OObject get_alembic_object(const std::string &export_path) const
virtual void create_alembic_objects(const HierarchyContext *context) override
virtual bool is_supported(const HierarchyContext *context) const override
virtual void do_write(HierarchyContext &context) override
Alembic::Abc::OCompoundProperty abc_prop_for_custom_props() override
virtual Alembic::Abc::OObject get_alembic_object() const override
void ensure_custom_properties_exporter(const HierarchyContext &context) override
ABCInstanceWriter(const ABCWriterConstructorArgs &args)
#define LOG(severity)
Definition log.h:33