Blender  V3.3
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 
26 
27 const pxr::UsdPrim &USDPrimReader::prim() const
28 {
29  return prim_;
30 }
31 
33 {
34  return object_;
35 }
36 
38 {
39  object_ = ob;
40 }
41 
43 {
44  return prim_.IsValid();
45 }
46 
48 {
49  return refcount_;
50 }
51 
53 {
54  refcount_++;
55 }
56 
58 {
59  refcount_--;
60  BLI_assert(refcount_ >= 0);
61 }
62 
63 } // namespace blender::io::usd
#define BLI_assert(a)
Definition: BLI_assert.h:46
USDPrimReader(const pxr::UsdPrim &prim, const USDImportParams &import_params, const ImportSettings &settings)
const pxr::UsdPrim & prim() const