Blender
V3.3
source
blender
io
usd
intern
usd_reader_prim.cc
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
5
#include "
usd_reader_prim.h
"
6
7
#include "
BLI_utildefines.h
"
8
9
namespace
blender::io::usd
{
10
11
USDPrimReader::USDPrimReader
(
const
pxr::UsdPrim &prim,
12
const
USDImportParams
&import_params,
13
const
ImportSettings
&settings)
14
: name_(prim.GetName().GetString()),
15
prim_path_(prim.GetPrimPath().GetString()),
16
object_(nullptr),
17
prim_(prim),
18
import_params_(import_params),
19
parent_reader_(nullptr),
20
settings_(&settings),
21
refcount_(0)
22
{
23
}
24
25
USDPrimReader::~USDPrimReader
() =
default
;
26
27
const
pxr::UsdPrim &
USDPrimReader::prim
()
const
28
{
29
return
prim_
;
30
}
31
32
Object
*
USDPrimReader::object
()
const
33
{
34
return
object_
;
35
}
36
37
void
USDPrimReader::object
(
Object
*ob)
38
{
39
object_
= ob;
40
}
41
42
bool
USDPrimReader::valid
()
const
43
{
44
return
prim_
.IsValid();
45
}
46
47
int
USDPrimReader::refcount
()
const
48
{
49
return
refcount_
;
50
}
51
52
void
USDPrimReader::incref
()
53
{
54
refcount_
++;
55
}
56
57
void
USDPrimReader::decref
()
58
{
59
refcount_
--;
60
BLI_assert
(
refcount_
>= 0);
61
}
62
63
}
// namespace blender::io::usd
BLI_assert
#define BLI_assert(a)
Definition:
BLI_assert.h:46
BLI_utildefines.h
blender::io::usd::USDPrimReader::object
Object * object() const
Definition:
usd_reader_prim.cc:32
blender::io::usd::USDPrimReader::USDPrimReader
USDPrimReader(const pxr::UsdPrim &prim, const USDImportParams &import_params, const ImportSettings &settings)
Definition:
usd_reader_prim.cc:11
blender::io::usd::USDPrimReader::refcount_
int refcount_
Definition:
usd_reader_prim.h:79
blender::io::usd::USDPrimReader::~USDPrimReader
virtual ~USDPrimReader()
blender::io::usd::USDPrimReader::refcount
int refcount() const
Definition:
usd_reader_prim.cc:47
blender::io::usd::USDPrimReader::object_
Object * object_
Definition:
usd_reader_prim.h:74
blender::io::usd::USDPrimReader::prim_
pxr::UsdPrim prim_
Definition:
usd_reader_prim.h:75
blender::io::usd::USDPrimReader::prim
const pxr::UsdPrim & prim() const
Definition:
usd_reader_prim.cc:27
blender::io::usd::USDPrimReader::incref
void incref()
Definition:
usd_reader_prim.cc:52
blender::io::usd::USDPrimReader::decref
void decref()
Definition:
usd_reader_prim.cc:57
blender::io::usd::USDPrimReader::valid
virtual bool valid() const
Definition:
usd_reader_prim.cc:42
blender::io::usd
Definition:
usd_capi_export.cc:35
Object
Definition:
DNA_object_types.h:242
USDImportParams
Definition:
usd.h:41
blender::io::usd::ImportSettings
Definition:
usd_reader_prim.h:19
usd_reader_prim.h
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1