Welcome to mirror list, hosted at ThFree Co, Russian Federation.

usd_reader_stage.h « intern « usd « io « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0bd9a40d5ad753aa6701ab6b8ea1cb1b31168711 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software  Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2016 Kévin Dietrich.
 * All rights reserved.
 */

/** \file
 * \ingroup busd
 */

#ifndef __USD_READER_ARCHIVE_H__
#define __USD_READER_ARCHIVE_H__

struct Main;
struct Scene;

#include "usd.h"
#include "usd_reader_prim.h"

#include <pxr/pxr.h>
#include <pxr/usd/usd/stage.h>

#include <vector>

struct ImportSettings;

namespace blender::io::usd {

/* Wrappers around input and output archives. The goal is to be able to use
 * streams so that unicode paths work on Windows (T49112), and to make sure that
 * the stream objects remain valid as long as the archives are open.
 */

class USDStageReader {
  pxr::UsdStageRefPtr m_stage;
  USDImportParams m_params;
  ImportSettings m_settings;

  std::vector<USDPrimReader *> m_readers;

 public:
  USDStageReader(struct Main *bmain, const char *filename);
  ~USDStageReader();

  std::vector<USDPrimReader *> collect_readers(struct Main *bmain,
                                               const USDImportParams &params,
                                               ImportSettings &settings);

  bool valid() const;

  pxr::UsdStageRefPtr stage()
  {
    return m_stage;
  }
  USDImportParams &params()
  {
    return m_params;
  }
  ImportSettings &settings()
  {
    return m_settings;
  }

  void params(USDImportParams &a_params)
  {
    m_params = a_params;
  }
  void settings(ImportSettings &a_settings)
  {
    m_settings = a_settings;
  }

  void clear_readers();
};

};  // namespace blender::io::usd

#endif /* __USD_READER_ARCHIVE_H__ */