Blender
V3.3
source
blender
io
usd
intern
usd_reader_xform.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Adapted from the Blender Alembic importer implementation.
3
* Modifications Copyright 2021 Tangent Animation. All rights reserved. */
4
#pragma once
5
6
#include "
usd.h
"
7
#include "
usd_reader_prim.h
"
8
9
namespace
blender::io::usd
{
10
11
class
USDXformReader
:
public
USDPrimReader
{
12
private
:
13
bool
use_parent_xform_;
14
15
/* Indicates if the created object is the root of a
16
* transform hierarchy. */
17
bool
is_root_xform_;
18
19
public
:
20
USDXformReader
(
const
pxr::UsdPrim &
prim
,
21
const
USDImportParams
&import_params,
22
const
ImportSettings
&settings)
23
:
USDPrimReader
(
prim
, import_params, settings),
24
use_parent_xform_(false),
25
is_root_xform_(
is_root_xform_prim
())
26
{
27
}
28
29
void
create_object
(
Main
*bmain,
double
motionSampleTime)
override
;
30
void
read_object_data
(
Main
*bmain,
double
motionSampleTime)
override
;
31
32
void
read_matrix
(
float
r_mat[4][4],
float
time
,
float
scale,
bool
*r_is_constant);
33
34
bool
use_parent_xform
()
const
35
{
36
return
use_parent_xform_;
37
}
38
void
set_use_parent_xform
(
bool
flag)
39
{
40
use_parent_xform_ = flag;
41
is_root_xform_ =
is_root_xform_prim
();
42
}
43
44
bool
prim_has_xform_ops
()
const
;
45
46
protected
:
47
/* Returns true if the contained USD prim is the root of a transform hierarchy. */
48
bool
is_root_xform_prim
()
const
;
49
};
50
51
}
// namespace blender::io::usd
blender::io::usd::USDPrimReader
Definition:
usd_reader_prim.h:69
blender::io::usd::USDPrimReader::prim
const pxr::UsdPrim & prim() const
Definition:
usd_reader_prim.cc:27
blender::io::usd::USDXformReader
Definition:
usd_reader_xform.h:11
blender::io::usd::USDXformReader::create_object
void create_object(Main *bmain, double motionSampleTime) override
Definition:
usd_reader_xform.cc:30
blender::io::usd::USDXformReader::USDXformReader
USDXformReader(const pxr::UsdPrim &prim, const USDImportParams &import_params, const ImportSettings &settings)
Definition:
usd_reader_xform.h:20
blender::io::usd::USDXformReader::read_object_data
void read_object_data(Main *bmain, double motionSampleTime) override
Definition:
usd_reader_xform.cc:37
blender::io::usd::USDXformReader::read_matrix
void read_matrix(float r_mat[4][4], float time, float scale, bool *r_is_constant)
Definition:
usd_reader_xform.cc:61
blender::io::usd::USDXformReader::prim_has_xform_ops
bool prim_has_xform_ops() const
Definition:
usd_reader_xform.cc:114
blender::io::usd::USDXformReader::use_parent_xform
bool use_parent_xform() const
Definition:
usd_reader_xform.h:34
blender::io::usd::USDXformReader::is_root_xform_prim
bool is_root_xform_prim() const
Definition:
usd_reader_xform.cc:128
blender::io::usd::USDXformReader::set_use_parent_xform
void set_use_parent_xform(bool flag)
Definition:
usd_reader_xform.h:38
time
double time
Definition:
deg_debug_stats_gnuplot.cc:37
blender::io::usd
Definition:
usd_capi_export.cc:35
Main
Definition:
BKE_main.h:121
USDImportParams
Definition:
usd.h:41
blender::io::usd::ImportSettings
Definition:
usd_reader_prim.h:19
usd.h
usd_reader_prim.h
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1