blob: 0819236a56ded6e642ca3f0c8e2b815da957c5ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/* SPDX-License-Identifier: GPL-2.0-or-later
* Adapted from the Blender Alembic importer implementation.
* Modifications Copyright 2021 Tangent Animation. All rights reserved. */
#include "usd_reader_prim.h"
#include "BLI_utildefines.h"
namespace blender::io::usd {
USDPrimReader::USDPrimReader(const pxr::UsdPrim &prim,
const USDImportParams &import_params,
const ImportSettings &settings)
: name_(prim.GetName().GetString()),
prim_path_(prim.GetPrimPath().GetString()),
object_(nullptr),
prim_(prim),
import_params_(import_params),
parent_reader_(nullptr),
settings_(&settings),
refcount_(0)
{
}
USDPrimReader::~USDPrimReader() = default;
const pxr::UsdPrim &USDPrimReader::prim() const
{
return prim_;
}
Object *USDPrimReader::object() const
{
return object_;
}
void USDPrimReader::object(Object *ob)
{
object_ = ob;
}
bool USDPrimReader::valid() const
{
return prim_.IsValid();
}
int USDPrimReader::refcount() const
{
return refcount_;
}
void USDPrimReader::incref()
{
refcount_++;
}
void USDPrimReader::decref()
{
refcount_--;
BLI_assert(refcount_ >= 0);
}
} // namespace blender::io::usd
|