Blender
V4.3
source
blender
io
usd
intern
usd_writer_volume.hh
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
#pragma once
5
6
#include <optional>
7
8
#include "
usd_writer_abstract.hh
"
9
10
struct
Volume
;
11
12
namespace
blender::io::usd
{
13
14
/* Writer for writing OpenVDB assets to UsdVolVolume. Volume data is stored in separate `.vdb`
15
* files which are referenced in USD file. */
16
class
USDVolumeWriter
:
public
USDAbstractWriter
{
17
public
:
18
USDVolumeWriter
(
const
USDExporterContext
&ctx);
19
20
protected
:
21
virtual
bool
check_is_animated
(
const
HierarchyContext
&context)
const override
;
22
virtual
void
do_write
(
HierarchyContext
&context)
override
;
23
24
private
:
25
/* Try to ensure that external `.vdb` file is available for USD to be referenced. Blender can
26
* either reference external OpenVDB data or generate such data internally. Latter option will
27
* mean that `resolve_vdb_file` method will try to export volume data to a new `.vdb` file.
28
* If successful, this method returns absolute file path to the resolved `.vdb` file, if not,
29
* returns `std::nullopt`. */
30
std::optional<std::string> resolve_vdb_file(
const
Volume
*volume)
const
;
31
32
std::optional<std::string> construct_vdb_file_path(
const
Volume
*volume)
const
;
33
std::optional<std::string> construct_vdb_relative_file_path(
34
const
std::string &vdb_file_path)
const
;
35
};
36
37
}
// namespace blender::io::usd
blender::io::usd::USDAbstractWriter
Definition
usd_writer_abstract.hh:29
blender::io::usd::USDVolumeWriter
Definition
usd_writer_volume.hh:16
blender::io::usd::USDVolumeWriter::check_is_animated
virtual bool check_is_animated(const HierarchyContext &context) const override
Definition
usd_writer_volume.cc:30
blender::io::usd::USDVolumeWriter::do_write
virtual void do_write(HierarchyContext &context) override
Definition
usd_writer_volume.cc:36
blender::io::usd::USDVolumeWriter::USDVolumeWriter
USDVolumeWriter(const USDExporterContext &ctx)
Definition
usd_writer_volume.cc:28
blender::io::usd
Definition
usd_armature_utils.cc:17
Volume
Definition
DNA_volume_types.h:42
blender::io::HierarchyContext
Definition
IO_abstract_hierarchy_iterator.h:45
blender::io::usd::USDExporterContext
Definition
usd_exporter_context.hh:22
usd_writer_abstract.hh
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0